EMD程序和图形.docVIP

  • 13
  • 0
  • 约4.9千字
  • 约 7页
  • 2018-07-10 发布于湖北
  • 举报
原始信号:(脑电图)EMD分解图:EMD程序:% EMD_Gao: Emprical Mode Decomposition by Gao Qiang% % To get the EMD (imf) of signal X% % imf = emd_Gao(x_sig)% x_sig : input sinal (row vector)% % imf : intrinsic mode function% arrange in Matrix, in row, with residual in last row% % See: Huang, Royal Society Proceedings on Math, Physical, % and Engineering Sciences, vol. 454, no. 1971, pp. 903-995, % 8 March 1998% % % function imf = emd(x_sig)clcclose all;% x=1:1000;% y=sin(x)+cos(x);% x_sig=y;% c=x_sig;% copy signal to c% load F:\杨件数据\jizhong.mat;% x=jizhong([1:5000]);% x=jizhong;x=x_sig;c=x;N = length(x); % length of x% SDstop = 0.3; % standard deviation value when sift process stopSDstop = 0.25;imf = []; % Matrix which will contain the successive IMF, and the residue% loop to calculate the imf of signal xwhile (1) h = c; % h is the data series to be processinged SD = 1; % criterion to stop sift process, standard deviation while (SD SDstop) maxVec = []; minVec = []; % look for max and min point for i = 2: N - 1 if h (i - 1) h (i) h (i) h (i + 1) maxVec = [maxVec i]; % get max position end if h (i - 1) h (i) h (i) h (i + 1) minVec = [minVec i]; % get min position end end % check if it is residual if (length (maxVec) + length (minVec)) 2 break; end % % handle end point % if h (1) h (2) % left end point% maxVec = [1 maxVec];% else% minVec = [1 minVec];% end% if h (N) h (N - 1) % right end point% maxVec = [maxVec N];% else % minVec = [minVec N];% end %handle end point lenmax=length(maxVec); lenmin=length(minVec); %left end point if h(1)0 if(maxVec(1)minVec(1)) yleft_max=h(maxVec(1)); yleft_min=-h(1); else yleft_max=h(1); yleft_min=h(

文档评论(0)

1亿VIP精品文档

相关文档