In the last post, we acquired the signals from GNSS satellites. Now we will keep tracking these signals to demodulate the navigation data continuously.

The signal transmitted by a satellite is:

\begin{aligned} s^{k}(t)=\sqrt{2 P_{C}} C^{k}(t) D^{k}(t) \cos \left(2 \pi f_{\mathrm{L} 1} t\right) &+\sqrt{2 P_{\mathrm{PL1}}} P^{k}(t) D^{k}(t) \sin \left(2 \pi f_{\mathrm{L} 1} t\right)+\sqrt{2 P_{\mathrm{PL} 2}} P^{k}(t) D^{k}(t) \sin \left(2 \pi f_{\mathrm{L} 2} t\right) \end{aligned}

C^{k}(t) is C/A code sequence,
P^{k}(t) is P(Y) code sequence,
D^{k}(t) is P(Y) navigation data sequence,
P_{C} is power.

We need to extract the data D^{k}(t) from the signal above. So downconversion, band/low pass filters, etc. are used. Basically, the diagram below is used;

The Basic Diagram of Tracking

The output from the front end including filtering and downconversion can be described as

s^{k}(t)=\sqrt{2 P_{C}} C^{k}(t) D^{k}(t) \cos \left(\omega_{\mathrm{IF}} t\right)+\sqrt{2 P_{\mathrm{PL} 1}} P^{k}(t) D^{k}(t) \sin \left(\omega_{\mathrm{IF}} t\right)

where \omega_{\mathrm{IF}} is the intermediate frequency.

Then the signal is sampled by the A/D converter. Because of the narrow bandpass filter around the C/A code, the P code is distorted. The signal from k^{th} satellite can be shown as:

s^{k}(n) \equiv C^{k}(n) D^{k}(n) \cos \left(\omega_{\mathrm{IF}} n\right) \pm e(n)

To get the D^{k}(n) from the signal above, the signal is converted to baseband by carrier removal.

\begin{aligned}s^{k}(n) \cos \left(\omega_{\mathrm{IF}} n\right) &=C^{k}(n) D^{k}(n) \cos \left(\omega_{\mathrm{IF}} n\right) \cos \left(\omega_{\mathrm{IF}} n\right) \&=-\frac{1}{2} C^{k}(n) D^{k}(n)-\frac{1}{2} \cos \left(2 \omega_{\mathrm{IF}} n\right) C^{k}(n) D^{k}(n),\end{aligned}

Now, the second term is removed by lowpass filter. The rest term is multiplication of the nav message and PRN code.

\frac{1}{2} C^{k}(n) D^{k}(n)

The next and last step is removing the PRN code from the signal.

\sum_{n=0}^{N-1} C^{k}(n) C^{k}(n) D^{k}(n)=N D^{k}(n)

The demodulation above is only for a signal with one satellite. This is done to reduce the complexity, to explain the theory and to give a simpler idea of the demodulation scheme.

Combined of PLL and DLL
The result of tracking function, SoftGNSSv3

SoftGNSSv3 that I use…