 Research
 Open Access
 Published:
A positioning algorithm based on improved robust extended Kalman filter with NLOS identification and mitigation
EURASIP Journal on Wireless Communications and Networking volumeÂ 2023, ArticleÂ number:Â 60 (2023)
Abstract
With the development of the information age and the maturity of Internet of Things technology, wireless sensor network has been widely applied in indoor localization. However, the nonlineofsight (NLOS) propagation in complicated environment and the inherent noise of the sensor will introduce errors in the measurements, which will seriously lead to inaccurate positioning. In this paper, a novel localization scheme based on the mean reconstruction method is proposed, which reconstructs the distance measurements from all beacon nodes by taking the average twice to weaken the adverse effects of NLOS. At the same time, the noise average is reestimated when the distance difference is not too large. Next, the robust extended Kalman filter (REKF) is used to process the reconstructed distance measurements to obtain positioning results. To make the positioning results more accurate, hypothesis test is used as NLOS identification to classify the position estimates generated from all distance combinations by leastsquares. Then, the residual weighting (RWGH) method is utilized to combine the position estimates that fall into the validation region. At last, we merge the results from RWGH and REKF. The simulation and experimental results show that the proposed algorithm has high positioning accuracy and strong positioning robustness.
1 Introduction
A certain number of lowenergy sensors are deployed in a specific range indoors or outdoors, thus forming a wireless sensor network (WSN). Using communication technology to receive relevant information about the target, such as time of arrival (TOA), time difference of arrival (TDOA), angle of arrival (AOA) and received signal strength (RSS). The researchers have extended wireless positioning technology, which has good effects on science, military and social life [1]. In WSN, the prefixed sensors are called beacon nodes (BNs), while the state of the object to be located is indeterminate, usually in motion, so we call it mobile node (MN). According to whether there are obstacles between the BN and the MN, the channel can be divided into two types: lineofsight (LOS) and nonlineofsight (NLOS) propagation. In the real world, obstacles such as humans, tables, cars, and plants will cause diffraction and refraction of the electric signal during the NLOS transmission process and produce the signal time delay, which make the measurements become larger than actual values [2]. Thus eventually lead to the deviation between the positioning trajectory and the actual mobile trajectory [3]. The errors of contaminated measurements in NLOS transmission are mainly NLOS errors, which make the measurements have positive errors that canâ€™t be ignored. The NLOS errors are adverse to the positioning accuracy, so it is especially crucial to alleviate and eliminate the NLOS errors.
Nowadays, several NLOS processing algorithms have been proposed. Some algorithms directly process all original measurement data [4,5,6,7,8,9]; while others identify the measurement data and divide them into several categories [10,11,12,13,14,15,16], even discarding the measurement values with larger errors and only utilizing the measurement values with smaller errors into subsequent steps. Therefore, we can divide these algorithms into NLOS mitigation and NLOS identification.
In this paper, we propose a positioning algorithm based on mean reconstruction REKF by using the TOA measurements, which combines NLOS mitigation and NLOS identification. The proposed algorithm has made some improvements in positioning performance and algorithm applicability. The main contributions in the proposed algorithm as follows:

1.
The proposed algorithm is based on REKF, which integrates robust regression into EKF and can be applied to nonlinear systems. Unlike the IMM framework, the REKF has a significant advantage that does not depend on the prior knowledge of the NLOS errors, so REKF is more in line with the actual circumstances.

2.
In the worst case, our algorithm time complexity is \((r + K) \cdot O(n)\), where r is the number of Newtonâ€“Raphson iterations and K is the total number of distance combinations.

3.
The proposed algorithm has a significant advantage in localization performance with high accuracy and strong robustness. In addition, the proposed algorithm is suitable for different NLOS error distributions and independent of BNs distribution. Particularly, the proposed algorithm works better for the environments with lots of NLOS errors.
The subsequent structure of the paper is arranged as follows: Sect.Â 2 introduces related works. SectionsÂ 3 and 4 describe the signal model and the proposed algorithm in detail respectively. We conducted simulations and experiments, and analyzed the results in Sect.Â 5. The conclusion is drawn in Sect.Â 6.
2 Related works
2.1 NLOS mitigation
There are two strategies for NLOS mitigation: the first one is only to remedy range errors. The residual weighting (RWGH) method is to take the reciprocal of the distance difference as the residual, which removes the effect of outliers by giving less weight to points farther away from the measurements [4]. However, the complexity of the method needs to be reduced, some researchers were committed to improving the residual weighting algorithm. For instance, by reserving the combinations with the smallest residuals and performing summation, the RWGH method becomes computationally simple [5]. The iterative minimum residual algorithm is proposed in [6], which sets a minimum residual threshold, and iteratively retains position estimates with residuals less than this threshold as final results. In TDOA positioning, solving optimization problems by convex relaxation is also a hot topic for NLOS mitigation. Through l(1)norm robustification and neurodynamic optimization in NLOS, the convex optimization problems with inequality constraints are solved by redefining Augmented Lagrangian effectively [7].
The second strategy is to directly suppress the NLOS impact by using dedicated localization techniques. The authors in [8] proposes a NLOS nodes localization scheme based on Harris Hawke optimization algorithm to promote reliable data propagation between vehicle nodes in emergency situations. It can locate NLOS nodes based on their dynamic characteristics and adaptive positioning styles obtained through reference nodes. A novel selflearning LS positioning algorithm has been proposed in [9], which can not only solve the distortion problem of LS in NLOS environment, but also not be limited to the condition that LS requires at least three nodes in localization problems.
2.2 NLOS identification
The NLOS identification part is generally conducted before NLOS mitigation, which can recognize whether the propagation state between nodes is LOS or NLOS, after identification different error elimination technologies are used for different conditions. The NLOS identification methods include range, channel and location aspects. The identification method based on channel is challenging, and the method based on distance can be measured by UWB, which is relatively easy to obtain, and the position can also be calculated using distance. The method based on distance mainly use the probability density function (PDF) or variance of range estimates to distinguish between LOS and NLOS [10]. In location identification, probability theory [11] or machine learning [12] can be used to determine whether the position estimate is generated by NLOS measurements.
There exist some methods to identify whether the state is in LOS or NLOS. The Wylie method mainly calculates the measurement variance and judges whether the distance measurements are contaminated by NLOS errors [13]. The decision theory and ztest are used for identifying NLOS propagation [14], and then the NLOS measurement data are discarded. Even if the prior information of NLOS error is unknown, the algorithm is still effective. These identification methods are based on range. The modified probabilistic data association (MPDA) algorithm obtains a position estimate through different combinations of ranging by LS [15]. The NLOS detection is to identify the optimized position estimate which falls into the validation gate. Then the optimized position estimates are reserved and used to calculate the position of the MN by the corresponding association probability weighting. The method is based on location. A practical NLOS identification (PNI) technique based on support vector machine (SVM) is designed in [16], which can reduce the effects of transmission channeldependent characteristics and optimize the classifier, so itâ€™s based on channel. Our algorithm improves the hypothesis test in the MPDA to determine whether the position estimate is from LOS or NLOS.
2.3 NLOS identification and NLOS mitigation
Some positioning algorithms are divided into two steps: first identifying the NLOS error and then eliminating it. All of them play a certain role in improving the positioning accuracy. The Wylie method uses the time history of distance measurements from each BN, combined with the method of measuring noise standard deviation and residual analysis rank test, to determine whether there exists NLOS error in the distance measurements [13]. The second step is to eliminate the NLOS errors to achieve true TOA reconstruction by using the time history of TOA measurements. A distance measurement reconstruction mode was proposed in [17]. After identifying the NLOS error, Liu uses an orthogonal polynomial to optimize the distance measurements obtained by the biased Kalman filter (KF). In [18], an Bayesian sequential test is designed to identify whether the distance measurements are contaminated by NLOS errors. After identification, the original distance measurements, which are contaminated by NLOS errors, are optimized by a modified Kalman filter (MKF). In [19], according to the number of position estimates that fall into the validation gate, the environment at this moment is divided into mild NLOS and severe NLOS condition; then the average value of NLOS error is estimated by using the historical positioning results, and the distance measurements from each beacon node are reconstructed. Our algorithm reconstructs the distance measurements to reduce the NLOS errors and determines whether the position estimate is from LOS or NLOS, and finally combines the results.
3 Signal model
\({\varvec{X}}(n) = [x(n) \, y{(}n{) }\hat{x}(n) \, \hat{y}{(}n{)}]^{T}\) is the state vector of the MN, where n is the time step and N is the whole time steps. \((x(n),y(n))\) is the coordinate of the MN and \((\hat{x}(n) \, \hat{y}{(}n{))}\) denotes the velocity of the MN. According to the force model, the state vector of the MN changes over time, which can be described as:
where, \(\Delta t\) is the sampling period. \({\varvec{u}}(n)\) is the driving noise, which is assumed to be a Gaussian white noise with a mean of zero and covariance matrix of \({\varvec{Q}}(n)\). F is the state transition matrix of the MN, and G is the interference input matrix which is used to described the random acceleration of the MN causes by \({\varvec{u}}(n)\). Within the specific area, L beacon nodes are randomly deployed to receive the signal from the MN. \({\varvec{D}}(n)\) is the distance measurements based on TOA data between the BNs and MN at time step n, which can be defined as and calculated by follows:
where, \({\varvec{h}}({\varvec{X}}(n)) = \left[ {h_{1} (x(n)),h_{2} (x(n)),...,h_{L} (x(n))} \right]^{T}\) represents the actual distances between the BNs and the MN at time step n and \({\varvec{b}}(n) = \left[ {b_{1} (n),b_{2} (n),...,b_{l} (n),...,b_{L} (n)} \right]^{T}\) is the noise vector. The actual distances \({\varvec{h}}({\varvec{X}}(n))\) are measured by Euclidean distance and \(h_{l} ({\varvec{X}}(n))\) is the lth component of \({\varvec{h}}({\varvec{X}}(n))\).
where, \((x_{B} (l),y_{B} (l))^{T}\) denotes the coordinate of the lth BN.
The noise vector \({\varvec{b}}(n)\) consists of sensor noise and NLOS error, and the sensor noise is also called LOS error. \({\varvec{b}}(n)\) contains random variables with a variance describing Gaussian noise due to the NLOS propagation, and it can be defined as:
where, \({\varvec{w}}(n)\) is Gaussian noise \(N(0,1^{2} )\). \(b_{NLOS}\) denotes the NLOS error, which changes with the environment and could follow different distribution. \(\sigma_{LOS}\) and \(\sigma_{NLOS}\) are the standard deviation of the sensor noise and the NLOS error respectively. The measurement covariance matrix is:
where \(\sigma_{L}^{2}\) represents the variance of the noise.
In this paper, we assume that the standard deviation of the sensor noise \(\sigma_{LOS}\) is known beforehand, while \(\sigma_{NLOS}\) is unknown for us.
4 The proposed algorithm program
4.1 General concept
The flowchart of the proposed algorithm is illustrated in Fig.Â 1. First, we obtain a predicted position through Kalman prediction with real initial position information. Then we calculate the distances from the predicted position to all beacon nodes and make difference with the original distance measurements. In the first averaging, the distance differences from all beacon nodes are averaged, and the second averaging is the historical time average. The average value of the two times is used as the estimation of noise average, and then the mean reconstruction is performed: we subtract the estimation of noise average from the original distance measurements, and the results are approximated as the distances from all beacon nodes to the mobile node, thereby reducing the error caused by the noisy environment. However, reconstruction may produce a negative error when the noise is small, so we reestimate the noise. After that, the robust regression technology is introduced to improve the EKF, which does not need to assume the prior knowledge about the NLOS errors. To further enhance the positioning accuracy, we divide the distance measurements into multiple groups, and each group produces a position estimate by leastsquares. Then by processing these position estimates with EKF, the filtered position estimates can be obtained. LOS identification is to recognize whether the position estimate is in LOS through hypothesis testing. The position estimates whose test statistic is not greater than the validation threshold can fall into the validation region and are selected for residual weighting, and the other position estimates are discarded. Lastly, the result of REKF and the result of residual weighting are merged as the positioning result, which will be input into the next moment positioning.
4.2 Mean reconstruction method
In indoor localization, the sensors return observation value \({\varvec{D}}(n)\), which consisted of the actual distances and the noise \({\varvec{b}}(n)\) [20]. \({\varvec{b}}(n)\) is mixed with the LOS error and the NLOS error. The LOS error is generally smaller than NLOS error. So we can use the noise estimation to estimate NLOS error. The NLOS error has a certain rule and follows a specific distribution, which has different values with different probabilities. We take the method of averaging multiple distance measurements differences, the random NLOS errors tend to offset each other in the linear dynamic system in the process of averaging [21].
Assuming that the initial state information is known and the movement is entered from the door of the room, the position of the door can be used as the initial position. Based on this accurate data, the Kalman prediction position at the first moment is close to the real position. We calculate the distances from the predicted position to all beacon nodes, and the differences can be considered as the noise. The average of the differences from all beacon node can be approximated as the mean value of noise. On the basis of the above operations, the Kalman filter values of the subsequent time steps are also relatively accurate. Therefore, we can estimate the noise and average the differences in subsequent time steps.
4.2.1 Kalman prediction
The state vector \({\varvec{X}}(00)\) and covariance matrix \({\varvec{P}}(00)\) are initialized. The state vector and covariance matrix of current time step n can be predicted by the state and the covariance matrix at previous time step nâ€‰âˆ’â€‰1:
\(D_{e,l} (n)\) is the distance between the predicted position and the lth BN. We subtract \(D_{e,l} (n)\) from the distance measurements \(d_{l} (n)\) to get \(d_{e,l} (n)\), \(d_{e,l} (n)\) is the noise estimate of the lth BN.
where, B is \(\left[ \begin{gathered} 1{ 0 0 0} \hfill \\ 0 \, 1 \, 0 \, 0 \hfill \\ \end{gathered} \right]\), and \(\left\ \bullet \right\_{n}\) denotes nnorm.
4.2.2 First average
To overcome the randomness of the noise, \(d_{e,l} (n)\) from the L BNs are averaged to obtain \(M(n)\), which can be approximately considered of the noise at time step n.
4.2.3 Second average
It is assumed that the NLOS errors follow the same distribution in a separate indoor environment with a small range and similar obstacles. So we perform the second average, historical data from initial time step to current time step n are averaged as the estimation of noise average:
With the process of sampling, the average value can represent the digital characteristics of the noise in this environment.
4.2.4 Mean reconstruction
We mainly let the distance measurements directly subtract the noise average estimation. The noise is mixed with the sensor noise and the NLOS error, and the NLOS error is generally larger than sensor noise. Noise average estimation is mainly determined by the large NLOS error, therefore the distance measurement in NLOS minus the estimated mean value \(m(n)\) will be closer to the actual distance. To mitigate the influence of NLOS error, we reconstruct the distance measurements by subtracting the recorded mean value:
However, the distance measurement in LOS with a little noise error, subtracting the estimated mean value \(m(n)\), may bring about a negative error. If the following conditions are met, it can be roughly considered as a little noise error.
For this case, similar to formula (12) and (13), reestimate the noise to reduce the influence of negative error and make the reconstructed distances close to the actual distances:
where, T is the number that \(d_{e,l} (n)\) is judged to be a little error. For little noise error, we reconstruct the distance measurements by subtracting the reestimated value of the noise:
4.3 REKF algorithm
4.3.1 Deformation of the EKF formula
In the EKF, the Jacobian matrix \({\varvec{H}}(n)\), the innovation \({\varvec{v}}(n)\), the innovation covariance matrix \({\varvec{S}}(n)\) and the extended Kalman gain \({\varvec{K}}(n)\) at time step n can be calculated as follows:
where \({\varvec{D}}(n)\) is the reconstructed distance measurements. The update of the state and covariance matrix are:
In the next steps, we replace \({\varvec{X}}(n)\) with \({\varvec{X}}\). The EKF equation is rewritten and transformed into linear regression model by applying the robust technology. The state Eq.Â (1) and the measurement (4) are rewritten as follows:
where, \(E\left( \cdot \right)\) represents the expectation and \({\varvec{C}}(n)\) is obtained by using Cholesky decomposition for \(E\left( {{\varvec{e}}(n){\varvec{e}}^{T} (n)} \right)\). The linear regression model is constructed by multiplying (26) with \({\varvec{C}}^{  1} (n)\):
4.3.2 Robust regression
Referring to the linear regression model (29), the maximum likelihood estimation of X at time step n can be obtained by solving the following coupled equation:
where, \(\dim ( \cdot )\) is the operation to count the dimension of X and \(j^{\prime } = 1,2, \ldots ,\dim ({\varvec{X}})\). However, the pdf \(f(\tilde{\user2{v}})\) of the \(\tilde{\user2{v}}\) is asymmetric because the mean of the NLOS error is positive. Therefore, we use the descending score function \(\varphi \left( \cdot \right)\), which is referred to [22]:
where, \(\beta_{1}\) is chosen to be 1.739; according to [22], we set \(\alpha_{1}\) and \(\alpha_{2}\) as 1.5 and 3 respectively. The state estimate X obtained above still contains a large error, so we use Newtonâ€“Raphson method to optimize X:
At first, we need to obtain the initial state estimate \({\varvec{X}}_{0}\) by least squares (LS)s:
where, \({\varvec{X}}_{r}\) is the state estimate in rth iteration.
Next, we determine the error residual \(\user2{\hat{\tilde{v}}}\) through deformation by shifting (29) and estimate the error scale \(\sigma_{{\text{v}}}\) by (37):
Then, the update step of the robust Kalman filter is performed, in which the state estimate \({\varvec{X}}_{r}\) is updated iteratively by Newtonâ€“Raphson method. The iteration will continue until the preset convergence is met, otherwise the iteration will be broken, and the final result will be reserved.
where, the preset threshold \(\varepsilon\) is set to 0.5.
At last, \({\varvec{X}}_{r + 1}\) is determined as the state vector X at this time step n and the twodimension coordinates of the position estimates \({\varvec{Z}}(n)\) can be obtained by X multiplying the matrix B:
4.4 LOS identification strategy
If the noise is small, the reconstruction has little change to the original distance measurements and the reconstruction distance measurements have limited improvement to the positioning accuracy. The enhancement of the accuracy should be improved from the positioning method. We use multiple position estimates generated by distance measurements to eliminate outliers, and retain the position estimates under the condition of LOS with small errors.
We firstly divide the reconstructed distance measurements into K combinations and each combination generate a corresponding position estimates via leastsquares. Then by processing these position estimates with extended Kalman filter (EKF), filtered positions \(\user2{\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{Z} }_{i} (n)\) can be obtained which is expressed as follow:
_{where}
Next, we obtain the coordinate \({\varvec{Z}}(nn  1)\) of the predicted position and calculate the innovation \(\user2{\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{v} }_{i} (n)\) between the position estimate of the ith combination and the predicted position:
LOS identification: If the NLOS error in position estimate of each combination has been mostly eliminated after the distance measurements reconstruction, the condition of the position estimate can be considered in LOS. Furthermore, there are:
where, \(\user2{\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{S} }_{i} (n)\) is the innovation covariance matrix of \(\user2{\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{Z} }_{i} (n)\).
K hypotheses and alternatives are defined to validate (46). The hypothesis \(\zeta_{0,i}\) holds true when the ith position estimate is determined in LOS, otherwise the hypothesis \(\zeta_{1,i}\) holds true [15].
where, \({\varvec{T}}_{i} (n)\) is the test statistic, which is used to compare with the threshold value \(\gamma\) of the validation gate to judge whether the position estimate \(\user2{\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{Z} }_{i} (n)\) is in the validation region. If \({\varvec{T}}_{i} (n)\) isnâ€™t larger than \(\gamma\), the hypothesis \(\zeta_{0,i}\) holds; otherwise \(\zeta_{0,i}\) is rejected. The threshold value \(\gamma\) is related to tracking threshold probability \(P_{g}\), which represents the probability that the position estimate that falls into the verification area can be correctly detected, and it can be obtained from the following formula:
where, \(f_{{\chi^{2} (2)}} ( \cdot )\) is the probability density function of chisquare distribution, which has two degrees of freedom. \(P_{Fa}\) is the false alarm rate, while the sum of \(P_{g}\) and \(P_{Fa}\) is 1.
We record the position estimates that passed the hypothesis test and the number of them, which are denoted as \(\overline{\user2{Z}}_{j} (n)\) and \(k(n)\) respectively. \(\overline{\user2{Z}}_{j} (n)\) is expressed as follows:
where, \(k(n)\) is a nonnegative integer no greater than K.
4.5 Residual weighting method
When \(k(n)\) is more than zero, the position estimates fall into the validation region in the previous procedure are selected and used for residual weighting in this procedure. While the other position estimates are discarded. It may also occur that \(k(n)\) is equal to zero, which indicates that all position estimates do not meet the hypothesis and are not identified in LOS, then we use the original position estimates \(\user2{\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{Z} }_{i} (n)\).
Residual weighting method is performed to prevent reconstruction failure. Assuming that the previous steps did not introduce large errors, the predicted point is relatively accurate and is near the real position of mobile node. Therefore, we take the predicted position \({\varvec{X}}(nn  1)\) as the center, and the definition of residual [4] is modified as follows:
When \(k(n) = 0\):
When \(k(n) > 0\):
The position estimate which is close to the predicted position is given a larger weight by taking the reciprocal of the corresponding residual. After calculating the residual of each position estimate, the residual weighted results of them are combined as the positioning result of this time step n:
When \(k(n) = 0\):
When \(k(n) > 0\):
4.6 Results merging
In this subsection, the positioning results of the above two methods are merged by weighting. Due to the distance measurements contaminated by noise, the filtered distance measurements are closer to the actual distances. We compute the distances from the BNs to the positioning results, which are expressed as \({\varvec{h}}({\varvec{Z}}(n))\) and \({\varvec{h}}({\varvec{W}}(n))\). The greater the differences between them and the distance measurements \({\varvec{D}}(n)\) are, the more effective of this method can be considered. Therefore, we utilize the ideas in [4], and revise the definitions:
Then the weighted sum of the two results at time step n can be obtained after computing the weighting coefficient \(\beta_{i} (n)\), which is defined as \({\varvec{O}}(n)\):
At the same time, we substitute \({\varvec{O}}(n)\) into the first and second components of the state vector \({\varvec{X}}(nn)\):
5 Simulation and experimental results
5.1 Simulation scene and parameter settings
In this subsection, we mainly introduce the simulation scene and various parameters. The simulation was carried out on the MATLAB platform. And the MN had a fixed trajectory in a \(80 \times 80\;{\text{m}}\) simulation area, where six beacon nodes were randomly distributed in Fig.Â 2. We sampled 80 times at a sampling interval of 0.5Â s. The initial state of the MN was \([1m{ 78}m{\text{ 1m/s 2}}{\text{.5m/s}}]^{T}\) and the initial covariance matrix of MN was \({\varvec{P}}(0) = {\varvec{I}}_{4}\). \({\varvec{u}}(n)\) was the Gaussian white noise \(N(0,1^{2} )\), and \({\varvec{R}}(0) = \sigma_{l}^{2} {\varvec{I}}_{6}\) was the covariance matrix of measurement noise. In this paper, the threshold probability was \(P_{g} = 0.99\), so the false alarm rate was \(P_{Fa} = 0.01\). 1000 Monte Carlo simulations were conducted in each environment.
We use root mean square error (RMSE) and cumulative distribution function (CDF) of the localization error to characterize the localization performance of these algorithms, and RMSE is calculated as follows:
where, \({\varvec{A}}(n)\) is the actual location, and \({\varvec{O}}_{k} (n)\) is the estimated position at time step n in the kth Monte Carlo simulation, which is obtained from (61). \(MC = 1000\) is the total Monte Carlo runs times, and \(N = 80\) denotes the number of whole samples in a Monte Carlo run.
To illustrate the general applicability of the proposed algorithm, we complicate the motion trajectory and set it as a cubic curve \(y =  0.00063x^{3} + 40.63, \, x \in [1,80][1,80]\), where the inflection point is \({\varvec{A}}(n)(1) = 40\). FigureÂ 2 shows the present route of the MN and the random distribution of six BNs in a Monte Carlo simulation.
The NLOS error may follow different distributions according to the environment, and the distribution of NLOS error may be related to the type and distribution of indoor obstacles. We did simulations when the NLOS error follow Gaussian, uniform and exponential distribution respectively. We mainly compared our algorithm with the conventional positioning algorithm: EKF [23], REKF [24], IMMEKF [25] and probabilistic data association IMM (PIMM) [26]. The specific positioning performances of these algorithms in simulation are shown in the following section.
5.2 Simulation results and discussion
5.2.1 Gaussian distribution
On the condition that NLOS error and sensor noise followed Gaussian distribution \(N(\mu_{NLOS} ,\sigma_{NLOS}^{2} )\) and \(N\left( {0,\sigma_{LOS}^{2} } \right)\) respectively, we set the default parameters as shown in the Table 1. The NLOS error probability is defined as the proportion of NLOS error to the noise composed of LOS error and NLOS error.
FigureÂ 3 demonstrates the change of RMSE under different probabilities of the NLOS error \(P_{NLOS}\) which varied from 0.1 to 1. The RMSE curve of the EKF, REKF and IMMEKF had the same trend, and the RMSE value of them from largest to smallest were the EKF, REKF and IMMEKF. The PIMM had the largest RMSE value and poorest positioning performance when \(P_{NLOS}\) was above 0.6. The proposed algorithm had the lowest average value of RMSE, which was 2.1047Â m and at least 39.90% lower than that of the other four algorithms. FigureÂ 4 displays the change in positioning performance when \(\mu_{NLOS}\) varied from 2 to 11Â m. The RMSE of the EKF, REKF and IMMEKF had the same uptrend and they were nearly close, but their RMSE value were not small. No matter how many \(\mu_{NLOS}\) was, the proposed algorithm always had the smallest RMSE. The average values of the RMSE were the EKF, the REKF, the IMMEKF, the PIMM and the proposed algorithm in descending order, and the specific values of them were 4.3656Â m, 4.2116Â m, 4.1703Â m, 4.1438Â m and 2.5052Â m respectively. FigureÂ 5 displays the change in positioning performance when \(\sigma_{NLOS}\) varied from 2 to 11Â m. The RMSE of the EKF, REKF and IMMEKF had the same uptrend, but their RMSE value were not smaller than the other two algorithms. The proposed algorithm had the smallest RMSE among these algorithms. The average values of the RMSE were the EKF, the REKF, the IMMEKF, the PIMM and the proposed algorithm in descending order, and the specific values of them were 4.9315Â m, 4.7162Â m, 4.7013Â m, 4.5468Â m and 2.9892Â m respectively. As shown in Fig.Â 6, the RMSE curve of the proposed algorithm is steeper than other algorithms, which is far from the other curves. The 50% localization errors of the proposed algorithm was about 1.771Â m, which was at least 11.5% lower than that of the other four algorithms. And the 90% localization errors of the proposed algorithm were about 3.383Â m, which was at least 31.81% lower than that of the other algorithms.
With the increase of the probability, mean or standard deviation of the NLOS error, the true value of NLOS error at a certain time will increase, and the interference to the measured value will intensify. The localization errors of the position estimates processed by the location algorithm will be greater. Therefore, in Figs. 3, 4 and 5, the RMSE of each algorithm has an upward trend. Since the proposed algorithm adopted mean reconstruction method, the greater the probability of NLOS error was, the more times NLOS situation occurred, the more the mean value can reflect the actual situation. The proposed algorithm in Fig.Â 3 had small RMSE and good positioning performance in the case of high probability of NLOS error. When the probability of the NLOS error \(P_{NLOS}\) was small, the NLOS interference was little, so the RMSE was also small. The PIMM algorithm associated multiple position estimates with Kalman predicted position. These position estimates directly affected the results, and they were generated by LS. The effectiveness of the PIMM algorithm largely depends on the number of excellent measurements, so in the case of high NLOS probability, the PIMM performance was not outstanding. The CDF reflects the distribution of overall localization errors, which can be seen from Fig.Â 6. Most of the localization errors of the proposed algorithm were less than 3Â m, and only few outliers appeared in the positioning.
5.2.2 Uniform distribution
On the condition that NLOS error followed uniform distribution \(U(0,\max )\), we set the default parameters as shown in the Table 2.
We studied the positioning effect of different localization algorithms when the NLOS error probability was increasing. FigureÂ 7 is similar to in Fig.Â 4, in which the RMSE of the proposed algorithm changed slightly. Especially when \(P_{NLOS}\) was above 0.3, its value was stable at around 2Â m. The RMSE of the EKF, REKF and IMMEKF were rising linearly with \(P_{NLOS}\). The proposed algorithm had the lowest average value of RMSE, which was 1.9576Â m and at least 40.44% lower than that of the other four algorithms. Then, we let the parameter max change from 6 to 15Â m. FigureÂ 8 shows that the RMSE were positively correlated to the parameter max. The EKF, REKF and IMMEKF had the largest RMSE and the largest growth rate. The average values of the RMSE were the EKF, the REKF, the IMMEKF, the PIMM and the proposed algorithm in descending order, and the specific values of them were 3.5689Â m, 3.4480Â m, 3.4335Â m, 3.3649Â m and 2.9892Â m respectively. The influence of the parameter L on the positioning effect of different algorithms was shown in Fig.Â 9. No matter how many BNs there were, our algorithm always worked best, improving accuracy by more than 2Â m over other algorithms. The proposed algorithm had the lowest average value of RMSE, which was 2.0197Â m and at least 37.36% lower than that of the four other algorithms.
In the case of uniform distribution, the larger the upper limit of NLOS error was, the greater the probability of NLOS error appeared with a larger value, so the interference to positioning became stronger. As shown in the Fig.Â 8 the RMSE of each algorithm increased with parameter max. The proposed algorithm determined the position estimates and discarded the position estimates that did not fall into the verification gate. Therefore, the proposed algorithm was not susceptible to NLOS errors and had good robustness with smallest RMSE curve growth rate. The more the number of beacon nodes were, the more information about the mobile node can be measured, and the more equations in the maximum likelihood location method can be established, so the the position estimates obtained by LS will be more accurate. As shown in the Fig.Â 9, the more BNs were, the better these algorithms performed.
5.2.3 Exponential distribution
On the condition that NLOS error followed exponential distribution \(E(1/\lambda )\), we set the default parameters as shown in the Table 3.
FigureÂ 10 demonstrates the RMSE values of each algorithm under different probabilities \(P_{NLOS}\). When \(P_{NLOS}\) was 0.3, the performance of the proposed algorithm was better than the EKF, the REKF and the IMMEKF, but it was not as good as the PIMM. When the probability P_{NLOS} was above 0.3, the proposed algorithm performed well in localization, and the PIMM was suboptimal. The proposed algorithm had the lowest average value of RMSE, which was 2.2132Â m and at least 28.46% lower than that of the other four algorithms. FigureÂ 11 demonstrates the RMSE values of each algorithm under different parameters \(\lambda\). The average values of the RMSE were the EKF, the IMMEKF, the REKF, the PIMM and the proposed algorithm in descending order, and the specific values of them were 3.1050Â m. 2.9599Â m, 2.9554Â m, 2.7823Â m and 2.1185Â m respectively. The CDF of localization error of different algorithms are shown in Fig.Â 12. The 90% localization errors of these algorithms were the EKF, the IMMEKF, the REKF, the PIMM and the proposed algorithm in descending order, and the specific values of them were 4.683Â m, 4.579Â m 4.463Â m, 3.611Â m and 3.374Â m respectively.
In the case of uniform distribution, with the increase of parameter \(\lambda\), the maximum value of NLOS error increases exponentially. Compared with Gaussian and uniform distribution of Figs. 4, 5 and 8, as shown in the Fig.Â 11, the growth rate of RMSE curve is larger and the curve is steeper. Although there are three different NLOS error distributions, the proposed algorithm showed good positioning performance and robustness.
5.3 Experimental site and equipment
The real environment is often complex and changeable, so on the basis of simulation, we conducted two experiments in real indoor environments. Ultrawide band (UWB) technique is popular for researchers to use in indoor positioning, due to its high accuracy and low energy consumption [27]. In the experiment, the UWB nodes were used as radio frequency (RF) devices and sensor nodes in WSN, and Fig.Â 13 displays a UWB node. The MN was connected with the power supply and it was strapped to the walker's shoes; to maintain the same height with MN, the BNs were placed on the ground. At the same time, the BNs transmitted the distance measurements to the laptop through the universal serial bus (USB) cable and the laptop displayed the distance measurements on the screen.
As shown in Figs. 14 and 15, the experimental site was a university classroom with a large number of tables, seats and students, which can be considered as obstacles. Therefore, the measured data obtained from the UWB nodes were easily contaminated by NLOS errors, containing large errors. We randomly placed six UWB nodes and moved at a constant speed of 1.2Â m/s, and sampled 30 times in total. We took the corner of the lower left corner as the origin; took the long side of the classroom as the xaxis, and the short side as the yaxis, to establish a twodimensional coordinate system, and the coordinate of the initial position was \([0.6m \, 1.2m]^{T}\). The motion trajectory was roughly a rectangle. We first moved in the vertical direction, so the horizontal speed was \(0m/s\). The entire positioning process was sampled 30 times in total, during the sampling time \((\Delta t = 1s)\), each beacon node collected more than 20 distance measurements. After sampling, the average value of them was obtained as the input of each localization algorithm.
FiguresÂ 16 and 17 show the actual scenario and schematic diagram of the research group office. The difference was that the scope of this scene was smaller, so there were only four BNs, and the track distance was relatively short, so only 15 times were sampled. As shown in Fig.Â 17, we set an origin at the bottom right of the room, extending the yaxis in the left direction of the plan view and the xaxis in the upper direction of the plan view to establish a coordinate system, and the coordinate of the initial position was \([7.2\;{\text{m }}1.8\;{\text{m}}]^{T}\) (Figs. 18, 19, 20, and 21).
5.4 Experimental results and discussion
To illustrate the filtering effect of the algorithms, the data before and after the algorithm processing were shown in Figs. 18 and 21. Because the proposed algorithm subtracted a value during reconstruction, the processed results may be smaller than the actual distances, but they were close to the actual distances, so the position estimates obtained were still more accurate than that in other algorithms. The positioned trajectories in the university classroom and the research group office are shown in Figs. 19 and 22, and the track of the proposed algorithm was close to the real track. In addition, the CDF of the localization errors of the proposed algorithm were smaller than other algorithms in Figs. 20 and 23. Because the interference of NLOS errors caused by lots of obstacles in the experimental site were large, the localization performance of the EKF, REKF, IMMEKF and PIMM were relatively poor. Since the classroom was not as large as the simulation scene, and the noise here was not as complicated as expected, so the final positioning results were slightly different from the simulation.
The algorithm and data processing were conducted in MATLAB2018b platform of the laptop whose computer system is a 64bit operating system and the processor is Intel (R) Core (TM) i57300HQ CPU @ 2.50Â GHz. Tables 4 and 5 show the running time that each algorithm estimated the position at a sampling time in the university classroom and the research group office. In order to ensure the high precision of positioning, it is inevitable to increase the amount of calculation. The sampling frequency of this experiment was set to 1Â Hz. Although the proposed algorithm consumed more time, the processing time for each sampling point was still less than one second, which equalled to the interval between single sample. Therefore, the algorithm can achieve realtime tracking and positioning.
6 Conclusion
In this paper, we proposed a mean reconstruction method to improve the REKF, which can detect and mitigate the NLOS errors to enhance the positioning accuracy. The specific operation of the algorithm is to use the Kalman prediction position to calculate the differences from the distance measurements, which are nearly equivalent to the noise. After averaging the data to estimate the mean value of the noise, the distance measurements are reconstructed by subtracting the estimation of the noise average. At the same time, the results of the residual weighting can ensure the effectiveness of the reconstruction method. The algorithm can significantly reduce the NLOS errors, especially in the environment with severe NLOS errors. The simulation and experimental results both demonstrated that the proposed algorithm had higher localization accuracy with strong robustness, which had a prominent advantage over traditional localization algorithms. While, there are few shortcomings in the proposed algorithm.

1.
The mean reconstruction method is required to be used in a small range of area where obstacles are similar, and the NLOS errors follow the same distribution.

2.
The reconstruction may bring negative errors, which make the reconstructed distances smaller than the actual distances, and the position estimates appear on both sides of the actual trajectory.

3.
The proposed algorithm is more computationally intensive. First, in the RWGH step, the number of combinations selected is larger than other algorithms; second, the Newtonâ€“Raphson iteration will also consume a certain amount of computation.
Availability of data and materials
The data will be available on request.
Abbreviations
 WSN:

Wireless sensor network
 LOS:

Lineofsight
 NLOS:

Nonlineofsight
 EKF:

Extended Kalman filter
 REKF:

Robust extended Kalman filter
 RWGH:

Residual weighting
 TOA:

Time of arrival
 TDOA:

Time difference of arrival
 AOA:

Angle of arrival
 RSS:

Received signal strength
 BNs:

Beacon nodes
 MN:

Mobile node
 IMM:

Interactive multiple model
 LS:

Least squares
 MPDA:

Modified probabilistic data association
 PDF:

Probability density function
 PNI:

Practical NLOS identification
 PIMM:

Probabilistic data association IMM
 SVM:

Support vector machine
 MKF:

Modified Kalman filter
 RMSE:

Root mean square error
 CDF:

Cumulative distribution function
 USB:

Universal serial bus
 RF:

Radio frequency
References
Q. Tang, J. Li, L. Wang, Y. Jia, G. Cui, Multipath imaging for nlos targets behind an Lshaped corner with singlechannel UWB radar. IEEE Sens. J. 22(2), 1531â€“1540 (2022)
S. Angarano, V. Mazzia, F. Salvetti, G. Fantin, M. Chiaberge, Robust ultrawide band range error mitigation with deep learning at the edge. Eng. Appl. Artif. Intell. 102, 104278 (2021)
X. Yang, J. Wang, D. Song, B. Feng, H. Ye, A novel NLOS error compensation method based IMU for UWB indoor positioning system. IEEE Sens. J. 21(9), 11203â€“11212 (2021)
P.C. Chen, A nonlineofsight error mitigation algorithm in location estimation, in Proceedings of the IEEE Wireless Communications Networking Conference (WCNC), New Orleans, LA, USA, 21â€“24, vol. 1, pp. 316â€“320 (1999).
L. Jiao, J. Xing, X. Zhang, LCCRWGH: a NLOS error mitigation algorithm for localization in wireless sensor network, in Proceedings of the 2007 IEEE International Conference on Control and Automation, Guangzhou, China, pp. 1354â€“1359 (2007).
X. Li, An Iterative NLOS Mitigation Algorithm for Location Estimation in Sensor Networks. Mob. Wirel. Commun. (2006).
W. Xiong, C. Schindelhauer, H.C. So, J. Bordoy, A. Gabbrielli, J. Liang, TDOAbased localization with NLOS mitigation via robust model transformation and neurodynamic optimization. Signal Process. 178, 107774 (2021)
C.J. Malar, D.M. Priya, S. Janakiraman, Harris Hawk optimization algorithmbased effective localization of nonlineofsight nodes for reliable data dissemination in vehicular ad hoc networks. Int. J. Commun. Syst. 32(2), 65â€“78 (2020)
B. You, X. Li, X. Zhao and Y. Gao, A novel robust algorithm attenuating nonlineofsight errors in indoor localization, in IEEE International Conference on Communication Software and Networks (2015), pp. 6â€“11.
J. BorrÃ¡s, P. Hatrack, and N.B. Mandayam, Decision theoretic framework for NLOS identification, in Proc. VTCâ€™98, (Ottawa, Canada, 1998), pp. 1583â€“1587
S. Wu, S. Zhang, K. Xu, Probability weighting localization algorithm based on NLOS identification in wireless network. Wirel. Commun. Mob. Comput. 2019, 1 (2019)
T. Suzuki, Y. Amano, NLOS multipath classification of GNSS signal correlation output using machine learning. Sensors 21, 2503 (2021)
M.P. Wylie, J. Holtzman, The nonline of sight problem in mobile location estimation, in Proceedings of the IEEE ICUPC5th International Conference on Universal Personal Communications, Cambridge, MA, USA, pp. 827â€“831 (1996)
W. Zhao, R. He, B. Ai, Z. Zhong, H. Zhang, Vehicle localization based on hypothesis test in NLOS scenarios. IEEE Trans. Veh. Technol. 71(2), 2198â€“2203 (2022)
U. Hammes, A.M. Zoubir, Robust mobile terminal tracking in NLOS environments based on data association. IEEE Trans. Signal Process. 58(11), 5872â€“5882 (2010)
M. Liu, X. Lou, X. Jin, NLOS Identification for Localization Based on the Application of UWB. Wirel. Pers. Commun. 119, 3651â€“3670 (2021)
S. Chen, J. Liu, and L. Xue, A robust nonlineofsight error mitigation method in mobile position location. Adv. Neural Netw. ISNN (2009).
L. Yan, Y. Lu, Y. Zhang, An improved NLOS identification and mitigation approach for target tracking in wireless sensor networks. IEEE Access 5, 2798â€“2807 (2017)
L. Cheng, S. Huang, M. Xue, Y. Bi, A robust localization algorithm based on NLOS identification and classification filtering for wireless sensor network. Sensors 20(22), 6634 (2020)
J. Zhu, S.S. Kia, Decentralized cooperative localization with LoS and NLoS UWB interagent ranging. IEEE Sens. J. 22(6), 5447â€“5456 (2022)
C.M. Bishop, in Pattern Recognition and Machine Learning, Information Science and Statistics (Springer Science + Business Media, LLC, New York, USA, 2006). pp. 635â€“636.
J.R. Collins, Robust estimation of a location parameter in the presence of asymmetry. Ann. Stat. 4, 68â€“85 (1976)
W. Cui, B. Li, L. Zhang, Robust mobile location estimation in NLOS environment using GMM, IMM, and EKF. IEEE Syst. J. 13(3), 3490â€“3499 (2019)
U. Hammes, A.M. Zoubir, Robust MT tracking based on Mestimation and interacting multiple model algorithm. IEEE Trans. Signal Process. 59, 3398â€“3409 (2011)
B.S. Chen, C.Y. Yang, F.K. Liao, J.F. Liao, Mobile location estimator in a rough wireless environment using extended Kalmanbased IMM and data fusion. IEEE Trans. Veh. Technol. 58(3), 1157â€“1169 (2009)
L. Cheng, M. Xue, Z. Liu, Y. Wang, A robust tracking algorithm based on a probability data association for a wireless sensor network. Appl. Sci. 10, 6 (2020)
M. Ridolfi, J. Fontaine, B.V. Herbruggen, UWB anchor nodes selfcalibration in NLOS conditions: a machine learning and adaptive PHY error correction approach. Wirel. Netw. 27, 3007â€“3023 (2021)
Funding
This work was supported by the National Natural Science Foundation of China under Grant No.62273083 and No. 61803077; Natural Science Foundation of Hebei Province under Grant No. F2020501012.
Author information
Authors and Affiliations
Contributions
All authors contributed to the study conception and design. Material preparation, data collection and analysis were performed by YW, HY and YG. The first draft of the manuscript was written by YW and HY, and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare that there is no competing interests regarding the publication of this paper.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Wang, Y., Yang, H. & Gong, Y. A positioning algorithm based on improved robust extended Kalman filter with NLOS identification and mitigation. J Wireless Com Network 2023, 60 (2023). https://doi.org/10.1186/s13638023022703
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s13638023022703
Keywords
 Wireless sensor network
 Mean reconstruction
 Robust extended Kalman filter
 NLOS identification
 Residual weighting