Hi
I have two sine signals A and B(50Hz) which are simultaneously sampled at 2500 Hz using external ADC interfaced with Atmega2560. I find that signal B lags A by about 5 degrees(using scope). I would like to digitally lead signal B to sync it with A. Any proven algorithm? ( I do not want to use analog methods)
To me that looks like some 5.55 uS of delay. 1 000 000 uS / 2500 x (5/360). My guess is that the A/D conversions are triggered one first and the other shortly, 5.55 uS later.
One fix could be to measure the delay and compensate for tht in the calculations.
Attach Your code.
I have not written any code. I am asking suggestions. I use AD7606 which claims that sampling is simultaneous without latency between samples.
I would like to digitally lead signal B to sync it with A.
Sounds like a problem for a Phased Locked Loop ( PLL )
Should be able to fix in the maths I would have thought .
Would sampling at a lower rate make any difference (500hz?)
How about delaying the second sample Reading for 20mS ?
Finally .... what are you doing with the sine waves? Does the delay matter?