Tutorial For The HHT MATLAB
Tutorial For The HHT MATLAB
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)
>>loadgsta.dat;
>>plot(gsta(:,1),gsta(:,2));
>>axis([185020100.60.6]);
>>title('theannualmeanglobalsurfacetemperatureanomaly')
>>xlabel('year')
>>ylabel('Kelvin')
2)
>>year=gsta(:,1);
>>inData=gsta(:,2);
>>
rslt=eemd(inData,0,1);
>>plot(year,rslt(:,2));
>>holdon;
>>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');
>>holdoff
>>set(gca,'yTickLabel',[]);
>>axis([185020101.80.3]);
>>xlabel('year');
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.
>>
omega_m3=ifndq(rslt(:,4),1);
>>subplot(2,1,1);
>>plot(year,rslt(:,4));
>>axis([185020100.120.12]);
>>title('IMFC3');
>>ylabel('Kelvin');
>>grid;
>>subplot(2,1,2);
>>plot(year,omega_m3/2/pi,'r');
>>grid;
>>xlabel('year');
>>ylabel('cycle/year');
>>title('instantaneousfrequency');
>>axis([1850201000.12]);
any way, and any method used to obtain such a quantity will have big
errors.
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');
>>holdon;
>>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('EEMDdecompositionofGSTA(A_n=0.2;N_e_s_b=100)')
>>axis([185020102.10.2]);
>>xlabel('year');
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));%95percentaline
>>holdon
>> 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(MeanPeriod)');
>>ylabel('LOG2(MeanNormalizedEnergy)');
>>title('SignificancetestofIMFsofwhitenoise');
>>axis([01070])
3)
For example, in the previous decomposition, the sum of the last three
columns satisfies the definition of trend well.
>>plot(year,rslt(:,1));
>>holdon;
>>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('Trendsofdifferenttimescales');
>>ylabel('Kelvin');
>>xlabel('year');
>>grid;