Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. dt = 1e-2;
  2. t = 0:dt:20;
  3. y1 = sin(t); h1 = hilbert(y1);
  4. y2 = sin(t+1); h2 = hilbert(y2);
  5. p1 = angle(h1); p2 = angle(h2); % Instantaneous phase (wrapped)
  6. p = unwrap(p2)-unwrap(p1); % Instantaneous phase difference
  7.  
  8. figure;
  9. subplot(211);
  10. plot(t,p1,'r',t,p2,'b');
  11. subplot(212);
  12. plot(t,p,'k');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement