# A Two-Stage Kalman Filter-Based Carrier Tracking Loop for Weak GNSS Signals
## 4 KF-Based Two-Stage Carrier Tracking Loop
### Basic Equations of KF-Based Tracking  
A linear KF state space system model can be described as [17]:  
\[\mathbf{x}_{k+1}=\mathbf{\Phi}\mathbf{x}_{k}+\mathbf{n}_{k} \tag{9}\] \begin{table}
\begin{tabular}{l l} \hline \hline
**Type of Loop** & **Discriminator Algorithm** \\ \hline \multirow{4}{*}{Second-order FLL} & \(\frac{(cross)\cdot\mathrm{sign}(dot)}{\sqrt{dot^{2}+cross^{2}}}\) \\  & where \(cross=I_{p}(k-1)Q_{p}(k)-Q_{p}(k-1)I_{p}(k)\), \\  & \(dot=I_{p}(k-1)I_{p}(k)+Q_{p}(k-1)Q_{p}(k)\), \\  & and \(\mathrm{sign}(*)\) denotes the sign function. \\ \hline \multirow{3}{*}{Third-order PLL} & ATAN \(\left(\frac{Q_{p}(k)}{I_{p}(k)}\right)\) \\  & where ATAN\((*)\) denotes the two-quadrant \\ \cline{1-1}  & arctangent. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Discriminators that are used in the FLL-assisted-PLL carrier tracking loop. \[\mathbf{z}_{k+1}=\mathbf{H}\mathbf{x}_{k}+\mathbf{v}_{k} \tag{10}\]  
Equation (9) is the discrete state equation, where \(\mathbf{x}_{k}\) is the state vector at the \(k^{th}\) epoch, \(\mathbf{\Phi}\) is the state transition matrix, and \(\mathbf{n}_{k}\) represents the process noise matrix. Equation (10) is the discrete measurement equation, where \(\mathbf{z}_{k+1}\) is the measurement vector at the \((k+1)^{th}\) epoch, \(\mathbf{H}\) is the measurement matrix, and \(\mathbf{v}_{k}\) represents the measurement noise vector. For the third-order KF-based carrier tracking loop, \(\mathbf{x}_{k}=\left[ \begin{array}{ccc}\Delta\varphi_{k}&\omega_{k}&\alpha_ {k}\end{array} \right]^{\mathsf{T}}\) and the discrete state equation and measurement equation are expressed as:  
\[\left[ \begin{array}{c}\Delta\varphi_{k+1}\\ \omega_{k+1}\\ \alpha_{k+1}\end{array} \right]=\left[ \begin{array}{ccc}1&T&T^{2}/2\\ 0&1&T\\ 0&0&1\end{array} \right]\left[ \begin{array}{c}\Delta\varphi_{k}\\ \omega_{k}\\ \alpha_{k}\end{array} \right]+\mathbf{n}_{k} \tag{11}\]  
\[\delta\varphi_{k+1}=\left[ \begin{array}{cc}1&T/2&T^{2}/6\end{array} \right] \left[ \begin{array}{c}\Delta\varphi_{k}\\ \omega_{k}\\ \alpha_{k}\end{array} \right]+v_{k} \tag{12}\]  
where \(\Delta\varphi_{k}\) represents the carrier phase error in radians, \(\omega_{k}\) represents the carrier Doppler shift in rad/s, \(\alpha_{k}\) is the carrier Doppler rate in rad/s\({}^{2}\), and \(T\) is the updated period of the carrier tracking loop in seconds. In (12), \(\delta\varphi_{k+1}\) is the measurement vector, which is obtained via a two-quadrant arctangent discriminator. For (11), the covariance matrix, \(\mathbf{Q}\), of the system noise matrix, \(\mathbf{n}_{k}\), is [8]:  
\[ \begin{array}{ll}\mathbf{Q}&=\left(\frac{\omega_{rf}}{C}\right)^{2}q_{a} \left[\begin{array}{ccc}T^{5}/20&T^{4}/8&T^{3}/6\\ T^{4}/8&T^{3}/3&T^{2}/2\\ T^{3}/6&T^{2}/2&T\end{array}\right]\\ &+\omega_{rf}{}^{2}q_{d}\left[\begin{array}{ccc}T^{3}/3&T^{2}/2&0\\ T^{2}/2&T&0\\ 0&0&0\end{array}\right]+\omega_{rf}{}^{2}q_{b}\left[\begin{array}{ccc}T&0&0 \\ 0&0&0\\ 0&0&0\end{array}\right]\end{array}  \tag{13}\]  
where \(\omega_{rf}\) denotes the nominal carrier frequency in rad/s, \(q_{a}\) represents the power spectral density of the random walk process in units of \(\left(\mathrm{m}^{2}/\mathrm{s}^{6}\right)/\mathrm{Hz}\), \(C\) denotes the velocity of light, and \(q_{d}\) and \(q_{b}\) represent the power spectral density of the carrier frequency noise and carrier phase noise, respectively. \(q_{a}\) is determined by the line-of-sight (LOS) jerk. If the relative motion between the satellite and the receiver is static, \(q_{a}=0\left(\mathrm{m}^{2}/\mathrm{s}^{6}\right)/\mathrm{Hz}\). \(q_{d}\) and \(q_{b}\) are caused by local oscillator noise. If the receiver oscillator parameters are known, the values of \(q_{d}\) and \(q_{b}\) can be calculated by [18]:  
\[q_{d}=2\pi^{2}h_{-2} \tag{14}\]  
\[q_{b}=\frac{h_{0}}{2} \tag{15}\]  
where \(h_{0}\) and \(h_{-2}\) are the receiver oscillator \(h\)-parameters. The values of the \(h\)-parameters are determined by the type of oscillator. Typical values for commonly used oscillators can be found in [18].