# GNSS Code Multipath Mitigation by Cascading Measurement Monitoring Techniques
## 4 Detection, Exclusion and De-Weighting Strategies
### Detection Strategy  
The detection process can be considered as a maximization of a likelihood ratio by setting an appropriate detection threshold for each PRN. To determine the threshold, the nominal multipath-free characteristics of the detection metrics must be investigated first and an appropriate probability of false alarm must be selected [20; 21; 31]. Since either calibration, pre-defined models or reference receivers cannot be used to remove the mean value of the CMC metric (see Section 3.1), a moving average is applied. The performance will be limited by two factors. First, as the code-multipath error is not zero-mean [32], low-frequency biases caused by multipath will be filtered out, which is not desirable for the multipath detection purpose. Second, the performance of time averaging will be limited by the sliding window length. The larger length provides larger sample-space and thus results in more precise estimation of the mean value at the expense of a delayed response to multipath transition states, geometry changes and other signal degradations such as signal attenuation and blockage. To balance these two limitations, the moving average window is set to at least one multipath period, which in static cases may reach several minutes. The nominal Standard Deviation (SD) of the monitoring metrics in the absence of multipath was determined using reference data collected in a low multipath environment.  
The detection procedure is then defined based on a fixed interval detector called the _M of N_ detection strategy. The _M of N_ detector is a fixed-lag sliding window which takes a window of N samples (based on current and \(N-1\) preceding samples) and compares them to a predefined threshold. If \(M\) or more samples exceed the threshold, then the detection output will be 1 and otherwise 0. Thisprocedure is then repeated for the next window in the search pattern. With this detection strategy, the overall probability of false alarm in \(N\) trials is given by [1]  
\[P_{FA}=\sum\limits_{n=M}^{N}\left(\begin{array}{c}N\\ n\end{array}\right)P_{fa}^{n}\Big{(}1-P_{fa}\Big{)}^{N-n}=1-\sum\limits_{n=0}^{M -1}\left(\begin{array}{c}N\\ n\end{array}\right)P_{fa}^{n}\Big{(}1-P_{fa}\Big{)}^{N-n}, \tag{14}\]  
where \(\left(\begin{array}{c}N\\ n\end{array}\right)\) is the number of combinations of N items taken n at a time. \(P_{fa}\) is the false alarm probability in each trial and equals 0.27% under a normal distribution assumption and a \(\pm\)3 SD detection threshold. In the case of \((N,\,M)=(1,\,1)\), the detection strategy is considered as a general likelihood ratio test by comparing each sample with the detection threshold at each epoch. A proper selection of \(N\) and \(M\) can decrease the false alarm probability while imposing latency in the transition from the null (when there is no or low multipath) to the alternate (when multipath occurs) hypothesis and vice versa [1,33]. Given the periodic nature of GNSS multipath (or even when multipath behaves more like noise in high dynamic scenarios), a side effect of the latency will be a reduction in the rate of change between the two detection states. In the case of exclusion, the lower rate of change has the benefit of smoothing the position results. In Section 6, this strategy will be applied to samples of the monitoring metrics to detect the effect of multipath. For each scenario, the appropriate parameters will be set based on the desired false alarm probability and multipath conditions.