Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dt = 1e-2;
- t = 0:dt:20;
- y1 = sin(t); h1 = hilbert(y1);
- y2 = sin(t+1); h2 = hilbert(y2);
- p1 = angle(h1); p2 = angle(h2); % Instantaneous phase (wrapped)
- p = unwrap(p2)-unwrap(p1); % Instantaneous phase difference
- figure;
- subplot(211);
- plot(t,p1,'r',t,p2,'b');
- subplot(212);
- plot(t,p,'k');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement