声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1428|回复: 1

[HHT] Huang编写的EMD程序分享

[复制链接]
发表于 2008-6-4 12:39 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
谁有Huang的EMD分解的程序?
功能是不是和法国人的不太一样?
现在想用来比较一下

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

发表于 2014-3-14 15:24 | 显示全部楼层
% This is an EMD/EEMD program
%
%   function allmode=eemd(Y,Nstd,NE)
%
% INPUT:
%       Y: Inputted data;
%       Nstd: ratio of the standard deviation of the added noise and that of Y;
%       NE: Ensemble number for the EEMD
% OUTPUT:
%       A matrix of N*(m+1) matrix, where N is the length of the input
%       data Y, and m=fix(log2(N))-1. Column 1 is the original data, columns 2, 3, ...
%       m are the IMFs from high to low frequency, and comlumn (m+1) is the
%       residual (over all trend).
%
% NOTE:
%       It should be noted that when Nstd is set to zero and NE is set to 1, the
%       program degenerates to a EMD program.
%
% References can be found in the "Reference" section.
%
% The code is prepared by Zhaohua Wu. For questions, please read the "Q&A" section or
% contact
%   zwu@fsu.edu
%

function allmode=eemd(Y,Nstd,NE)
xsize=length(Y);
dd=1:1:xsize;
Ystd=std(Y);
Y=Y/Ystd;

TNM=fix(log2(xsize))-1;
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,
    for i=1:xsize,
        temp=randn(1,1)*Nstd;
        X1(i)=Y(i)+temp;
    end

    for jj=1:1:xsize,
        mode(jj,1) = Y(jj);
    end
   
    xorigin = X1;
    xend = xorigin;
   
    nmode = 1;
    while nmode <= TNM,
        xstart = xend;
        iter = 1;
   
        while iter<=10,
            [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;
        
        for jj=1:1:xsize,
            mode(jj,nmode) = xstart(jj);
        end
    end
   
    for jj=1:1:xsize,
        mode(jj,nmode+1)=xend(jj);
    end
   
    allmode=allmode+mode;
   
end

allmode=allmode/NE;
allmode=allmode*Ystd;
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-7-15 14:02 , Processed in 0.053586 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表