Advertisement
Guest User

Hilbert Results

a guest
Apr 27th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.51 KB | None | 0 0
  1. function [ia,iph,ifq] = HilbertRes(s,fs)
  2. %HilbertRes Obtains useful results from the Hilbert Transform
  3. %   Calculates the instant amplitude, phase and frequency from
  4. %   the Hilbert Transform of the signal provided
  5.  
  6. % Input Arguments
  7. %   s   :  signal
  8.  
  9. % Output Arguments
  10. %   ia   :  instant amplitude
  11. %   iph  :  instant phase [Hz]
  12. %   ifq  :  instant frequency
  13.  
  14. H = hilbert(s); HT = imag(H);
  15.  
  16. ia = sqrt(s.^2 + HT.^2);
  17.  
  18. ifq = angle(H(2:end).*conj(H(1:end-1)))*fs/(2*pi);
  19.  
  20. iph = 2*pi*fs*cumtrapz(ifq);
  21.  
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement