# Practical Use of Starlink Downlink Tones for Positioning
## 2 Signal Detection and Tracking
### Tones Detection and Tracking  
In this section, we track the tones to measure their frequency shifts, which can then be used for positioning. We assume that the incoming signal is formed by perfect tones (i.e., un-modulated carriers). Figure 3 presents the principle of detection and tracking of the phase and frequency of the tones. We perform the detection by identifying the spectrum magnitude components that exceed a given threshold, i.e.,\(\left|X_{f}(f)\right|>Xo\), where \(\left|X_{f}(f)\right|=\sqrt{Re\Big{(}X_{f}\Big{)}^{2}+Im\Big{(}X_{f}\Big{)}^{2}}\) is the magnitude of the normalized Fourier transform of the received signal and \(Xo\) is a threshold. With the assumption that only tones occupy the sampled frequency band, when they are absent, the signal distribution is Gaussian and so do its FFT real and imaginary components. As a result, the spectrum magnitude follows a Rayleigh distribution, and the threshold can be designed according to \(Xo=F_{R}^{-1}(1-PFA,\sigma)\), where \(F_{R}\) is the cumulative density function of the Rayleigh distribution with parameter \(\sigma=E\Big{(}\left|X_{f}(f)\right|\Big{)}/\sqrt{\pi/2}\), with \(E(. )\) being the expectation operation, and PFA as a probability of false alarm. The expected weak signal level suggests that computing the FFT over a long burst would reduce the noise, however the FFT length is limited by the high-frequency shift rate. This is because over a long time interval, the tone frequency scrolls through several FFT frequency bins, and thus the signal energy is spread over many bins. In addition, long FFTs consume a lot of resources in a practical implementation. In order to select an adequate size of FFT, we computed numerical simulations of the ratio between the tone spectrum peak and the detection threshold as a function of the duration of the FFT burst, T, and for different C/No levels (Figure 4). We can verify that at the beginning, the ratio increases with T, reaches a maximum, and then decreases. The tone spectrum peak is below the detection threshold (i.e.,  
Figure 2: FFT magnitude centered at 11,325 MHz. The arrows of the same color indicate the tones transmitted by the same satellite. Four satellites are captured in total, with a number of tones varying from 1 to 6.  
ratio < 1) for C/No = 28 dB-Hz whatever the duration of the burst is, while for C/No higher than 30 dB-Hz, the detection becomes possible for a range of T values. For 30 dB-Hz, suitable values of T are between \(\sim\)14 and 26 ms. Therefore, 14 ms is an acceptable compromise for the FFT burst duration. It should be noted that the interval of T for which the detection is possible becomes wider when the C/No increases, and in particular, the detection is possible using small values of T (down to \(\sim\)4 ms for C/No = 36 dB-Hz). For each detected tone that is not being tracked, the signal is demodulated by the detected frequency and then supplied to the frequency and phase tracking module. The tracking process implements a third-order phase-locked loop (PLL) assisted by a second-order frequency-locked loop (FLL) [31]. For convenience, we refer to the PLL and FLL combination as FPLL, whose principle is as follows: An NCO (numerically controlled oscillator) generates a complex local carrier over duration T that is multiplied by a burst of the incoming signal of the same duration. The results on the real and imaginary arms are then filtered by a low-pass filter (LPF) (a summation over T, called integration time) to obtain a complex signal (\(I_{n}+jQ_{n}\)), whose phase is the difference between the phase of the local carrier and the incoming tone. The resulting signal is used by a phase discriminator \(\phi_{e}=(2\pi)^{-1}\)atan2(\(Q_{n},I_{n}\)) and by a frequency discriminator \(f_{e}=(2\pi T)^{-1}\)atan2(\(Q_{n}I_{n-1}-Q_{n-1}I_{n},I_{n}I_{n-1}+Q_{n}Q_{n-1})\) to derive the phase error \(\phi_{e}\) and the frequency error \(f_{e}\), respectively, between the incoming carrier and the local carrier.