EEMD结合CMSE指标算法的 MATLAB程序

clc;
clear;
close all;
% = wnoise(‘ecg’,10);

Fs=40;
Ts=1/40;
n =1024;
t= linspace(0,(n-1)Ts,n);
x=2
sin(2pi1t);
%x=[square(2
pi0.2t,50)+1]/2;
x1=2sin(2pi2t);
x2=2sin(2pi3t+pi);
ygs=wgn(1,n,0.3); %功率为0.2的高斯噪声
y=x+ygs ;

%--------------------eemd分解---------------------------%

Nstd = 0.2;
NE =100; % # of ensemble
numImf =7; % # of imfs
runCEEMD = 0;
maxSift =10;%改变筛的数目
typeSpline = 2;
toModifyBC = 1;
randType = 2;
seedNo = 0;
checksignal = 1;
temp=zeros(1,numImf);
tic;
[imf] = eemd(y,Nstd,NE,numImf);
toc;
for i=1:numImf
temp(i)=sum(Ts*imf(i,:).^2);
end
figure(1)
subplot(numImf+1,1,1)
plot(t,y);axis tight;
for k=1:numImf
subplot(numImf+1,1,k+1)
plot(t,imf(k,:));axis tight;
end

%-------------------------求CMSE最小值--------------------------
[y_min,x_min]=min(temp);
%------------------------重构------------------------------
chonggou=sum(imf(2:numImf,:));
figure(2)

subplot(6,1,5)
plot(t,y);axis tight;
subplot(6,1,6)
k_t=1:numImf;
plot(k_t,temp);axis tight;
subplot(6,1,1)
plot(t,x);axis tight;
subplot(6,1,2)
plot(t,x1);axis tight;
subplot(6,1,3)
plot(t,x2);axis tight;
subplot(6,1,4)
plot(t,ygs);axis tight;
经过EEMD分解得到的信号EEMD结合CMSE指标算法的 MATLAB程序_第1张图片
加入EMSE指标后重构的信号EEMD结合CMSE指标算法的 MATLAB程序_第2张图片

你可能感兴趣的:(EEMD结合CMSE指标算法的 MATLAB程序)