## 6 Sqi  
The output provided by the detector is a hard detection (Yes/No) about the presence of correlation anomalies. However it could be interesting to introduce a sort of soft decision to better assist the RAIM.  
The idea has been to continuously monitor the quality of the received signal during the computation of navigation solution. To achieve this goal we introduced an index \(\text{SQI}(t_{n})\) that describes the quality of the navigation solution, where \(t_{n}\) are the time instants of the PVT computation.  
This quality index takes into consideration the MPDD output and other information data such as the \(C/N_{0}\) and the distance between the weight vector \(\hat{\mathbf{w}}\) and the theoretical LOS vector \(w_{LOS}\). It is defined as  
\[\text{SQI}(t_{n})=\frac{1}{\lambda}\sum_{k=1}^{N}m(t_{n-1}+kT_{a})s(t_{n-1}+kT _{a})d(t_{n-1}+kT_{a})f\left[\frac{C}{N_{0}}(t_{n-1}+kT_{a})\right]\]  
where:  
* \(T_{a}\) is the duration of the moving average time window.
* \(N\) is the number of the moving average time windows between two time instants (\(t_{n}\) and \(t_{n-1}\)). For example, between two PVT computations with a rate of \(1\) Hz and a moving average of \(T_{a}=100\) ms, \(N=10\).
* \(m(\cdot)\) represents the MPDD output, \[m(kT_{a})=\begin{cases}-1,&\text{if }E_{min}=\min E_{p}=E_{LOS},\text{ }p=1,2,...N_{V}\\ 1,&\text{if }E_{min}=\min E_{p}\
eq E_{LOS},\text{ }p=1,2,...N_{V}\end{cases}\] meaning that \(-1\) indicates a correlation function with at most noise presence, instead \(1\) the presence of distortions.
* The function \(s(\cdot)\) takes into account the temporal distance between the occurrence of the distorting event and the epoch when the PVT is computed. In fact the PVT module of any GNSS receiver uses the estimated PRs at some given epochs, and, as explained in Section 3.3, correlation distortion between two epochs could have an impact on the PR estimation. The meaning of the function \(s(\cdot)\) is to give a different importance to the MPDD output measurements depending on how far they are from the next PR computation. \(s(\cdot)\) is a Gaussian function normalised and shifted by \(1\) in order to have a range of the values from \(1\) to \(2\). The shape of \(s(\cdot)\) is shown in Figure 8.
* The function \(d(\cdot)\) measures the ratio \(E_{min}/E_{LOS}\), and it is defined as \[d(kT_{a})=\begin{cases}E_{min}/E_{LOS},&\text{if }E_{min}\
eq E_{LOS}\\ 1,&\text{if }E_{min}=E_{LOS}\end{cases}\]\(d(\cdot)\) is a ratio between distances, so it gives a relative measure of how far is \(\hat{\mathbf{w}}\) with respect to the LOS.
* \(f(\cdot)\) takes into account the \(C/N_{0}\) value, and is defined as: \[f\left[\frac{C}{N_{0}}(kT_{a})\right]=\frac{1+\frac{2}{\pi}\arctan\left[\frac{C }{N_{0}}(kT_{a})-a\right]}{2}\] The \(C/N_{0}\) gives a measure of the reliability of the output of the MPDD. As a matter of fact, if \(C/N_{0}\) is high, it means that the decision about the presence of distortions is more reliable than with a \(C/N_{0}\) closer to \(a\). The variable \(a\) is the minimum operative \(C/N_{0}\) considered by the algorithm. We chose an arcotangent function as shown in Figure 9 to take into account a saturation mechanism in case of very high or very low \(C/N_{0}\).  
Figure 8: Trend of \(s(t)\) within two instants of the PVT computation.  
Figure 9: Example of trend of \(f\) function with \(a=42\) dBHz.  
It is important to choose a \(C/N_{0}\) estimator that suits our problem. In [25] a comparison between five well-known methods to estimate the \(C/N_{0}\) is made. We chose to use an estimator with low computational complexity, the _Signal-to-Noise Variance_ (SNV), that is based on the first absolute moment and the second moment of the signal samples [25].
* \(\lambda\) is a normalization factor to obtain \(\text{SQI}(t_{n})\in(0,1]\). The parameter \(\lambda\) is set as the sum of the maximum values that can be obtained at each discrete time \(k\) for the functions \(m(\cdot)\), \(s(\cdot)\), \(d(\cdot)\) and \(f(\cdot)\).