|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
在G.Rilling local_emd.m中,下面这段代码怎么读不懂啊,烦请高人给点拨一二……
Q:
1. 此段代码在此任何用意(“ON EMPIRICAL MODE DECOMPOSITION AND ITS ALGORITHMS”中似乎并未说明);
2. 另外程序在 line155 中出现了一个 'j' 却也不知作何用?/ line163中的'num2str(s)' 中的 ‘s’也不知从何而来;
3. 这部分代码对整个EMD分解会不会有较大影响?
谢谢!!!:@)
% definition of f equal to 1 where sifting is needed and
% decays fast to 0 in the neighbourhood
badsx = (sx > sd & amp > mamp/20) | (sx > sd2 & amp > mamp/100);
d = diff([0 badsx 0]);
debs = find(d==1);
fins = find(d==-1)-1;
if length(debs)~=length(fins)
error('pb avec le regroupement en composantes connexes')
end
indextr = sort([indmin indmax]);
d = diff(indextr);
f = [];
connexe = [];
lc = length(debs);
if lc > 0
connexe(lc,lx) = 0;
for i = 1:lc
connexe(i,debs(i):fins(i)) = 1;
% indices of previous and next extrema
indp = min([nem-1,length(find(indextr < debs(i)))]);
inds = max([2,length(find(indextr <= fins(i)))+1]);
% evaluation of extrema densities left and right
llarg = mean(d(min([nem-1,max([1,indp])]):max([1,min([nem-1,indp + 2])])));
rlarg = mean(d(min([nem-1,max([1,inds - 1])]):max([1,min([nem-1,inds + 1])])));
larg = mean([rlarg,llarg]);
% special cases...
if indp == 0
if inds ~= (nem+1)
larg = (indextr(inds)-indextr(inds-1));
else
larg = round(lx/2);
end
else
if inds ~= (nem+1)
larg = max([(indextr(inds)-indextr(inds-1)),(indextr(indp+1)-indextr(indp))]);
else
larg =(indextr(indp+1)-indextr(indp));
end
end
larg = 2*max([round((fins(i)-debs(i))/4),larg,LARGMIN]);
w(1:round(larg/2)) = [1:round(larg/2)]/round(larg/2);
w((2*larg+2-round(larg/2)):(2*larg+1)) = fliplr(w(1:round(larg/2)));
w(round(larg/2):(2*larg+2-round(larg/2))) = 1;
indd = max(1,debs(i)-larg);
indf = min(lx,fins(i)+larg);
connexe(i,indd:debs(i)) = w((larg+1-debs(i)+indd):(larg+1));
connexe(i,fins(i):indf) = w((larg+1):(larg+1+indf-fins(i)));
end
f = max(connexe,[],1);
else
f(lx) = 0;
end
m = m - f.*envmoy;
[indmin,indmax,indzer] = extr(m);
lm=length(indmin);
lM=length(indmax);
nem = lm + lM;
nzm = length(indzer); |
|