" I take the quotient, calculate the angle using the atan function ..."

This is mathematically correct, but programming-wise there's a
function atan2 that does both at once, and also doesn't return
infinity or give a divide-by-zero error if the denominator is zero.

atan2 also does something else, it returns the angle in the correct
quadrant for the signs of x and y. I don't know offhand if this is
your problem, but it can only help. Here's more info:
https://en.wikipedia.org/wiki/Atan2
https://www.johndcook.com/blog/2019/11/18/inverse-trig-functions/

On Wed, Mar 17, 2021 at 1:07 PM Detlef Schuecker via time-nuts
<[email protected]> wrote:
>
> Hi time-nuts,
>
> a PLL takes the phase difference of the incoming signal and the
> synthesized signal and feeds that in a loop filter. The output of the loop
> filter is used to steer the local oscillator.
>
> In my setup I have an incoming complex signal and my local oscillator is
> generating a complex signal as well. So calculation of the phase
> difference is just the quotient of the incoming signal and the local
> oscillator, it is a sampled system. I take the quotient, calculate the
> angle using the atan function and then I feed it in the loop filter, a PI
> controller. The output of the loop filter is converted to a complex phase
> increment for the local oscillator with the sin and cos function.
>
> Now I have to get rid of the atan, cos and sin functions.
>
> I am looking for a loop filter which takes the quotient of the
> incoming/synthesized signal as a complex value. The output of this loop
> filter should be the phase increment for the local oscillator. It should
> not use the angle of the complex value explicitly, as this will involve
> the atan/cos/sin functions.
>
> Is someone aware of such a loop filter? I surfed through Gardners'
> 'Phaselock Techniques' but did not find a hint.
>
> Thank you
> Detlef Schücker
>
> DD4WV
>
> _______________________________________________
> time-nuts mailing list -- [email protected] -- To unsubscribe send an 
> email to [email protected]
> To unsubscribe, go to and follow the instructions there.
_______________________________________________
time-nuts mailing list -- [email protected] -- To unsubscribe send an 
email to [email protected]
To unsubscribe, go to and follow the instructions there.

Reply via email to