[time-nuts] Re: Complex PLL

Magnus Danielson magnus at rubidium.se
Tue Mar 23 12:36:02 UTC 2021


Hi

On 2021-03-22 23:56, dschuecker wrote:
> Hi,
>> In the code you sent you used a division for phase detection as far
>> as I can tell.
>
> Yes, but it is the Matlab model code, so I dont care about division.
> In 'real life' I multiply with the conjugate complex value. It has the
> same angle and different length, but I normalize anyway.
In my experience I've found it useful to make the model for simulation
as close to the actual model as reasonable, and pure simulation model
tricks distinct from that of normal modeling. My note was only because I
found it a bit hard to separate it up, part due to fatigue issues, but
also because the modeling was not as distinct as I've grown used to, so
hence my comment.
>
> And the 'atan' is always 'atan2', sure.
>
> For a non-complex PLL I beat down to zero the angle of the phase
> discriminator.
> In this complex PLL I beat down to zero the imaginary part of the
> quotient.
You can use real part just as well when you do multiplication. The
difference between complex division and complex multiplication isn't as
great if only amplitudes are fixed, because as the divisor is multiplied
to both sides with the complementary, what remains is a multiplication
with a fixed divisor, so sure, it's about the same but with the complex
inversed.
>
> Another very interesting detail: The carrier I pll on is at 2400Hz, I
> have to demodulate with a synched 1800Hz. This means that I have to
> find the complex value which has 3/4 of the angle without
> atan/cos/sin, sqrt is ok.
So much fun.
>
> This C-Code does the trick:
> cpl4.re=sqrt((1.0+cpl3.re)/2.0f);
> cpl4.im=sqrt((1.0-cpl3.re)/2.0f);
> cpl5.re=sqrt((1.0+cpl4.re)/2.0f);
> cpl5.im=sqrt((1.0-cpl4.re)/2.0f);
> CMUL(cpl5,cpl5,cpl4);
> CMUL(cpl4,cpl5,cpl3);
> CROT(T3,cpl3);

I've done similar stuff to produce 1544 kHz out of a 8 kHz DDS. You got
to live prime numbers like 193 when doing synthesis! I did a x193 on the
sawtooth, cut at the right point and I had a 1544 kHz sawtooth. No extra
oscillator, just a multiplicator block that I had spare anyway. :)

Cheers,
Magnus




More information about the Time-nuts_lists.febo.com mailing list