# An NLOS Ranging Error Mitigation Method for 5G Positioning in Indoor Environments
## 3 The Proposed NLOS Mitigation and SRUKF-Based Location Estimation Method for 5G Positioning
### 5G NLOS Measurement Identification and Classification Method  
When the available LOS signals are not sufficient to support localization, it becomes necessary to design a criterion for filtering ranging results to ensure that only beneficial NLOS signals are included in the positioning computation. The NLOS error at the 5G positioning terminal can be represented as  
\[\text{Error}_{NLOS}=\frac{10\big{(}\sqrt{\vartheta_{\text{nlos}}}-1\big{)}}{ e_{\text{nlos}}}\log_{10}\bigg{(}\frac{\max_{1<i<L}\big{(}a_{i}^{2}\tau_{i}^{n} \big{)}}{a_{DP}^{2}\tau_{DP}^{n}}\bigg{)} \tag{23}\]  
where \(\vartheta_{\text{nlos}}\) represents the dielectric constant associated with obstacles in the propagation channel, and \(e_{\text{nlos}}\) represents the attenuation constant associated with obstructing objects in the channel. L represents the number of paths for a multipath implementation; \(a_{i}\) and \(\tau_{i}\), respectively, represent the amplitude and delay; and the subscript DP stands for the direct path signal. It can be seen that the errors introduced by NLOS effects are closely related to the channel conditions. The key to selecting NLOS observations lies in extracting typical classification features from the waveform of the received signal. The extracted features must be strongly correlated with changes in the NLOS channel state. To ensure the ease of implementation of the proposed method, we selected six common features as well as estimations from the 5G signal: Total Energy (TE), Maximum Peak Value (MPV), signal-to-noise ratio (SNR), Rise Time (RT), root mean square delay spread (RDS), and kurtosis (KUR). Their definitions are shown in Equations (24)-(29), respectively:  
\[\zeta=\sum_{i=1}^{N}\lvert r(t_{i})\rvert^{2} \tag{24}\]  
\[A_{\text{max}}=\text{max}\{\lvert r(t_{i})\rvert\} \tag{25}\]  
\[\kappa_{\text{snr}}=10\log_{10}\bigg{(}\frac{A_{\text{max}}^{2}}{2\sigma_{n}^{ 2}}\bigg{)} \tag{26}\]  
\[\tau_{\text{rise}}=\tau_{\text{stop}}-\tau_{\text{start}}\]  
\[\bigg{\{} \begin{array}{l}\tau_{\text{start}}=\text{min}\{t_{i}:\lvert r(t_{ i})\rvert\geq 0.1A_{\text{max}}\,\}\\ \tau_{\text{stop}}=\text{min}\{t_{i}:\lvert r(t_{i})\rvert\geq 0.9A_{\text{max}}\,\} \end{array}  \tag{27}\]  
\[\lambda=\frac{1}{N\sigma_{n}^{4}}\sum_{i=1}^{N}\left(\lvert r(t_{i})\rvert- \mu_{r}\right)^{4} \tag{28}\]\[\tau_{rms}=\frac{1}{\xi}\sum_{i=1}^{N}\left[\left(t_{i}-\frac{1}{\xi}\sum_{i=1}^{N} \left(t_{i}|r(t_{i})|^{2}\right)\right)^{2}|r(t_{i})|^{2}\right] \tag{29}\]  
where \(N\) is the total number of sampling points of the signal waveform received by the terminal, and i represents the sampling point index. \(\mu_{r}=\frac{1}{N}\sum_{i=1}^{N}|r(t_{i})|\), and \(\sigma_{r}^{2}=\frac{1}{N}\sum_{i=1}^{N}(|r(t_{i})|-\mu_{r})^{2}\). When a wireless signal encounters obstacles, its total signal energy will inevitably experience significant attenuation. Additionally, LOS channels obstructed by obstacles can lead to significant fluctuations in RT, RDS, and KUR values. Moreover, areas with severe multipath effects often accompany severe NLOS errors, causing RDS to increase with the increase in multipath classification. Finally, KUR can also serve as an important indicator for assisting in judging the quality of NLOS observations. KUR values decrease significantly with the increase in the severity of multipath interference. The fuzzy Comprehensive Evaluation was adopted to classify channel states. Let \(\hat{F}=\{f_{x}\}_{x=1}^{a}\) represent the feature set extracted from the signal waveform, and the corresponding distance estimation result be \(\hat{d}\), where \(\alpha\) denotes the total number of classification features. The specific method for classifying NLOS channels is as follows. Find the data closest to the real-time measurements in the local sampled dataset. Let the local dataset under channel \(p\) be denoted as \(D.\hat{F}\) and D can be considered, respectively, the factor domain and evaluation domain.