www.pudn.com > hilbert.rar > hilbert_envelope.m, change:2008-11-13,size:297b


function p=hilbert_envelope(x,fs) 
% 
% 
% 
 
x=x/max(abs(x))+eps; 
 
hx=hilbert(x); 
e=abs(hx); 
N=round(fs*0.02); 
w=(window(@hamming,N))'; 
c=0; 
for k=round(N/2):length(x)-round(N/2) 
    c=c+1; 
    v=e(k-round(N/2)+1:k+round(N/2)); 
    p(c)=sum(w.*v)/N; 
end 
 
p=0.9*p*max(x)/max(p); 
 
5;