爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 71848|回复: 138

[源程序] EEMD程序,和大家分享

  [复制链接]

新浪微博达人勋

发表于 2012-9-27 16:41:04 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
该文的原始网址是:http://rcada.ncu.edu.tw/research1_clip_ex.htm,但是打开较慢,生怕有一天打不开,现全部粘贴至此。和大家共享,自己留用。
Tutorial for the HHT MATLAB  program
A few examples of how to use these programs are given, with a given dataset “gsta.dat”, which is the annual mean global surface temperature anomaly. In “gsta.dat”, the first column is the time; and the second is the corresponding data value.
1)      Load and display data
>> load gsta.dat;
>> plot(gsta(:,1),gsta(:,2));
>> axis([1850 2010 -0.6 0.6]);
>> title('the annual mean global surface temperature anomaly')
>> xlabel('year')
>> ylabel('Kelvin')
 

                               
登录/注册后可看大图
2)      Using the program as a traditional EMD tool
The eemd.m can be used as an EMD decomposition tool:
>> year=gsta(:,1);
>> inData=gsta(:,2);
>> rslt=eemd(inData,0,1);
>> plot(year,rslt(:,2));
>> hold on;
>> plot(year,rslt(:,3)-0.3);
>> plot(year,rslt(:,4)-0.6);
>> plot(year,rslt(:,5)-0.9);
>> plot(year,sum(rslt(:,6:8),2)-1.3,'r-');
>> hold off
>> set(gca,'yTickLabel',[]);
>> axis([1850 2010 -1.8 0.3]);
>> xlabel('year');

                               
登录/注册后可看大图
relt” is a matrix containing the decomposition results, with the first column the original input (“gsta(:,2)”) and the last column the trend. In between are the IMFs of frequencies from high to low.
It should be noted that since in the eemd.m, the total number of IMFs m is specified as log2(N)-1, in some occasions (such as the one in this example), the components may be excessively extracted. In these cases, the sum of the latest columns may already satisfy the definition of a trend.
 
3)  Instantaneous frequency of an IMF
The instantaneous frequency can be obtained through calling ifndq.m function:
>> omega_m3=ifndq(rslt(:,4),1);
>> subplot(2,1,1);
>> plot(year,rslt(:,4));
>> axis([1850 2010 -0.12 0.12]);
>> title('IMF C3');
>> ylabel('Kelvin');
>> grid;
>> subplot(2,1,2);
>> plot(year, omega_m3/2/pi,'r-');
>> grid;
>> xlabel('year');
>> ylabel('cycle/year');
>> title('instantaneous frequency');
>> axis([1850 2010 0 0.12]);

                               
登录/注册后可看大图
 
It should be noted that the instantaneous frequency calculation program is not suitable for under sampled oscillations, such as the first IMF (with an averaged period about 3 data points).  However, for such under sampled oscillations, the instantaneous frequency is no longer “instantaneous” any way, and any method used to obtain such a quantity will have big errors.
 
4)  Using the program as a EEMD tool
The eemd.m can be used as an EEMD decomposition tool. In this case, the noise assed has an amplitude (standard deviation) of 0.2 of the standard deviation of the linearly detrended annual mean global surface temperature anomaly; and the number of ensemble is 100:
>> rslt=eemd(inData,0.2,100);
>> t(1)=1850;
>> t(2)=2010;
>> y1(1)=0;
>> y1(2)=0;
>> y2(1)=-0.3;
>> y2(2)=-0.3;
>> y3(1)=-0.6;
>> y3(2)=-0.6;
>> y4(1)=-0.9;
>> y4(2)=-0.9;
>> y5(1)=-1.2;
>> y5(2)=-1.2;
>> y6(1)=-1.6;
>> y6(2)=-1.6;
>> plot(t,y1,'k-');
>> hold on;
>> plot(t,y2,'k-');
>> plot(t,y3,'k-');
>> plot(t,y4,'k-');
>> plot(t,y5,'k-');
>> plot(t,y6,'k-');
>> plot(year,rslt(:,1));
>> plot(year,rslt(:,3)-0.3);
>> plot(year,rslt(:,4)-0.6);
>> plot(year,rslt(:,5)-0.9);
>> plot(year,rslt(:,6)-1.2);
>> plot(year,sum(rslt(:,7:8),2)-1.6,'r-');
>> set(gca,'yTickLabel',[]);
>> title('EEMD decomposition of GSTA (A_n=0.2; N_e_s_b=100)')
>> axis([1850 2010 -2.1 0.2]);
>> xlabel('year');

                               
登录/注册后可看大图
 
 
5)  Statistical significance test
Since the annual mean global surface temperature anomaly behaves completely different from a white noise series, we use computer generated white noise to illustrate how the significance.m can be used:
>> clear;
>> clf;
>> data=randn(512,1);
>> rslt=eemd(data,0,1);
>> imfs=rslt(:,2:8);
>> [sigline95,logep]=significance(imfs,0.05);
>> [sigline99,logep]=significance(imfs,0.01);
>> plot(sigline95(:,1),sigline95(:,2));  %  95 percenta line
>> hold on
>> plot(sigline99(:,1),sigline99(:,2),'m-');  % 99 percenta line
>> plot(logep(:,1),logep(:,2),'r*');  
>> plot(logep(1,1),logep(1,2),'k*');
>> grid;
>> xlabel('LOG2 ( Mean Period )');
>> ylabel('LOG2 ( Mean Normalized Energy )');
>> title('Significance test of IMFs of white noise');
>> axis([0 10 -7 0])

                               
登录/注册后可看大图
 
3)  Trend and detrending
For example, in the previous decomposition, the sum of the last three columns satisfies the definition of trend well.
>> plot(year, rslt(:,1));
>> hold on;
>> plot(year, sum(rslt(:,7:8),2),'r-');
>> plot(year, sum(rslt(:,6:8),2),'g-');
>> plot(year, sum(rslt(:,5:8),2),'m-');
>> title('Trends of different timescales');
>> ylabel('Kelvin');
>> xlabel('year');
>> grid;

                               
登录/注册后可看大图
 

评分

参与人数 5金钱 +28 贡献 +4 收起 理由
有消息 + 3
我现实你天真 + 1 赞一个!
mofangbao + 12 + 3
budapestw + 2
topmad + 10 + 1 赞一个!

查看全部评分

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-5-8 18:00:23 | 显示全部楼层
云大小子 发表于 2015-5-1 16:51
这个本征模态到底是什么量,具体有什么物理意义,求解惑,我个人一直会以为是距平。

看官网上的第一个图:the annual mean global surface temperature anomaly,就是全球表面年均温度距平,注意:它本身就是一个距平序列!这是一个具有上升趋势的杂乱无章振荡的距平时间序列。第二个图是EMD分解得到的4个本征模态和残余量R。EMD或EEMD把原本非平稳序列分解成了由高频到低频的4个本征模态,就是把原序列分解成不同时间尺度(不同周期)的规则振荡信号,针对这个图可以说是分解成几个规则的年际到年代际振荡信号,最后的残余量R就是整个原始序列的趋势!总结一下:EMD或EEMD把全球年均温度距平序列分解成不同周期的自然振荡信号和单调的趋势信号!
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

发表于 2015-4-29 11:34:24 | 显示全部楼层
云大小子 发表于 2015-4-19 15:33
第二个图的纵坐标是什么物理量

第二个图是把分解得到的4个本征模态和残余量叠放在一起比较,所以纵坐标没有什么意义
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

发表于 2015-1-12 17:24:47 | 显示全部楼层
congxiaochong 发表于 2014-9-26 15:30
rslt=eemd(inData,0,1); 请问调用这个函数时 括号内的 第二个第三个参数 0,1 都是什么啊  这两个参数 就必 ...

rslt=eemd(inData,0,1)表示信噪比0,集合次数1,这时EEMD退化成EMD,这是做一次EMD分解;又例:rslt=eemd(inData,0.2,400),表示信噪比0.2,集合次数400,意即每次做在EMD分解前在原始序列inData上加入人为白噪声,信噪比0.2,然后才做EMD分解;如此连续做400次,每次加入的白噪声不同,信噪比均为0.2,最后取这400次EMD结果的集合平均作为最终分解的模态,这就是EEMD。
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2012-10-16 10:52:51 | 显示全部楼层
yangzuxiang 发表于 2012-10-15 13:43
楼主,我执行后,发现没有‘extrema'这个function···它是matlaB自带的还是程序自定义的呢?

程序定义的,你可以在这而下
http://rcada.ncu.edu.tw/research1_clip_program.htm
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

发表于 2015-4-29 11:48:50 | 显示全部楼层
云大小子 发表于 2015-4-19 15:35
还有个问题 第二个图中c1+c2+c3+c4+c5+R是不是就等于第一张图的数据

严格地说不等于。如果是EMD分解,一定是等于的。但EMD分解的缺陷是它只提取了整个序列中少量极值的信息,这少量极值的观测误差是不可避免的。EEMD采用引入人为白噪声和取集合平均的方法克服了极值观测误差带来的影响,但是引入噪声就改变了原始序列。所以C1+C2+C3+C4+R并不严格等于原始序列,但是非常非常地接近。
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

发表于 2012-9-27 18:46:00 | 显示全部楼层
感谢分享,代码最好用专门的显示代码的插件
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2012-9-27 22:56:49 | 显示全部楼层
怎么到了,第2部就不行了呢
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2012-9-29 10:17:00 | 显示全部楼层
棉花糖 发表于 2012-9-27 22:56
怎么到了,第2部就不行了呢

你先把他的数据下下来测试一下,但是你得有他的程序,里面蓝字体的EEMD.M下下来,我现在也还再试我的数据
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-7-7 06:54:44 | 显示全部楼层
收藏之,好东西
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2012-10-15 13:43:07 | 显示全部楼层
楼主,我执行后,发现没有‘extrema'这个function···它是matlaB自带的还是程序自定义的呢?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2012-10-17 15:41:44 | 显示全部楼层
humes 发表于 2012-10-16 10:52
程序定义的,你可以在这而下
http://rcada.ncu.edu.tw/research1_clip_program.htm

谢啦~~~找到了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-1-19 03:50:59 | 显示全部楼层
楼主可以做点简要的注释或者对EEMD做个简要的介绍吗?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-1-19 09:35:04 | 显示全部楼层
本帖最后由 爱的侍者 于 2013-1-19 09:37 编辑

QQ截图20130119093449.png nnspe.m中存在问题,为啥显示disp_value 是黄色的?
significanceIMF也是这个问题
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

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