A Triple-Filter NLOS Localization Algorithm Based on Fuzzy C-means for Wireless Sensor Networks

With the rapid development of communication technology in recent years, Wireless Sensor Network (WSN) has become a promising research project. WSN is widely applied in a number of fields such as military, environmental monitoring, space exploration and so on. The non-line-of-sight (NLOS) localization is one of the most essential techniques for WSN. However, the NLOS propagation of WSN is largely influenced by many factors. Hence, a triple filters mixed Kalman Filter (KF) and Unscented Kalman Filter (UKF) voting algorithm based on Fuzzy-C-Means (FCM) and residual analysis (TF-FCM) has been proposed to cope with this problem. Firstly, an NLOS identification algorithm based on residual analysis is used to identify NLOS errors. Then, an NLOS correction algorithm based on voting and NLOS errors classification algorithm based on FCM are used to process the NLOS measurements. Hard NLOS measurements and soft NLOS measurements are classified by FCM classification. Secondly, KF and UKF are applied to filter two categories of NLOS measurements. Thirdly, maximum likelihood localization (ML) is employed to estimate the position of mobile nodes. The simulation result confirms that the accuracy and robustness of TF-FCM are better than IMM, UKF and KF. Finally, an experiment is conducted to test and verify our algorithm which obtains higher localization accuracy.


Introduction
The most popular worldwide localization is the Global Positioning System (GPS) which is used to tackle outdoor positioning problems, but its accuracy cannot meet requirements in some areas especially in indoor environments. Therefore, Wireless Sensor Network (WSN) based on indoor localization has attracted attention in recent years.
As a research hotspot, WSN has been widely applied in military applications, environmental monitoring, medical care and space exploration. Moreover, the localization techniques based on a mobile node's location has vital research significance [1]. Because of the influence of Non-Line-of-Sight (NLOS) propagation, and other factors such as insufficient position signal strength, electromagnetic interference noise and mobile beacon node, the accuracy of localization has become a critical research direction.
According to measuring the distance between nodes, localization algorithms are normally divided into two categories: range-based algorithms and range-free algorithms, and there are many conventional methods in range-based algorithms; for example, time difference of arrival (TDoA), time of arrival (ToA), received signal strength (RSS), direction-of-arrival (DoA) and space-division Table 1. List of key notations.

Symbol Explanation Symbol Explanation
N the number of beacon nodes N C the combination of beacon nodes using AoA and ToA measurements based on WSN in NLOS environments in [8]. This paper used a two-step weighted least square (WLS) estimator by means of the first-order error analysis. However, an experiment is needed, because the Gaussian distribution of simulation cannot cover all the complex situation in the real world. NLOS identification is profoundly significant in most range-based algorithms. Hence, some methods have been proposed to address this issue better [9][10][11][12][13]. Hua proposed an NLOS identification and positioning algorithm based on a localization residual in WSN in [9]. A two-step algorithm to mitigate NLOS errors is proposed, including residual analysis addressing the positioning difference and a threshold hypothesis test. The simulation shows a good performance, but the algorithm needs an experiment based on a real scenario, and the hypothesis based on threshold needs much reliance on people's subjective experience. Yang proposed NLOS identification for UWB localization based on import vector machine (IVM) in [10]. In his paper, a novel NLOS identification algorithm with feature selection strategy has been put forward so as to ameliorate the classification accuracy. Besides, a localization algorithm based on IVM with high accuracy and low complexity is also a highlight, which produces higher positioning accuracy than Support Vector Machine (SVM) and Relevance Vector Machine (RVM), but the algorithm needs plenty of training data, and will perform poorly with few training sets. Lei come up with a robust cooperative indoor localization based on reliability evaluation in [11]. The algorithm combines the advantages of compressive sensing (CS) in the LOS condition and the PF in the NLOS condition, and a reliability evaluation is also proposed to evaluate the estimation results of CS and PF. However, the NLOS identification of this method is based on reliability evaluation, which is not accurate to distinguish the NLOS and LOS measurements. Aghaie presented localization of WSN nodes based on NLOS identification using AoAs statistical information in [12]. The main idea of this paper is the identification of NLOS nodes based on the statistical model of the measurement and the NLOS errors where they utilized an NP method to judge a threshold. Yu put forward a mean shift-based mobile localization method in mixed LOS/NLOS environments for a wireless sensor network in [13]. A novel mobile localization method is presented in order to overcome the effects of NLOS errors by utilizing the mean shift-based Kalman filter, but the NLOS identification is based on the hypotheses and alternatives methods. These methods need prior thresholds.
Apart from the Maximum Likelihood (ML) based on the parameter estimation methods mentioned above, there are also other popular approaches in the family of ML-based parameter estimation. The iterative Space-Alternative Generalized Expectation Maximization Algorithm (SAGE) introduces some hidden data to simplify the ML estimation [14]. A soft-input soft-output (SISO) version improves robustness, which is applied to joint successive interference cancellation and channel estimation [15]. The iterative method is called multiple-input multiple-output space division multiple access (MIMO-SDMA), which approaches the maximum likelihood estimate with fast convergence and low complexity [16].

Problem Statement
This section is made up of three parts: signal model and brief introductions of UKF and FCM. In Section 4.1, some necessary assumptions and important definitions about NLOS are proposed to better describe the algorithm. In Sections 4.2 and 4.3, a brief presentation about the methods is given, including FCM and UKF. In Section 4.2, a brief description of UKF is made, which is used to cope with NLOS errors. In Section 4.3, an introduction about FCM is used to classify NLOS measurements into two categories: hard NLOS measurements and soft ones.

Signal Model
In this section, some technical preparations are introduced to describe the algorithm. N beacon nodes are randomly distributed in field with the coordinates given by (x i , y i ), i = 1, . . . , N. The coordinate of unknown node at the time k is (x(k), y(k)), t = t 0 , . . . , t n . Hence, the true distance d i (k) between the i-th unknown node and the beacon node at time k [17][18][19] can be expressed as: Due to the existence of measurement errors, the noise of actual measurement distanced LOS i (k) under LOS condition can be approximated by Gaussian white noise. So the LOS measurement distance can be expressed as follows:d where n LOS is the measurement noise obeyed Gaussian Distribution with zero mean and σ 2 LOS , i.e., N(0, σ 2 LOS ). The probability density function of n LOS can be expressed as: In actual scenario, there are obstacles between beacon nodes and mobile node, which result in the propagation distance is longer than true distance. Thus, some NLOS noise n NLOS can be added to Moreover, the NLOS error n NLOS is usually regarded as positive, which obey Gaussian, Uniform, or Exponential Distribution. The probability density function of n norm NLOS obeyed Gaussian Distribution (n norm NLOS ∼ N(µ NLOS , σ 2 NLOS )) can be described as follows: And the probability density function of n uni f NLOS which obeys to Uniform Distribution (n uni f NLOS ∼ U(u min , u max )) is given by: The probability density function of n exp NLOS which obeys to Exponential Distribution (n exp NLOS ∼ E(λ)) is given by:

A Brief Introduction to UKF
In our algorithm, UKF is utilized to tackle NLOS measurements including hard NLOS measurements and soft ones. In this section, the advantages of UKF are firstly introduced. Then, an important technique UT transform that is used in UKF will be discussed to better introduce UKF. Finally, the brief implementation steps of UKF will be given.
UKF is an algorithm that uses sampling points to estimate nonlinear distribution and its main frame is based on KF. KF is the most commonly used filter in WSN localization, but KF is proposed to solve problems based on a linear system that the noise is assumed as Gaussian white noise, and it is ineffective when filtering non-linear noise. After that, researchers proposed an algorithm to linearize Sensors 2019, 19, 1215 6 of 24 nonlinear systems, which is known as Extended Kalman Filter (EKF), but the linear processing of EKF causes great calculation errors, even causing the filtering results not to converge. Moreover, EKF needs to calculate Jacobi matrix increasing the amount of calculation. Later, Simon J. Julier introduced Unscented Transformation (UT) to the analysis of KF, which obtained a higher precision and a lower algorithm complexity than EKF.
UT is the most important part of UKF that is different from EKF. UT is a conversion when calculating statistical characteristics of random variables in a nonlinear transformation. UT calculates posterior statistical properties of random vectors by means of weighted statistical linear regression. The selection of the sampling strategy in the UT transform has a vital impact on the estimation results. The sampling strategy of UT includes symmetric sampling, simplex sampling, third-order moment skew sampling, Gaussian distribution fourth-order moment symmetric sampling, etc. The difference between the sigma points produced by the various sampling strategies is the distance and the weight to the center point.
UKF is based on UT, abandoning the traditional method and using KF as its main frame. For one-step prediction equations, UKF uses UT to handle the nonlinear transfer of mean and covariance. More importantly, UKF approximates the probability density distribution of nonlinear function, and uses a series of determined samples to approach the priori probability density of the state, rather than approximating the nonlinear function. UKF does not linearize to ignore high order terms, therefore, the nonlinear distribution statistic has higher calculation accuracy [20][21][22][23].
Above all, UKF is an iterative estimation algorithm selecting sigma points according to feature distribution of sampling points. These sigma points iterate through a state equation and become the prediction points. The results are constantly corrected by Kalman gain and the errors between the true value and the measurements. Finally, the optimal estimated value can be obtained [24].

A Brief Introduction of FCM
FCM is used to classify the NLOS measurements into two categories: hard NLOS measurements and soft ones. In this section, firstly, the main feature of FCM will be discussed. Then, some basic concepts used in FCM will be explained, namely, fuzzy sets and membership function. Finally, the advantages of FCM are given to illustrate that it is appropriate to use FCM in our algorithm.
FCM is a commonly used clustering algorithm. According to a similarity criterion, a set of sample datasets without class identification is divided into several subsets. The Fuzzy C-Means (FCM) algorithm is a partition-based clustering algorithm. Its main idea is to maximize the similarity among objects divided into the same cluster, and minimize the similarity among different clusters. FCM is the improvement of the ordinary C-Means algorithm. The traditional C-Means is Crisp Partition such as K-Means, while the FCM is based on a fuzzy and flexible division according to the membership of each element. FCM clustering is an unsupervised method of gradual optimization based on iterative thinking. This method is to use the least squares principle to iteratively optimize the objective function so as to realize the fuzzy division of the dataset. On one hand, its local convergence property is very good. On the other hand, the algorithm is also effective for high dimensional characteristic space [25].
Fuzzy sets and membership function are the most important concepts of FCM. The membership function indicates the extent to which an object x belongs to the set A, which is usually expressed as µ A (x). Its independent variable range is all objects that may belong to set A (which means all points in the space where set A is located), and the value range is [0,1], that is 0 ≤ µ A (x) ≤ 1. Thus, µ A (x)= 1 means x is fully affiliated to set A, which is the equivalent of the traditional set concept x ∈ A. A membership function defined in space X can be given as a fuzzy set A, or can be called as a fuzzy subset defined in space X. With the concept of fuzzy sets, it is not hard for an element that belongs to a fuzzy set. In the clustering problem, clusters generated by clusters can be regarded as fuzzy sets. As a result, the membership value of each sample point x i is in accordance with the following relationship: 0 ≤ µ A (x i ) ≤ 1. FCM divides n-dimensional vectors x i (i = 1, . . . , n) into c fuzzy groups, and finds the cluster center of each group, so that the value function (or objective function) of the non-similarity index is minimized. The advantages of FCM mainly include the following aspects:

•
The idea of FCM can objectively reflect the authenticity of things and comply with the characteristics of human cognition of things. • After the given initial parameters, FCM does not need manual intervention in clustering, which is an unsupervised process. It can complete clustering only by dataset, which is more suitable for automatic processing. • FCM is fuzzy, especially suitable for the problems of uncertainty and ambiguity.

Proposed Method
The flow chart of our algorithm is shown as Figure 1. The input of TF-FCM isd i (k) (i = 1, 2, 3, . . . , N).d i (k) indicates the measurement at time k, and N indicates the number of the beacon nodes. The output of TF-FCM is the prediction coordinateP i (k)(x(k), y(k)). Firstly, the NLOS identification algorithm based on residual analysis is proposed to identify the propagation conditions. Then, if the propagation is NLOS condition, KF is presented to cope with the measurements. For the NLOS situation, NLOS correction algorithm based on voting is proposed to deal with it in advance, and the processed measurements after voting will be classified by NLOS classification based on FCM. Hard NLOS measurements and soft ones will be classified after FCM. Hard NLOS measurements will be processed by UKF1, and the soft NLOS measurements will be processed by UKF2. The NLOS measurements after filtering can be obtained by calculating arithmetic average. Finally, the LOS and NLOS processed measurements will be combined by weights. The processed measurements are used to calculate coordinates of a mobile node by maximum likelihood (ML) localization. x i n  into c fuzzy groups, and finds the cluster center of each group, so that the value function (or objective function) of the non-similarity index is minimized. The advantages of FCM mainly include the following aspects:  The idea of FCM can objectively reflect the authenticity of things and comply with the characteristics of human cognition of things.  After the given initial parameters, FCM does not need manual intervention in clustering, which is an unsupervised process. It can complete clustering only by dataset, which is more suitable for automatic processing.  FCM is fuzzy, especially suitable for the problems of uncertainty and ambiguity.

Proposed Method
The flow chart of our algorithm is shown as Figure 1.
indicates the measurement at time k , and N indicates the number of the beacon nodes. The output of TF-FCM is the prediction coordinate ˆ( )( ( ), ( )) i P k x k y k . Firstly, the NLOS identification algorithm based on residual analysis is proposed to identify the propagation conditions. Then, if the propagation is NLOS condition, KF is presented to cope with the measurements. For the NLOS situation, NLOS correction algorithm based on voting is proposed to deal with it in advance, and the processed measurements after voting will be classified by NLOS classification based on FCM. Hard NLOS measurements and soft ones will be classified after FCM. Hard NLOS measurements will be processed by UKF1, and the soft NLOS measurements will be processed by UKF2. The NLOS measurements after filtering can be obtained by calculating arithmetic average. Finally, the LOS and NLOS processed measurements will be combined by weights. The processed measurements are used to calculate coordinates of a mobile node by maximum likelihood (ML) localization.

NLOS Identification Based on Residual Analysis
In case that the NLOS errors data is unknown, this paper assumes that there are N ( 3 N  ) measured distances from N beacon nodes. If each group has no more than three distances, C N different combinations can be calculated to group N measurements: Then, the index of every combination is defined as { | 1, 2,..., } k C S k N  . After estimating each node's coordinate by location estimation, the estimated position ˆi X of every combination k S and corresponding residual Res can be obtained. The residual of k S is given by:

NLOS Identification Based on Residual Analysis
In case that the NLOS errors data is unknown, this paper assumes that there are N(N ≥ 3) measured distances from N beacon nodes. If each group has no more than three distances, N C different combinations can be calculated to group N measurements: Then, the index of every combination is defined as {S k |k = 1, 2, . . . , N C }. After estimating each node's coordinate by location estimation, the estimated positionX i of every combination S k and corresponding residual Res can be obtained. The residual of S k is given by: And the average residual can be defined as: Average residual Res(X k , S k ) is utilized to compare with the process noise σ i to identify the propagation status of the measurements.
where theŝ i indicates the state (1:LOS, 2:NLOS) of the measurements. The description of residual analysis is as follows (Algorithm 1):

NLOS Correction Algorithm Based on Voting
If measurementd i is identified as NLOS, which meansd i contains many NLOS errors, a voting algorithm is used to mitigate the influence NLOS errors. The voting matrix is constructed to provide the initial estimated location to obtain the correction distance. To begin with, assume the area of the field is M × M, and it can be divided into X × X cells which depend on the estimation accuracy and computational complexity of the algorithm [22], and the location of each grid can be expressed as C(m, n), for m, n = 1, 2, . . . , X. The resolution of each grid is defined as w = M X . For instance, if the field is 100 × 100 and X = 100, the resolution of cells is equal to: 100 100 = 1. The algorithm consists of the following steps.
Step 1: An X × X voting matrix V is constructed to estimate the distance, and the elements representing voting results can be expressed by: where b i (m, n) indicates the number of notes increased at each grid, which can be defined as: where d imn represents the Euclidean distance between i-th beacon node and C(m, n).d i is the measurement distance of the i-th beacon node. The value of ε can be adjusted to make estimation more accurate, and here ε = σ LOS .
Step 2: The largest value in the voting matrix can be obtained, which is marked as V(m * , n * ), and V(m * , n * ) ≥ V(m, n), f or m, n = 1, 2, . . . , X. The estimated location of mobile node is where C * is the initial results set and v represents the number of elements in C * , and the estimated location of the mobile node is given by: The brief description of Step 2 is illustrated as Figure 2. The vote of each grid will increase if the measurement area of beacon nodes is overlapped.
Sensors 2019, 19, x FOR PEER REVIEW 9 of 24 Step 1: An X X  voting matrix V is constructed to estimate the distance, and the elements representing voting results can be expressed by: for m,n=1,2,...,X    (12) where ( , ) i b m n indicates the number of notes increased at each grid, which can be defined as: where imn d represents the Euclidean distance between i -th beacon node and ( , ) C m n . ˆi d is the measurement distance of the i -th beacon node. The value of  can be adjusted to make estimation more accurate, and here Step 2: The largest value in the voting matrix can be obtained, which is marked as . The estimated location of mobile node is , where * C is the initial results set and v represents the number of elements in * C , and the estimated location of the mobile node is given by: The brief description of Step 2 is illustrated as Figure 2. The vote of each grid will increase if the measurement area of beacon nodes is overlapped. Step 3: The corrected distance of the i -th beacon node can be updated as: represents the location of the i -th beacon node.
Based on the aforementioned descriptions, the pseudo code of Voting can be summarized as Algorithm 2: Step 3: The corrected distance d i (k) of the i-th beacon node can be updated as:

Algorithm 2. Description of NLOS Correction Algorithm based on Voting
where P i = [x i , y i ] represents the location of the i-th beacon node. Based on the aforementioned descriptions, the pseudo code of Voting can be summarized as Algorithm 2:

NLOS Errors Classification Based on FCM
Because the real distribution of NLOS is complex, it is impractical to know the parameters of NLOS errors. In order to tackle this problem, FCM is used to approximate the arbitrary probability density by adjusting its parameters.
Let d i (k) denote the range from i-th beacon node at time k after voting. M measurements from the i-th beacon node can be obtained over a time slot [k − δ, k + δ]. In order to make our statement simpler, time interval k is introduced to indicate the time slot, for example, Let c denote the number of cluster centers (1 < c < M). Here, we set c = 3. Let v = {v 1 , v 2 , . . . , v c } indicate cluster centers set. Let µ ij indicate the membership between the i-th distance d i (k) at time k and the j-th cluster center v j , and the membership matrix is given by U = [µ ij ] whose size is c × M. d ij indicates the Euclidean distance between d j (k) and v i : , and FCM can be expressed as a mathematical planning problem: where m represents the fuzzy weights factor and µ ij meets the following formula: Cluster center v i can be derived as follows to calculate the minimum value of the objective function based on the Lagrange multiplier method.
The sorted cluster center v = {v 1 , v 2 , . . . , v c } can be obtained. Since the NLOS error is of a positive bias and the largest value contains many NLOS errors, so the final result is given by: Hence, the classified distance can be described as follows, and the measurements are divided into two categories: hard NLOS measurements and soft ones.
Based on the aforementioned descriptions, the NLOS error classification algorithm based on FCM can be summarized as the pseudo code shown in Algorithm 3:

Kalman Filter
For LOS, KF is used to process LOS measurements. To explain the state more precisely, a state vector of the i-th beacon node is defined as: whered i (k) indicates the distance between the i-th beacon node and the mobile node and . d i (k) indicates the velocity thatd i (k) varies. The state equation of the i-th beacon node under NLOS can be denoted as follows: where F = 1 ∆t 0 1 , C = ∆t 2 /2 ∆t , ∆t denotes the sample period [26]. w i (k) is measurement noise and follows identically distributed Gaussian Distribution with variance σ 2 w . Hence, the predicted state and prediction covariance can be expressed as: The measurement residual is given by where Q indicates the covariance matrix of measurement errors. The Kalman gain is described as: The Kalman update equations can be expressed as: In the end, the algorithm pseudo code of KF can be expressed as Algorithm 4:

Unscented Kalman Filter
The main algorithm includes three procedures, namely, selection of sigma points, prediction and update [19]. To begin with, assume that the nonlinear system is: where W k and V k represents the Gaussian white noises in state variable X(k + 1) and measurement variable Z(k). The initial state vector can be denoted as X i , which indicates the initial distances of the i-th beacon node [20], and x i indicates the mathematical expectation of X i : For the hard NLOS case, the state can be expressed as ; for the soft NLOS case, the state can be expressed as , and the covariance of the i-th beacon node is defined as P i (k).
Step 1: Select sigma points. Assume that state vector is an n dimensional random variable, so the sample points (Sigma points) are 2n + 1, and the estimated sigma points X j i (k) can be described as: Step 2: Prediction. The system state equation is used to carry out the f (·) nonlinear transformation for each Sigma point, and the points set after transformation can be expressed as: where f (·) denotes bounded nonlinear state transfer function which is determined. Then one-step prediction state valueX i (k − 1) and covariance matrix P i (k) are given by: Weight coefficient ω can be given by: where η indicates turning parameters to control the spread of the sigma points.
A new Sigma points set can be produced according to a one-step prediction state value: Nonlinear transformation is performed to Sigma points set X i (k) by nonlinear observation equation: where h(·) denotes non-linear observation equation function. The system's predicted observation values Z i (k) are obtained by weighted sum: Step 3: Update. The covariance is updated by: The covariance matrix of system measurement output variables is given by: where R denotes the covariance of the observation noise. And the Kalman gain K i (k) is expressed as: The updated stateX i (k) and a posteriori covariance P i (k) are expressed as: The final NLOS measurements after filtering can be expressed as: whered h i (k) andd s i (k) denote hard NLOS measurements and soft ones after UKF filtering.

Combination and Location Estimation
Two sorts of estimated distances from KF and UKF can be obtained, respectively, and the final estimated distanced i (k) is updated as follows: A maximum likelihood localization method is utilized to estimate the mobile position according to the distance after filtering. The coordinate of the i-th beacon node can be expressed as At time k, the position of a mobile node isP(k) = (x(k),ŷ(k)). The relation between coordinates of the mobile node and the coordinate of the i-th of beacon node can be modeled as [27]: Finally, the simplified estimated coordinateP(k) of a mobile node at time k can be derived as:

Simulation Results
The purpose of simulation is to simulate a complicated environment by using different distributions and to conduct numerous experiments to obtain statistical results. The simulation results will be evaluated and shown in this section. Conventional IMM (without data fusion) [3], KF and UKF are compared with our algorithm. The simulation platform is MATLAB. Positions of beacon nodes applied with Monte Carlo in each run are randomly distributed in a square of 100 m × 100 m [25]. Propagation of NLOS errors between beacon nodes and the mobile node is randomly generated with probability ϕ, and every simulation is produced over 1000 times Monte Carlo runs. Root Mean Square Error (RMSE) is chosen to evaluate the performance of our algorithm, and RMSE is modeled as: where T n indicates the times of Monte Carlo runs and K denotes the observation number of mobile node, and here, we assume T n = 1000, K = 100. Table 2 represents the default parameters of NLOS errors obeying a Gaussian Distribution in the simulation. Figure 3 shows the localization results of a one-time run of TF-FCM, and that the number of beacon nodes is 5. It can be seen from the figure that TF-FCM achieves a fulfilling result even if the beacon nodes are randomly distributed in this area. Figure 4 displays the cumulative distribution function (CDF) of the localization error under the condition of 1000 times Monte Carlo runs, and the number of beacon nodes is five; from the figure, it can be seen that ninety percent of TF-FCM errors are less than 8.8 m; by contract, the errors of UKF, IMM and KF are 11.1 m, 11.2 m and 11.4 m, respectively. Most of the localization error of TF-FCM is much lower than UKF, IMM and KF, which indicates the high localization accuracy of TF-FCM.

The NLOS Errors Obey a Gaussian Distribution
To better describe the robustness and localization accuracy of TF-FCM as the number of beacon nodes changes, Figure 5 shows RMSE results with the number of beacon nodes varying from 5 to 10. It is obvious that TF-FCM has a better performance than KF, UKF and IMM with increasing numbers of beacon nodes. If the number of beacon nodes is five, the improvement of TF-FCM location accuracy compared with KF, UKF and IMM is 17.7%, 16.0% and 16.8%, respectively. In the figure, we can see that the KF and IMM have the same performance, and UKF performs better when the number of beacon nodes is low. However, when the number of beacon nodes is high, KF, IMM and UKF almost have the same localization accuracy.    To illustrate the robustness of TF-FCM as the NLOS errors get larger, Figures 6 and 7 display   To illustrate the robustness of TF-FCM as the NLOS errors get larger, Figures 6 and 7 display  (3)(4)(5)(6)(7)(8)(9)(10), the accuracy rate of TF-FCM improvement compared with IMM, UKF, KF is 19.9%, 18.3% and 21.2%, respectively. In Figures 6 and 7, we can see that as NLOS errors get larger, the RMSE of TF-FCM still stays much lower than other algorithms, which indicates the strong robustness of our algorithm.  respectively. In Figures 6 and 7, we can see that as NLOS errors get larger, the RMSE of TF-FCM still stays much lower than other algorithms, which indicates the strong robustness of our algorithm.   respectively. In Figures 6 and 7, we can see that as NLOS errors get larger, the RMSE of TF-FCM still stays much lower than other algorithms, which indicates the strong robustness of our algorithm.   To clearly denote the robustness as the probability of NLOS errors get larger, Figure 8 illustrates the RMSE result when the NLOS probability varies from 0.5 to 0.9. It can be clearly seen that when the NLOS probability is small, the IMM and KF is slightly better than UKF and TF-FCM, but with the probability of NLOS getting larger, the effect of TF-FCM is much better than KF and IMM. The result demonstrates that our algorithm is much better and has strong robustness when coping with the situation that contains many NLOS errors.  To clearly denote the robustness as the probability of NLOS errors get larger, Figure 8 illustrates the RMSE result when the NLOS probability varies from 0.5 to 0.9. It can be clearly seen that when the NLOS probability is small, the IMM and KF is slightly better than UKF and TF-FCM, but with the

The NLOS Errors Obey Uniform Distribution
The default parameters of NLOS errors obeying Uniform Distribution are shown as Table 3.  Figure 9 shows the cumulative distribution function of localization at 1000 times under Uniform Distribution obeyed U (3,8). When localization errors are small, four filters almost have the same filtering effect, but once the localization errors get larger, the performance of TF-FCM is better than the others, and it can be seen that the ninety percent of TF-FCM errors is less than 7.5 m; by contrast, the errors of UKF, IMM and KF are 9.8 m, 9.7 m and 9.7 m, respectively. probability of NLOS getting larger, the effect of TF-FCM is much better than KF and IMM. The result demonstrates that our algorithm is much better and has strong robustness when coping with the situation that contains many NLOS errors.

The NLOS Errors Obey Uniform Distribution
The default parameters of NLOS errors obeying Uniform Distribution are shown as Table 3.   Figure 9 shows the cumulative distribution function of localization at 1000 times under Uniform Distribution obeyed (3,8) U . When localization errors are small, four filters almost have the same filtering effect, but once the localization errors get larger, the performance of TF-FCM is better than the others, and it can be seen that the ninety percent of TF-FCM errors is less than 7.5 m; by contrast, the errors of UKF, IMM and KF are 9.8 m, 9.7 m and 9.7 m, respectively.  To better describe the robustness and localization accuracy of TF-FCM as the number of beacon nodes changes, Figure 10 shows the RMSE result with the beacon nodes varying from 5 to 10 under Uniform Distribution. It can be seen from the result that the four methods show a downward trend with the increase of the number of nodes, and the performance of TF-FCM is the best compared with other methods. The average RMSE errors of TF-FCM, UKF, IMM, KF are 4.13 m, 5.20 m, 5.31 m and 5.17 m, respectively.
To illustrate the robustness of TF-FCM as the NLOS errors get larger, Figure 11 shows the RMSE result with NLOS parameter U max varying from 4 to 10. It can be senn from the result that the trend of IMM, KF and UKF is on the rise as U max becomes larger. While the tendency of TF-

The NLOS Errors Obey Exponential Distribution
The default parameters obeying Exponential Distribution are displayed as Table 4.

The NLOS Errors Obey Exponential Distribution
The default parameters obeying Exponential Distribution are displayed as Table 4.

The NLOS Errors Obey Exponential Distribution
The default parameters obeying Exponential Distribution are displayed as Table 4.  Figure 12 shows that the cumulative distribution function of localization at 1000 times under Exponential Distribution when the number of beacon nodes is five. The result shows that ninety percent of TF-FCM errors are less than 6.1 m, while the errors of UKF, IMM, KF are 7.2 m, 11 m and 11.1 m, respectively. Most of the localization error of TF-FCM is much lower than UKF, IMM and KF, which indicates the high localization accuracy of TF-FCM. To illustrate the robustness of TF-FCM as the NLOS errors get larger, Figure 13 shows the RMSE result with the number of beacon nodes varying from 5 to 10. It can be clearly seen that the RMSE of TF-FCM is the smallest with the increase of the beacon node number. The overall trend declines as the number of beacon nodes increases, while the drop of TF-FCM is much slower than other algorithms, and the average RMSE of TF-FCM, UKF, IMM, KF is 3.94 m, 5.20 m, 5.23 m, and 5.31 m. Figure 13. The RMSE versus the number of beacon nodes.

Localization Results Analysis
In order to test the performance of TF-FCM in actual scenarios, an experiment is conducted under indoor conditions. The signal transmission between beacon nodes and mobile nodes is based on the carrier-less communication technology Ultra-Wideband (UWB) which uses a non-sinusoidal narrow pulse to transfer data. In recent years, UWB has been widely applied in close-range accurate indoor positioning. The principle of UWB ranging is two-way time-of-flight (TW-TOF) using a timestamp to approximate the distance between nodes, and the UWB device used in this paper is shown in Figure 14. To the left of the figure is the UWB node and to the right of the figure is the power supply of the node. To illustrate the robustness of TF-FCM as the NLOS errors get larger, Figure 13 shows the RMSE result with the number of beacon nodes varying from 5 to 10. It can be clearly seen that the RMSE of TF-FCM is the smallest with the increase of the beacon node number. The overall trend declines as the number of beacon nodes increases, while the drop of TF-FCM is much slower than other algorithms, and the average RMSE of TF-FCM, UKF, IMM, KF is 3.94 m, 5.20 m, 5.23 m, and 5.31 m. Figure 13. The RMSE versus the number of beacon nodes.

Localization Results Analysis
In order to test the performance of TF-FCM in actual scenarios, an experiment is conducted under indoor conditions. The signal transmission between beacon nodes and mobile nodes is based on the carrier-less communication technology Ultra-Wideband (UWB) which uses a non-sinusoidal narrow pulse to transfer data. In recent years, UWB has been widely applied in close-range accurate indoor positioning. The principle of UWB ranging is two-way time-of-flight (TW-TOF) using a timestamp to approximate the distance between nodes, and the UWB device used in this paper is shown in Figure 14. To the left of the figure is the UWB node and to the right of the figure is the power supply of the node.

Localization Results Analysis
In order to test the performance of TF-FCM in actual scenarios, an experiment is conducted under indoor conditions. The signal transmission between beacon nodes and mobile nodes is based on the carrier-less communication technology Ultra-Wideband (UWB) which uses a non-sinusoidal narrow pulse to transfer data. In recent years, UWB has been widely applied in close-range accurate indoor positioning. The principle of UWB ranging is two-way time-of-flight (TW-TOF) using a timestamp to approximate the distance between nodes, and the UWB device used in this paper is shown in Figure 14.
To the left of the figure is the UWB node and to the right of the figure is the power supply of the node. In order to avoid ground reflection, the beacon nodes and the mobile node are placed 1.2 m above the ground. As shown in Figure 15  The cumulative function of localization error under experimental conditions is displayed as Figure 16. From the figure, it is obvious that TF-FCM has the highest accuracy in comparison with other methods. The localization error of KF and IMM is more than 2 m; in contrast, the error of UKF is less than 1 m; especially, the error of TF-FCM is less than 0.5 m. The error over 90 percent of TF-FCM, UKF, IMM, KF is 0.23 m, 0.65 m, 2.43 m, 2.56 m, respectively. To better describe the localization accuracy of four algorithms, the comparison table of average localization error is shown as Table 5. From the experiment, it can be clearly seen that there is high precision and the strong robustness of TF-FCM. In order to avoid ground reflection, the beacon nodes and the mobile node are placed 1.2 m above the ground. As shown in Figure 15, eight beacon nodes are placed around the desks in a 5 m × 8 m room. The height of each desk is 1.3 m. The mobile node moves following the trajectory at a constant velocity. Every 40 cm, one sampling site is recorded and there are 31 sampling sites in our experiment shown as dotted lines in the figure. Twenty measurements are collected at the sampling site at one time, and the average distance of each sampling site is utilized by the localization algorithm. In order to avoid ground reflection, the beacon nodes and the mobile node are placed 1.2 m above the ground. As shown in Figure 15  The cumulative function of localization error under experimental conditions is displayed as Figure 16. From the figure, it is obvious that TF-FCM has the highest accuracy in comparison with other methods. The localization error of KF and IMM is more than 2 m; in contrast, the error of UKF is less than 1 m; especially, the error of TF-FCM is less than 0.5 m. The error over 90 percent of TF-FCM, UKF, IMM, KF is 0.23 m, 0.65 m, 2.43 m, 2.56 m, respectively. To better describe the localization accuracy of four algorithms, the comparison table of average localization error is shown as Table 5. From the experiment, it can be clearly seen that there is high precision and the strong robustness of TF-FCM. The cumulative function of localization error under experimental conditions is displayed as Figure 16. From the figure, it is obvious that TF-FCM has the highest accuracy in comparison with other methods. The localization error of KF and IMM is more than 2 m; in contrast, the error of UKF is less than 1 m; especially, the error of TF-FCM is less than 0.5 m. The error over 90 percent of TF-FCM, UKF, IMM, KF is 0.23 m, 0.65 m, 2.43 m, 2.56 m, respectively. To better describe the localization accuracy of four algorithms, the comparison table of average localization error is shown as Table 5. From the experiment, it can be clearly seen that there is high precision and the strong robustness of TF-FCM. Sensors 2019, 19, x FOR PEER REVIEW 22 of 24 Figure 16. The localization errors versus CDF.
In the simulation experiment, when the NLOS errors obey Gaussian, Uniform and Exponential Distributions, respectively, according to Figures 4,9,and 12, the proposed algorithm has the highest positioning accuracy compared with other methods. In the actual experiment, the localization error of TF-FCM is the lowest compared with other methods according to Figure 16.  Table 6 shows the running time of TF-FCM, UKF, KF and IMM. The four algorithms are performed using Matlab 2016a and tested on a Windows 10 home edition with AMD A10-8700P Randeon R6, 10 Compute Cores 4C + 6G 1.80 GHz 8.00 GB RAM.

Conclusions
In this paper, an algorithm based on triple-filter mixed KF and UKF, using residual analysis, voting and FCM is proposed, which is utilized to mitigate NLOS errors and enhance the accuracy of localization in mixed LOS and NLOS environments. Residual analysis is employed to identify if the propagation condition is NLOS or not. For LOS case, KF is adopted to process. For NLOS case, firstly NLOS correction algorithm based on voting is used to restrict the NLOS errors and correct the measurements. Then, the NLOS error classification method based on FCM is proposed to classify the NLOS errors into two categories: hard NLOS measurements and soft ones. The simulation result shows great advantage when processing the situation with complicated NLOS errors, including Gaussian distribution, exponential distribution and uniform distribution compared with IMM, UKF In the simulation experiment, when the NLOS errors obey Gaussian, Uniform and Exponential Distributions, respectively, according to Figures 4,9 and 12, the proposed algorithm has the highest positioning accuracy compared with other methods. In the actual experiment, the localization error of TF-FCM is the lowest compared with other methods according to Figure 16.  Table 6 shows the running time of TF-FCM, UKF, KF and IMM. The four algorithms are performed using Matlab 2016a and tested on a Windows 10 home edition with AMD A10-8700P Randeon R6, 10 Compute Cores 4C + 6G 1.80 GHz 8.00 GB RAM.

Conclusions
In this paper, an algorithm based on triple-filter mixed KF and UKF, using residual analysis, voting and FCM is proposed, which is utilized to mitigate NLOS errors and enhance the accuracy of localization in mixed LOS and NLOS environments. Residual analysis is employed to identify if the propagation condition is NLOS or not. For LOS case, KF is adopted to process. For NLOS case, firstly NLOS correction algorithm based on voting is used to restrict the NLOS errors and correct the measurements. Then, the NLOS error classification method based on FCM is proposed to classify the NLOS errors into two categories: hard NLOS measurements and soft ones. The simulation result shows great advantage when processing the situation with complicated NLOS errors, including Gaussian distribution, exponential distribution and uniform distribution compared with IMM, UKF and KF. The performance of TF-FCM has significantly improved in accuracy and robustness when dealing with rough wireless environments. Furthermore, TF-FCM could efficiently mitigate the NLOS effects compared with other classical methods. An experiment is conducted to verify our algorithm, and the result shows the high accuracy and strong robustness of TF-FCM.