求助以下程序
那位知道去希尔伯特包络趋势的算法在那可以找到?下面程序中pd为零,怎么循环?fs_kHz=8% Function to remove the trend in the hilbert envelope
%--------------------------------------------------------------------------
function = rem_trend(h,fs_kHz);
pd = floor(fs_kHz*2/1000);
for i = 1:pd
temp = h(1:i+pd);
Ret(i) = h(i)/mean(temp);
Ret(i) = Ret(i)*h(i);
end;
for i = pd+1:length(h)-pd
temp1 = h(i-pd:i+pd);
Ret(i) = h(i)/mean(temp1);
Ret(i) = Ret(i)*h(i);
end;
for i = (length(h)-pd+1):length(h)
temp2 = h(i:length(h));
Ret(i) = h(i)/mean(temp2);
Ret(i) = Ret(i)*h(i);
end; 下面程序中pd为零,怎么循环?fs_kHz=8
是不是你给的fs_kHz=8太小了呢?
你程序中pd的作用似乎就是把h分为几块,然后分段求均值,再处理
[ 本帖最后由 zhlong 于 2007-5-9 11:41 编辑 ]
页:
[1]