NLOS Identification and Positioning Algorithm Based on Localization Residual in Wireless Sensor Networks

The problem of target localization in WSN (wireless sensor network) has received much attention in recent years. However, the performance of traditional localization algorithms will drastically degrade in the non-line of sight (NLOS) environment. Moreover, variable methods have been presented to address this issue, such as the optimization-based method and the NLOS modeling method. The former produces a higher complexity and the latter is sensitive to the propagating environment. Therefore, this paper puts forward a simple NLOS identification and localization algorithm based on the residual analysis, where at least two line-of-sight (LOS) propagating anchor nodes (AN) are required. First, all ANs are grouped into several subgroups, and each subgroup can get intermediate position estimates of target node through traditional localization algorithms. Then, the AN with an NLOS propagation, namely NLOS-AN, can be identified by the threshold based hypothesis test, where the test variable, i.e., the localization residual, is computed according to the intermediate position estimations. Finally, the position of target node can be estimated by only using ANs under line of sight (LOS) propagations. Simulation results show that the proposed algorithm can successfully identify the NLOS-AN, by which the following localization produces high accuracy so long as there are no less than two LOS-ANs.


Introduction
Target localization in the wireless sensor network has received immense attention in recent years. According to the measured localization parameter, the target localization can be classified as: time of arrival (TOA) [1][2][3], time difference of arrival (TDOA) [4,5], received signal strength indication (RSSI) [6][7][8], angle of arrival (AOA) [9], as well as their mixing parameters TOA/AOA [10], TDOA/AOA [11] and RSS/AOA [12,13]. But regardless of localization parameters, the localization accuracy will be affected by two major errors. The one is the measurement error, which is usually defined as a Gaussian variable of zero mean [14]. The second is the non-line of sight (NLOS) error caused by the refraction and reflection during signal propagation. In practice, the latter is much larger than the former, and has become a crucial factor for the positioning [14,15]. In a wide area network, such as the macro cellular network, NLOS error may approaches several hundreds meters [16], while in the small area network, such as the WSN, it may covers tens of meters. Therefore, the NLOS error suppression has become a key issue in the wireless localization.
In order to tackle the NLOS issue, there are three kinds of suppression algorithms. The first is trying to model the non-line-of-sight error, and then employ this model to finely estimate the

System Model
In our study, we assume that the sensor node has the ability to estimate TOA and AOA, but the specific estimation methods are not our goal. Moreover, analogous to conventional localization studies, we also assume that both TOA and AOA estimates have been obtained, and these estimates are corrupted by the measurement noise and NLOS error. Besides, we can employ the range measurement and angle measurement of both ANs to localize the TN by some positioning methods. If a node wants to use RSS to calculate the distance, our method is not applicable.
A simplified diagram can be found in Figure 1, where the TN and its two adjacent ANs, i.e.,AN 1 and AN 2 , are presented. In Figure 1, the line AF denotes the intersection line of two circles centered at AN 1 and AN 2 , where the circle radiuses equal to measured distances between ANs and TN. Assuming that the coordinates of target and anchors are (x, y) and (x i , y i ), we can write the distance between TN and ANs as [24].
Moreover, the AOA of AN i can be shown as Without loss of generality, we denote ANs of a subgroup as AN 1 and AN 2 , and then have the following distance equations: From above equations, one can obtain the line AF in Figure 1: Moreover, the formula to find the coordinates of point A is shown as follows: The formula to find the coordinates of point B is shown as follows: The above two equations can be transformed into the matrix form, such as for point A: Then the least-squares (LS) estimation of position A can be shown aŝ Similarly, the coordinates of possition B can also be obtained by solving a least-squares problem with respect to (6). Then, the position residual is defined as the distance between point A and point B.
Previous studies indicated that different localization methods produced adjacent position estimates in the LOS environment [25], i.e., the distance between position estimates were comparable to the standard deviation of ranging noise. By contrast, these position estimates must be obviously deviated from each other in the NLOS environment, resulting in much larger position residuals in comparison with those of LOS scenarios. Moreover, as pointed out above, point A, point B and point C can be treated as TN position estimates produced by different localization methods. Therefore, in the LOS environment, the distance between A and B, the distance between A and C, and the distance between B and C will all be relatively small, i.e., several times of standard deviation of ranging noise. Then, we can define two more residuals as where the symbol C represents the point of {C, F} closer to point A, i.e., C = C, if AC AF F, if AC > AF .

System Error Analysis
Before the detail derivations, we must point out that our derivation is in the sense of statistic, but the expectation symbol is omitted for simplicity. Furthermore, we assume that measurement noises of range and angle have small variances. Now, if there is only measurement noise, we have the perturbed version of (7) where(•) 0 and ∆(•) denote the actual value of variable and the corresponding perturbed parts. Equation (11) can be further expanded as (12) can be simplified as Thus, the estimation error caused by measurement error can be derived as Since we have assume small measurement noises in the LOS environment, we have approximations as ∆r 2 1 ≈ ∆r 2 2 , sin ∆θ 1 ≈ ∆θ 1 and cos ∆θ 1 ≈ 1. Then, we can derive . Note that the expressions of ∆Y and ∆A can also be explained by the differential theory. Similarly, it is also possible to find the error ∆X B of point B, then the deviation between point A and point B can be computed as where || • || denote the norm operation. By applying triangular inequality, we have that ∆X A − ∆X B ≤ ∆X A + ∆X B , then the threshold can be defined as: From (15) to (16), it is suggested that if the estimating error is less than a threshold, the included two ANs are highly possible to be LOS-ANs. In fact, our next simulation confirms this prediction. Otherwise, there is at least one NLOS-AN. However, if we use (16) as the threshold, X 0 A is unknown. Though X 0 A can be replaced with the TN position estimation (X A ) of (8), the AOA measurement is highly instable in the NLOS environment, which significantly affects the matrixes Finally, Formula (16) may yield a large and loose threshold, resulting in an increased missing probability of NLOS-AN detection. Hence, we will show in the next section how to resolve this issue.

Threshold Determination and NLOS-AN Identification
In order to tackle the above problem, we look for principles from the geometric relation, and then propose a novel threshold. From Figure 1, it is clearly that the maximal distance between point A and point B occurs when points A and B are on the upper and lower sides of point C, and then we have When there is no NLOS propagation, the AOA measurement error is trivial, i.e., ∠ADC and ∠BEC are small. Denoting these two angles as ω 1 and ω 2 , we have the following trigonometric expression Assuming the same standard deviation of AOA measurement, we can derive the following expression where σ a denotes the standard deviation of AOA measurement. If the parameter λ is large enough, the inequation will be satisfied with a high possibility. Unfortunately, this single residual is not enough for the NLOS-AN identification. For example, a large λ increases the missing probability of NLOS-AN detection. Hence, we introduce other two residuals as detection variables where sin ω k ≈ ω k holds for small ω k in the LOS environment. We must indicate that the derivations of (17)∼ (20) are not sensitive to relative positions of {A, B, C}, i.e., the proposed algorithm still works even if the point A is below the point B.
In real-world applications, the actual values used in (19)∼ (20) are unknown, and we have to replace them by measured values. Since λ can be determined artificially, the influence of this substitution will be compensated by searching appropriate λ. Then, the final residual detector can be derived as: However, there are three comparisons in (21), leading to large thresholds to satisfy three inequations at the same time. Simulations demonstrate that two comparisons are enough. Therefore, the detector (21) can be reformulated as A complete NLOS-AN identification and localization process can be summarized as: (1) Find the coordinates of points A and B using (8), and then solve the circle intersections C and F . In the above step (6), after combining range and angle measurements of LOS-ANs, we can construct a mixed positioning equation as: where R = x 2 + y 2 and M represents the number of LOS-ANs. The above equation can be solved by least squares algorithm, such asX Note that if we cannot identify at least two LOS-ANs, we will estimate the TN position according to (8), i.e., operate the LS localization by exploiting all ANs.
In the NLOS-AN identification mentioned above, an important mission is to determine the λ and therefore the threshold, which will be presented next.

Threshold Determination
There are five ANs located in a 100-m × 100-m area as shown in Figure 2, and their locations are (0, 0), (100, 100), (−100, 100), (−100, −100) and (100, −100). Without loss of generality, the TN is placed at (58, 0), and the range and angle measurements usually satisfŷ  (26) and (27), we explicitly see the process to generate measurements. First, we should generate the TN position, and then we can compute r 0 k as well as θ 0 k according to the geometric topology. Second, we generate the NLOS errors according to their statistical distributions. Subsequently, the Gaussian noises are generated according to their statistical distributions. Finally, we combine all terms according to (26) and (27).
Here we must determine the reasonable threshold based on Formulae (18)- (20). Since Formulae (18)- (20) are only semi-analytical derivations, the simulations are required to final determine λ and therefore the thresholds, which will be shown in Figure 3.

Analysis for the Positioning Performance
After the NLOS-AN identification, we will operate the localization by the simple LS method, where only identified LOS-ANs are included so long as there are at least two identified LOS-ANs. As seen in Figure 3, the identification probability is large, which definitely produces superior positioning performance as shown in next simulations. Moreover, we also choose some classical or latest alorithms as comparisons, as described in Table 1.  Figure 4, we explicitly see the best performance of the proposed algorithm, and the gap between it and CRLB is small. Moreover, with the increase of LOS-AN, the RMSE of all tested algorithms tends to decrease. Note that the gap between the CRLB and the proposed algorithm is small and tends to be invariant, so long as the number of LOS-AN is larger than four. In fact, this gap of 3LOS-AN is only trivially larger than that of 4LOS-AN. On the other hand, the SDP method is relatively stable to the LOS-AN number, which make it lose its advantage in the case equipped with more LOS-ANs. Meanwhile, the SDP method uses the optimization tool, thus its computational complexity is higher than the non-optimization method, such as the proposed algorithm and the RWGH method. In addition, the RWGH algorithm produces great improvements with the increase of LOS-AN number, which is because it uses three-AN subgroups and benefit from the increase of LOS-AN number. From Figure 5, we can find conclusions agree with those from Figure 4. Furthermore, we have seen from Figure 5 that the angular deviation does not have a great impact on the positioning accuracy, so long as the SDA is within a reasonable range. In fact, the proposed algorithm produces a slowly rising RMSE w.r.t SDA, and approximately linear curves suggest good performance for even larger SDAs. On the other hand, we must indicate that even the current AOA configuration yields a large AOA error. First, the NLOS error of AOA is equally possible in the range of −180∼180 • , resulting in a large value in general. Second, the measurement noise of AOA is a Gaussian variable, which may produce a large value even for SDA = 2 • . Figure 6 presents comparisons for the CDF performance at SDR = 2 m, SDA = 1 • , i.e., a typical measurement noise level in existing literature [28,29]. From it, we definitely see the superior performance of the proposed algorithm, i.e., even with only two LOS-ANs, the NI-LS method yields about nine meters errors with probability higher than 0.95. When the LOS-AN number approaches three, this error reaches about six meters with probability higher than 0.95. Moreover, there is still gap between the NI-LS and ideal NI-LS, which must caused by the identification failure. The reason is that the λ is determined to cover wide ranges of SDR and SDA, hence it is not optimal for a certain setting of SDR and SDA, resulting in some identification failure. However, the excellent positioning accuracy indicates that the identification accuracy is high. Meanwhile, the decreasing CDF gap between the NI-LS and ideal NI-LS suggests that the NLOS-AN identification tends to be more and more accurate by exploiting more LOS-ANs.
In order to test the proposed algorithm in more realistic and harsh environments, we present new simulations in Figure 7, where the NLOS error of range is uniformly distributed within 20∼70 m.
Moreover, the SDR reaches four meters and only two LOS-ANs are employed. From Figure 7, we clearly see that the proposed algorithm significantly outperforms its counterparts. Moreover, we also see the performance degradation in comparison with Figure 6, which means that the harsh environment deteriorates localization performance. However, the proposed algorithm still produces acceptable CDF, i.e., it is about 0.9 when the localization error is eleven meters. Therefore, the proposed algorithm produces enough performance redundant to combat the harsh environment.
Summarizing the above discussions, we must point out that the correct NLOS-AN identification is important for wireless localization. Fortunately, the proposed algorithm produces excellent detection performance even in very harsh environments, and then it yields superior positioning performance in comparison with its localization counterparts that do not distinguish between LOS/NLOS links.

Conclusions
The Non-line-of-sight error significantly reduces the localization accuracy, therefore this paper proposes a two-step algorithm to suppress the influence of NLOS errors, where at least two LOS-ANs are required. First, we define a novel residual addressing the positioning difference. Second, a threshold hypothesis test is employed to identify the NLOS-AN. Finally, the target position is estimated by all identified LOS-ANs. We test the proposed algorithm by computer simulations, and results show a good and superior performance. In conclusion, the proposed algorithm can effectively identify the NLOS-AN and significantly improve the positioning accuracy under the hybrid NLOS/LOS environment.
Author Contributions: The authors contributed this paper as follow: J.H. contributed the paper in the stages of funding acquisition, conceptualization, Methodology, investigation, formal analysis and writing. Y.Y. contributed the paper in the stages of methodology, investigation, software and formal analysis. W.L. contributed the paper in the stages of software, validation and formal analysis. Y.Z. contributed the paper in the stages of formal analysis and writing-original draft preparation. F.L. contributed the paper in the stages of formal analysis and writing-review and editing.