1.代码
clear
clc
N=1024;
t=0:1/1024:(1024-1)/1024;
x1=sin(2*pi*100*t); %频率100的周期正弦信号
x2=(0.5+sin(2*pi*5*t)).*sin(2*pi*20*t.^2+2*pi*80*t);%调幅调频信号
x3=x1+x2;
figure(1)
subplot(3,1,1);
plot(t,x1);
title('周期信号')
xlabel('s');
subplot(3,1,2);
plot(t,x2);
title('调幅调频信号')
xlabel('s');
subplot(3,1,3);
plot(t,x3);
title('周期信号+调幅调频信号')
xlabel('s');
imfeemd=eemd(x3,0.3,50);
%显示x3信号的EEMD的部分IMF
figure(2)
subplot(7,1,1);
plot(t,imfeemd(:,1)) %画原始信号
xlabel('s')
ylabel('原始信号x3')
subplot(7,1,2);
plot(t,imfeemd(:,2)) %画IMF1
xlabel('s')
ylabel('IMF1')
subplot(7,1,3);
plot(t,imfeemd(:,3)) %画IMF2
xlabel('s')
ylabel('IMF2')
subplot(7,1,4);
plot(t,imfeemd(:,4)) %画IMF3
xlabel('s')
ylabel('IMF3')
subplot(7,1,5);
plot(t,imfeemd(:,5)) %画IMF4
xlabel('s')
ylabel('IMF4')
subplot(7,1,6);
plot(t,imfeemd(:,6)) %画IMF5
xlabel('s')
ylabel('IMF5')
subplot(7,1,7);
plot(t,imfeemd(:,11)) %画残差
xlabel('s')
ylabel('残差')
2.运行结果
注:MATLAB没有现成的EEMD算法函数,EEMD算法函数和示例程序可在e小白官网《MATLAB-EEMD》文章中下载。