# Converting PLL Discriminator into Doppler error

I'm writing a GPS receiver SDR software, and I have calculated the PLL discriminator ouptut as atan(Q_Prompt,I_Prompt) I would like to know the formula that converts the discrminator output to doppler error

• I think you should just remember that a Doppler offset is a frequency, and then consider where the atan comes from, what it describes, and how that entitiy relates to frequency. Apr 8 '20 at 7:59
• Q = m(t)cos(w*t), same for I, so I should take out W from the cosine and subtract Q from I and that's the doppler error ? Apr 8 '20 at 8:16
• i.stack.imgur.com/JUEyg.png Apr 8 '20 at 9:32

Frequency is the derivative of phase versus time, so you can estimate the frequency by calculating the difference between the phase of two successive samples and dividing by the sample time which is the radian frequency in radians/sec- so divide by $$2\pi$$ to get Hz.

For efficient receiver implementation instead of computing the arctangent and performing the computations above consider using the cross product frequency discriminator given by the imaginary term of the complex conjugate multiplication of the current I,Q symbol with the previous, which is beautiful as it simplifies to:

$$Imag((I_1+jQ_1)(I_2-jQ_2))= j(I_2Q_1+Q_2I_1)$$

Which is proportional to the phase difference between the two symbols and therefore the proportional frequency error term. This would provide the frequency error for a frequency lock loop. Similarly by comparing it to a sample on the real axis we see that the phase error for a phase lock loop is simply proportional to Q for each sample.

The I,Q samples above would be the prompt correlation samples and the complex vector I+jQ should be normalized to constant magnitude for the computations above.

• I'm using an FLL by the way, should I use it for frequency error estimation instead of a pll? Apr 8 '20 at 10:52
• Yes absolutely- that is what makes it an FLL (the type of discriminator). Use an FLL but also you will need an additional integrator along with the PI Loop Filter to implement a traditional 2nd order type 2 Loop since the VCO is no longer an integrator in an FLL Apr 8 '20 at 10:57
• Didn't get the last statement. I'm in need of doppler error offset, the rate actually, so I can't use the FLL Discrminator output (error) and dthat's the frequency error offset ? Why should I follow it with a PI filter ? Apr 8 '20 at 10:59
• If you have the FLL already then it’s error term in the FLL is proportional directly to frequency error so yes you can use that to measure Doppler. If you need to implement the FLL itself my comment above applies to that implementation Apr 8 '20 at 11:02
• To clarify the frequency error term will be the instantaneous frequency error for each sample but the output of the loop filter in the FLL, likely driving an NCO, will maintain the current Doppler offset. Make sense? Apr 8 '20 at 11:05