Ivan Magrin-Chagnolleau的程序(emd.m)中,求局部最大最小值时,diff函数是求微分的意思吗?起什么作用呢,为什么要有这个函数?本人没有信号处理基础,请大虾指教~
while SD > 0.3
% find local max/min points
d = diff(h); % approximate derivative
maxmin = []; % to store the optima (min and max without distinction so far)
for i=1:N-2
if d(i)==0 % we are on a zero
maxmin = [maxmin, i];
elseif sign(d(i))~=sign(d(i+1)) % we are straddling a zero so
maxmin = [maxmin, i+1]; % define zero as at i+1 (not i)
end
end
if size(maxmin,2) < 2 % then it is the residue
break
end
原帖由 dudubear2009 于 2007-5-23 11:04 发表
谢谢eight~
再请问,
elseif sign(d(i))~=sign(d(i+1)) % we are straddling a zero so
maxmin = [maxmin, i+1]; % define zero as at i+1 (not i)