时序分解 | Matlab实现CEEMD互补集合经验模态分解时间序列信号分解
目录
- 时序分解 | Matlab实现CEEMD互补集合经验模态分解时间序列信号分解
- 效果一览
- 基本介绍
- 程序设计
- 参考资料
效果一览
基本介绍
Matlab实现CEEMD互补集合经验模态分解时间序列信号分解
1.分解效果图 ,效果如图所示,可完全满足您的需求~
2.直接替换txt数据即可用 适合新手小白 注释清晰~
3.附赠案例数据 直接运行main一键出图~
程序设计
- 完整源码和数据获取方式:Matlab实现CEEMD互补集合经验模态分解时间序列信号分解。
function allmode=ceemd(Y,Nstd,NE,TNM)
% find data length
xsize=length(Y);
dd=1:1:xsize;
% Nornaliz data
Ystd=std(Y);
Y=Y/Ystd;
% Initialize saved data
TNM2=TNM+2;
for kk=1:1:TNM2,for ii=1:1:xsize,allmode(ii,kk)=0.0;end
endfor iii=1:1:NE
% adding noisefor i=1:xsize,temp=randn(1,1)*Nstd;X1(i)=Y(i)+temp;X2(i)=Y(i)-temp;end% sifting X1endnmode = 1;while nmode <= TNM,xstart = xend;iter = 1;while iter<=5,[spmax, spmin, flag]=extrema(xstart);upper= spline(spmax(:,1),spmax(:,2),dd);lower= spline(spmin(:,1),spmin(:,2),dd);
、% save a modefor jj=1:1:xsize,mode(jj,nmode) = xstart(jj);endend% save the trendfor jj=1:1:xsize,mode(jj,nmode+1)=xend(jj);end% add mode to the sum of modes from earlier ensemble membersallmode=allmode+mode;%%%=============================================================endnmode = 1;while nmode <= TNM,xstart = xend;iter = 1;while iter<=5,[spmax, spmin, flag]=extrema(xstart);upper= spline(spmax(:,1),spmax(:,2),dd);lower= spline(spmin(:,1),spmin(:,2),dd);mean_ul = (upper + lower)/2;xstart = xstart - mean_ul;iter = iter +1;endxend = xend - xstart;nmode=nmode+1;% save a modefor jj=1:1:xsize,mode(jj,nmode) = xstart(jj);endend% save the trendfor jj=1:1:xsize,mode(jj,nmode+1)=xend(jj);end% add mode to the sum of modes from earlier ensemble membersallmode=allmode+mode;%fprintf('-');
end
% ensemble average
allmode=allmode/NE/2;
% Rescale mode to origional unit.
allmode=allmode*Ystd;
参考资料
[1] https://blog.csdn.net/kjm13182345320/article/details/129215161
[2] https://blog.csdn.net/kjm13182345320/article/details/128105718