资源简介

信号处理与分析(含FFT、包络、峰值检波、PeakVue)

资源截图

代码片段和文件信息

clc;
clear;
close all;
% WaveData=load(‘E:\数据\美国轴承库\外圈\OR007X130-1796-6.0-12k.mat‘);   %107
% WaveData=WaveData.X130_DE_time;
%  sampleFreq   = 12*1000;   
% Data=load(‘E:\形态学\STREAM20090804-104326-859--右下侧--1A-2H--空炉摇炉2.wfs-2-2.5-4.5s.txt‘);
% ReSampleFre=2;
% WaveData=decimate(DataReSampleFre);
% sampleLength = length(WaveData);
% sampleFreq=500000/ReSampleFre;
% ===============================
% WaveData=load(‘E:\数据\美国轴承库\48K\OR007X151-1730-3.3-48k.mat‘); 
% WaveData=WaveData.X151_DE_time;
% sampleFreq   = 48*1000;     
%=================
WaveData=load(‘C:\Users\huhuan\Desktop\大脱硫风机的数据\H_Fault_f25600_n16384.txt‘);
% WaveData=[WaveData(:2);WaveData(:4); WaveData(:6);WaveData(:8)];
sampleFreq   = 10000*2.56;
% %==================================================================
% WaveData=WaveData;
sampleLength=length(WaveData);
%========================仿真信号==============
% sampleFreq=100000
% t=0:1/sampleFreq:1/32;
% s1=0.05*exp(-2*pi*80*t).*sin(2*pi*1000*t+pi);
% %s2=zeros(1length(s1));
% for i=1:3
%     s1=[s1 s1];
% end
% sampleLength = length(s1);
% time_plot_s1 = 0:1/sampleFreq:(sampleLength-1) / sampleFreq; 
% plot(time_plot_s1s1);

% %叠加噪声
% SignalLength = length(s1);
% %计算信号的标准差
% Signal_STD = std(s1);
% %白噪声信号 
% NoiseLevel =0.2;
% init=2055415866;
% randn(‘seed‘init);
% Whitenoise_Signal=NoiseLevel * Signal_STD * randn(1sampleLength);

% t=0:1/sampleFreq:(1/sampleFreq)*(length(s1)-1);
% s2=0.05*sin(2*pi*100*t);
% WaveData1=s1+Whitenoise_Signal;%+s2;
% WaveData=s1;
%==========================================================================
% % %高通滤波
% [ba]        =butter(40.8‘high‘) ; %尖峰能量5K---65K
% filter_data = filter(baWaveData);
% %filter_data=abs(filter_data1);
% WaveData=filter_data;
% sampleLength=length(WaveData);
% fft_result = abs(fft(WaveData)) * 2 / sampleLength;

% %画图的坐标变换以此为准
time_plot_s = (0:(sampleLength-1))/sampleFreq; 
fft_plot_Hz = (1:sampleLength/2-1)*sampleFreq/sampleLength; %注意0频分量,不能从1开始,如果不要直流分量,可从1开始
%                                                             %为了和去掉直流分量后fft
%                                                             %结果(从2开始)维数一样,此
%                                                             %处减1
%                                                             
%                                                            

% figure(2);
% subplot(211)
% plot(time_plot_sWaveData)
% xlabel(‘s‘);
% title(‘时域波形‘);
% subplot(212)
% plot(fft_plot_Hzfft_result(2:sampleLength/2))
% title(‘频域波形‘);
% xlabel(‘Hz‘);
% hold on;
% %做包络分析
%==========================================================================
% % 带通滤波
% [ba]        =butter(4[0.0390.1172]) ; %共振区
% filter_data = filter(baWaveData);
% %filter_data=abs(filter_data1);
% WaveData=filter_data;

% %包络
% envelop_hil = hilbert(WaveData);
% envelop_abs = abs(envelop_hil);  
% %fft变换
% envelop_fft = abs(fft(envelop_abs))*2 /sampl

评论

共有 条评论