# A Carrier Estimation Method Based on MLE and KF for Weak GNSS Signals
## 4 Adaptive Kalman Filter  
### Basic Equations of KF  
After frequency and phase residual estimation by the MLE discriminator, a KF can be used to get fair estimates. KF is an optimal estimator by using the state space concept and system error model. The detailed process of KF has been documented clearly in [17]. Here, only the state transition equation and observation equation of KF is given. The state vector is defined as \(x_{k}=\left[ \begin{array}{cc}\varphi_{k}&w_{k}&\dot{w}_{k}\end{array}  \right]^{T}\). \(k\) is the index of the update period of the filter. \(w_{k}=2\pi f_{k}\) is the angular frequency and \(\dot{w}_{k}\) is the angular frequency rate. Authors of [18] have derived a state transition function whose state vector includes the code phase. Because the code tracking loop is not considered in this paper, the state transition function of the proposed KF is reproduced from [18] and modified by ignoring the code phase term. Its discrete form is expressed as:  
\[x_{k+1}=\left[ \begin{array}{ccc}1&\Delta t&\frac{\Delta t^{2}}{2}\\ 0&1&\Delta t\\ 0&0&1\end{array} \right]x_{k}+\left[ \begin{array}{ccc}w_{rf}&0&0\\ 0&w_{rf}&0\\ 0&0&\frac{w_{rf}}{c}\end{array} \right]\left[ \begin{array}{c}w_{b}\\ w_{d}\\ w_{a}\end{array} \right] \tag{23}\]  
where \(\Delta t=NT\) is the update interval of KF which is equal to the discriminator update time. The second term on the right side is the process noise term and has a covariance matrix \(Q\). \(w_{rf}\) is the angular frequency of the RF signal. \(w_{b}\) and \(w_{d}\) is the carrier phase noise and carrier frequency noise due to the local oscillator, respectively. \(w_{a}\) is the carrier frequency rate noise. \(Q\) is given by (24). \[ \begin{array}{ll}Q&=F\cdot E[W_{rf}\cdot W_{rf}{}^{T}]\cdot F^{T}\\ &=\left(\frac{w_{rf}}{c}\right)^{2}q_{a}\left[\begin{array}{ccc}\frac{ \Delta t^{3}}{20}&\frac{\Delta t^{4}}{8}&\frac{\Delta t^{3}}{6}\\ \frac{\Delta t^{3}}{6}&\frac{\Delta t^{3}}{2}&\frac{\Delta t^{2}}{2}\\ \frac{\Delta t^{3}}{6}&\frac{\Delta t^{2}}{2}&\Delta t\end{array}\right]+w_{ rf}{}^{2}q_{d}\left[\begin{array}{ccc}\frac{\Delta t^{3}}{3}&\frac{\Delta t^{2}}{2}&0\\ \frac{\Delta t^{2}}{2}&\Delta t&0\\ 0&0&\Delta t\end{array}\right]+w_{rf}{}^{2}q_{b}\left[\begin{array}{ccc} \Delta t&0&0\\ 0&0&0\\ 0&0&0\end{array}\right]\end{array}  \tag{24}\]  
where \(F\) and \(W_{rf}\) are the state transition matrix and observation noise matrix in (23) respectively, and \(q_{b}\), \(q_{d}\) and \(q_{a}\) are the power spectral density of \(w_{b}\), \(w_{d}\) and \(w_{a}\), respectively. Given h-parameters of the local oscillator, \(q_{b}\) and \(q_{d}\) can be calculated by:  
\[\left\{ \begin{array}{ll}q_{b}=\frac{h_{0}}{2}\\ q_{d}=2\pi^{2}h_{-2}\end{array} \right. \tag{25}\]  
where \(h_{0}\), \(h_{-2}\) is the h-parameters of oscillator. For a voltage-controlled temperature-compensated oscillator (VCTCXO), \(h_{0}=1\times 10^{-21}\) and \(h_{-2}=1\times 10^{-20}\) is given in [18]. The MLE discriminator can output frequency and phase estimates. Choosing them as observations, the observation equation is written as,  
\[\left[ \begin{array}{c}\dot{\phi}\\ \dot{f}\end{array} \right]=\left[ \begin{array}{ccc}1&0&0\\ 0&1&0\end{array} \right]x_{k}+v_{k} \tag{26}\]  
where \(v_{k}\) is the observation noise which has the covariance matrix \(R_{k}\). It is obvious that \(R_{k}\) is the variance matrix of phase and frequency estimation errors. It can be derived as the inverse matrix of FIM [13]. \[ \begin{array}{rl}R_{k}=J^{-1}(\theta)=&\frac{\sigma^{2}}{A^{2}}\frac{3}{2 \pi^{2}T^{2}(N-1)N(2N-1)-3\pi^{2}T^{2}(N-1)^{2}N}*\\ &\left[\begin{array}{cc}2\pi^{2}T^{2}(N-1)(2N-1)/3&-\pi T(N-1)\\ -\pi T(N-1)&1\end{array}\right]\end{array}  \tag{27}\]  
In (27), the term on the right side can be considered as \(\sigma^{2}/A^{2}\) multiplied by a constant matrix when \(T\) and \(N\) is fixed. \(A\) can be estimated by (8).