% Y: Inputted data;
% Nstd: ratio of the standard deviation of the added noise and that of Y;
% NE: Ensemble member being used
% TNM: total number of modes (not including the trend)
%
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
end
for iii=1:1:NE
% adding noise
for i=1:xsize,
temp=randn(1,1)*Nstd;
X1(i)=Y(i)+temp;
X2(i)=Y(i)-temp;
end
% sifting X1
xorigin = X1;
xend = xorigin;
% save the initial data into the first column
for jj=1:1:xsize
mode(jj,1) = xorigin(jj);
end
nmode = 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;
end
xend = xend - xstart;
nmode=nmode+1;
% save a mode
for jj=1:1:xsize,
mode(jj,nmode) = xstart(jj);
end
end
% save the trend
for jj=1:1:xsize,
mode(jj,nmode+1)=xend(jj);
end
% add mode to the sum of modes from earlier ensemble members
allmode=allmode+mode;
%%%=============================================================
% sifting X2
xorigin = X2;
xend = xorigin;
% save the initial data into the first column
for jj=1:1:xsize,
mode(jj,1) = xorigin(jj);
end
nmode = 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;
end
xend = xend - xstart;
nmode=nmode+1;
% save a mode
for jj=1:1:xsize,
mode(jj,nmode) = xstart(jj);
end
end
% save the trend
for jj=1:1:xsize,
mode(jj,nmode+1)=xend(jj);
end
% add mode to the sum of modes from earlier ensemble members
allmode=allmode+mode;
%fprintf('-');
end
% ensemble average
allmode=allmode/NE/2;
% Rescale mode to origional unit.
allmode=allmode*Ystd;
前程算法屋
- 粉丝: 5770
- 资源: 835
最新资源
- 基于Java spring boot冷链溯源管理系统文档+源码+全部资料+高分项目.zip
- 基于HyperledgerFabric实现的牛奶溯源项目文档+源码+全部资料+高分项目.zip
- 基于frp-0.58.1魔改二开,随机化socks5账户密码及端口、钉钉上线下线通知、配置文件oss加密读取、域前置防止溯源、源码替换编译混淆等文档+源码+全部资料+高分项目.zip
- 基于nem链的区块链汽车零配件溯源项目文档+源码+全部资料+高分项目.zip
- 基于SpringBoot框架的、基于国密算法与群签名的可溯源区块链模拟系统文档+源码+全部资料+高分项目.zip
- 基于lumen开发的微信小程序农场生态管理API设计,文档+源码+全部资料+高分项目.zip
- 基于vue2.0+vuex+vue-router+element-ui开发的农产品溯源系统后台文档+源码+全部资料+高分项目.zip
- 基于超级账本的简易牛奶溯源系统的区块链子系统实现文档+源码+全部资料+高分项目.zip
- 基于开发者平台的供应链溯源案例(网易云课程)文档+源码+全部资料+高分项目.zip
- 基于农产品溯源 基于fisco-bcos实现 分管理和商城两端文档+源码+全部资料+高分项目.zip
- 基于可视水印检测识别的数字媒体溯源应用系统,文档+源码+全部资料+高分项目.zip
- 基于区块链的供应链金融溯源系统文档+源码+全部资料+高分项目.zip
- 基于区块链(fabric)农产品溯源平台文档+源码+全部资料+高分项目.zip
- 基于区块链Hyperledger Fabric V2.5的农产品溯源商品通用溯源应用模板,部署简单,附压测工具、区块链浏览器,文档+源码+全部资料+高分项目.z
- 基于区块链的商品溯源系统文档+源码+全部资料+高分项目.zip
- 基于区块链的食品溯源系统文档+源码+全部资料+高分项目.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈