0
点赞
收藏
分享

微信扫一扫

EMD 加 时频分析

金牛豆豆 2022-04-20 阅读 35
matlab
fs = 500;
ts = 1/fs;
t=0:ts:2;
n=length(t);

z = 0.7*sin(2*pi*15*t) + sin(2*pi*20*t);
imf=emd(z);

subplot(size(imf,1)+1,2,1);
plot(t*ts,z,'k')
grid on ;
title('EMD分解');

subplot(size(imf,1)+1,2,2);
P2=abs(fft(z)/n);
P1=P2(1:n/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = fs*(0:(n/2))/n;
plot(f,P1,'k');
grid on ;
title('对应频谱');

for i = 2:size(imf,1)+1
        
        subplot (size(imf,1)+1,2,i*2-1);
        plot  (t*ts,imf(i-1,:),'k');
        grid on ;
         
         subplot (size(imf,1)+1,2,i*2);
         P2=abs(fft(imf(i-1,:))/n);
         P1=P2(1:n/2+1);
         P1(2:end-1) = 2*P1(2:end-1);
         plot(f,P1,'k');
         grid on ;
end

subplot1 = subplot(6,2,11);
hold(subplot1,'on');
zlabel('ZLabel','EdgeColor',[0 1 0],'Rotation',22);
ylabel({'残差'});
title('Title');

box(subplot1,'off');         % 对当前坐标图加上或撤销边框
% grid(subplot1,'on');
%  emd_visu(z,t,imf)  % EMD专用画图函数

 

举报

相关推荐

0 条评论