diff gives you the phase step per sample,
basically the frequency.

However the phase will jump back to zero periodically when the phase exceeds 360°
(when it wraps around) in this case diff will get you a wrong result.

So you need to "unwrap" the phase or the phase difference, for example:


diff = phase_new - phase_old
if phase_old > Pi and phase_new < Pi then diff += 2Pi

or similar.


Am 28.01.2018 um 17:19 schrieb Benny Alexandar:
Hi GM,

>> HT -> Atan2 -> differenciate -> unwrap
Could you please explain how to find the drift using HT,

HT -> gives real(I) & imaginary (Q) components of real signal
Atan2 -> the phase of an I Q signal
diff-> gives what ?
unwrap ?

-ben


------------------------------------------------------------------------
*From:* music-dsp-boun...@music.columbia.edu <music-dsp-boun...@music.columbia.edu> on behalf of gm <g...@voxangelica.net>
*Sent:* Saturday, January 27, 2018 5:20 PM
*To:* music-dsp@music.columbia.edu
*Subject:* Re: [music-dsp] Clock drift and compensation

I don't understand your project at all so not sure if this is helpful,
probably not,
but you can calculate the drift or instantanous frequency of a sine wave
on a per sample basis
using a Hilbert transform
HT -> Atan2 -> differenciate -> unwrap
_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to