#### Abstract

In the wireless sensor network (WSN) localization methods based on Received Signal Strength Indicator (RSSI), it is usually required to determine the parameters of the radio signal propagation model before estimating the distance between the anchor node and an unknown node with reference to their communication RSSI value. And finally we use a localization algorithm to estimate the location of the unknown node. However, this localization method, though high in localization accuracy, has weaknesses such as complex working procedure and poor system versatility. Concerning these defects, a self-adaptive WSN localization method based on least square is proposed, which uses the least square criterion to estimate the parameters of radio signal propagation model, which positively reduces the computation amount in the estimation process. The experimental results show that the proposed self-adaptive localization method outputs a high processing efficiency while satisfying the high localization accuracy requirement. Conclusively, the proposed method is of definite practical value.

#### 1. Introduction

Generally, two steps are needed for the wireless sensor networks (WSN) localization algorithm to estimate the location of an unknown node based on the Received Signal Strength Indicator (RSSI) [1]. Step is to try to determine the propagation parameters of the radio signal communication model with a fitting technique by measuring the mapping relation between RSSI and the distance . Step is to estimate the distance between the unknown node and each anchor node with reference to the communication RSSI value between them and obtain the estimated position value of the unknown node with reference to the coordinates of those anchor nodes. Therefore, this localization method requires a preliminary test for the environment [2] so as to determine the propagation parameters of the model. The lighted localization method Bounding-box (B-box for simplicity) [3] and its improved version [4–7], such as weighted B-box, 3-point centroid B-box, and 3-point weighted 3-point centroid B-box, were proposed to conduct localization of the unknown node.

However, the preliminary environmental test is a very complicated process that requires large amounts of experimental works. Besides, the preliminary test must be taken in a fixed localization environment. In case of any changes in the communication environment, the parameters in the radio signal propagation model would change along location information which plays an important role in location-based service application system, leading to error increment to the distance estimated upon RSSI value or the original model becoming not applicable any more. The factors affecting the environment usually include temperature, humidity, interference, and non-line-of-sight (NLOS) [8–10], which are subject to change along with the environment and time. Thus, the localization system that can keep high accuracy in a dynamic environment will be more promising. To satisfy this requirement, a maximum likelihood-based self-adaptive localization algorithm is proposed, which does not require a preliminary test for the environment in a dynamic environment but needs considerable computation amount. A distributed self-adaptive localization algorithm is proposed in the reference document [4], which, however, only investigates the localization issue when the communications range is fixed and poor in versatility. Hu and Evans proposed a Monte Carlo localization (MCL) method for mobile sensor node, and its computational time complexity is , where is the number of Monte Carlo sample points, is the number of localization points, and is the number of anchor nodes [11]. Min et al. proposed an improved version of MCL, which is called Monte Carlo localization algorithm based on anchor node selection (MCLAS) [12], and the computational time complexity is also . To locate the mobile node, Shan et al. proposed self-adaptive localization algorithm based on Monte Carlo and gray prediction model (GPLA); however, the complexity is high [13]. For the pose-tracking problem in a dynamic and highly occluded environment, literature [14] proposed a self-adaptive tracking algorithm for mobile robots. And maximum likelihood-based self-adaptive localization algorithm is proposed for dynamic localization, of which complexity is , where is the number of anchor nodes,* n* is the number of iterations, and* m* is the number of localization points.

In consideration of this, an analysis was given to the working process of self-adaptive localization algorithm. It was found that the propagation parameters in the radio signal propagation model became linear after the model was taken from the logarithm, and the computational amount could be reduced significantly using the least square method. Hence, this paper proposes the least square-based self-adaptive WSN localization method.

#### 2. A Least Square-Based Self-Adaptive Localization Method

In this section, the system flow of the least square-based self-adaptive localization method is presented before every part is elaborated.

##### 2.1. System Flow of Least Square-Based Self-Adaptive Localization Method

In the proposed self-adaptive localization algorithm, initialization is given firstly, including parameter initialization and representation of RSSI in probability density, before self-adaptive localization is performed iteratively. It is divided into two steps. The first step is to estimate the location of the unknown node and the second step is to estimate the parameter in the propagation model. Graphically, the workflow of the proposed least square-based self-adaptive localization method is illustrated in Figure 1.

The parameter initialization in Figure 1 mainly concerns the parameters of radio signal propagation models and . Their values are arbitrary, but the convergence rate of the self-adaptive localization algorithm would be affected if their initial values are inappropriate. After the coordinates of the unknown node are estimated with the maximum likelihood estimation method, the parameters in the radio signal propagation model, and , are estimated using the least square method. And then, these two parameters are evaluated if they converge to thresholds and , respectively. If yes, the iteration will stop and output the estimation result; otherwise, the iteration will go on until the condition of convergence is satisfied.

##### 2.2. Representation of RSSI in Probability Density

In the traditional RSSI-based localization method, a path loss model is established for mapping between RSSI and distance , as expressed by the following equation [2–4, 9]: where RSSI(*d*) represents the signal strength at the anchor node received from the localization node; RSSI() represents the signal strength at the anchor node received from the reference node; represents the distance between the reference node and the anchor node;* d* represents the distance between the unknown node and the anchor node; and represents the channel attenuation index; its typical value is 2~4.

Make a transformation to (1) in the following way, that is, to convert RSSI(*d*) from dBm units into miliwat units. By dividing both ends of (1) with 10 and performing exponent arithmetic to both sides with base 10, we obtain

Now, the mean received signal strength at the distance may be expressed as a radio signal propagation model as follows [2]: where , , and ; and are parameters of the radio signal propagation model; specifically, represents a constant in proportion to the received signal strength in a certain distance (typically 1 meter) and represents the attenuation factor of path loss.

If the communication distance and the parameters of the radio signal propagation model and are assigned, the following conditional probability density function can be established on the basis of Rayleigh distribution [2]: where , , and represents the serial number of received signal strength; represents the serial number of anchor node;* N* represents the receiving times for the overall signal strength, and represents the total number of anchor nodes. The conditional probability density function represents the probability under the condition of distance , radio propagation parameters and , and received signal strength , where represents the distance between the unknown node and the* j*th anchor node at the coordinates of in addition to and .

And then, it is required to work out the joint probability corresponding to the total signal strength at the unknown node receiving from anchor nodes. Let us assume that are independent from each other; then the resulting joint conditional probability density function can be expressed as follows [2]:

If every unknown node is estimated separately, then different nodes might give different and values. This practice is considered unreasonable, for all these nodes are in the same environment. However, the real environment is dynamic at any time rather than the above-mentioned case, and every node on the localization platform has its distinct hardware features. In other words, every node is different from any of the others, which require separate estimation to the location information of every unknown node. Therefore, this paper will try to provide a separate solution to every unknown node.

If the joint probability density is expressed with likelihood function , then the log likelihood function can be expressed as . The maximum value of the log likelihood function may be obtained by means of alternating solution in two steps. Each step is a separate solution process for the maximum value.

##### 2.3. Location Estimation of an Unknown Node

When the log likelihood function is solved for the maximum value, it is possible to work out the values of and . More specifically, we calculate the partial derivatives of and separately and reset them to zero; we will have the values of and* Y*, where represents the iteration times. This probability density function does not assume any value to parameters and ; thus, the initial values for and in the first iteration are arbitrary [3].

We work out (6) separately to get the estimated horizontal and longitudinal coordinates of the node: and .

##### 2.4. Least Square-Based Estimation for Parameters of Radio Propagation Model

To obtain the values of and in a log normal model with least square method, it is equivalent to minimizing the sum of square [8]; that is,where error is defined as follows: where the relation between and as well as that between and can be expressed as Thereby, a linear relation is obtained between and .

With least square optimization criterion, we can obtain the optimal solution shown as (11), which minimized the value of .

The calculated values of and will be used for next iteration, where in dBm must be converted to the equal in dB; we have .

Where the least square optimization criterion is different from maximum likelihood criterion, as in maximum likelihood criterion, the th equation will be subtracted by the first () equation, with the promise that the error in th equation is very small, which cannot be guaranteed in real localization environment.

##### 2.5. Computational Complexity Analysis

Computational complexity is an average measurement of calculated quantity of processing method via pseudocode. And from analysis, the computational complexity of least square-based self-adaptive localization method is , which is the same as that of maximum likelihood-based self-adaptive localization algorithm, where is the number of anchor nodes,* n* is the times of iteration, and* m* is the number of localization points.

If we equate* M* (the number of sample points) to* n *(the number of iterations), which are in Monte Carlo-based localization method and self-adaptive localization method, respectively, the computational complexity of these two localization methods is the same.

#### 3. Performance Evaluation

In this section, the performance of the least square-based WSN self-adaptive localization algorithm will be evaluated and analyzed in comparison with that of the maximum likelihood-based self-adaptive localization algorithm [2].

##### 3.1. Experimental Settings and Evaluating Indicators

###### 3.1.1. Experimental Settings

The simulation environment is a 3.2 m × 3.2 m area, where 4 anchor nodes are positioned at the four vertexes and unknown nodes move horizontally and vertically at intervals of 0.8 m to establish a total of 25 fixed points, as shown in Figure 2. Since the unknown nodes match with the anchor nodes at the four vertexes, the unknown nodes at the vertexes are separately moved by 0.1 m inwards both in direction and in direction. The unknown nodes and the anchor nodes at an arbitrary fixed point within the area are mutually through. In the simulation, the distance carries Gaussian noise datum . Use a log normal propagation model to convert into the arithmetic for RSSI value.

The computation platform used in the process of evaluation is parameterized as follows: CPU, i7 [email protected] GHz, RAM, 4 GB, operating system, Windows XP Professional SP3, and evaluation software, Matlab 7.5.

###### 3.1.2. Evaluating Indicators

Use the at every fixed point to evaluate the performance of the localization algorithm [4–7], as expressed in the following equation: where represents the estimated coordinates of the unknown node and represents the real anchor nodes of the same unknown node. A smaller value implies less localization error and higher localization accuracy.

###### 3.1.3. Experiment Design

Firstly, the proposed self-adaptive localization algorithm will be evaluated in terms of localization accuracy and convergence, and a performance analysis will be given to the proposed algorithm in comparison with other algorithms; finally, different self-adaptive localization algorithms will be compared in terms of processing time.

##### 3.2. Analysis of Location Accuracy

###### 3.2.1. Accuracy Comparison with Maximum Likelihood-Based Self-Adaptive Method

Use both the maximum likelihood-based self-adaptive localization algorithm [2] and the proposed least square-based self-adaptive localization algorithm to locate in the above-mentioned environment. Set the initial values for = −40 dB and . The threshold values for and are 1 × 10^{−3} and 1 × 10^{−3}, respectively. The iteration times are set to 10, 20, 30, 200, and 1000, respectively, and the distribution model of the background white noise is set to variance and . Then, the mean localization errors for those two algorithms are tabularized in Tables 1 and 2 separately.

As shown in Tables 1 and 2, the least square-based self-adaptive localization method outputs lower localization error than the maximum likelihood-based self-adaptive localization method.

After iterating 1000 times with the maximum likelihood-based self-adaptive localization method, the localization errors at all the fixed points are shown in Figures 3(a) and 4(a); under the same conditions using the least square-based self-adaptive localization method, the localization errors at all the fixed points are shown in Figures 3(b) and 4(b).

**(a) Maximum likelihood-based self-adaptive localization**

**(b) Least square-based self-adaptive localization**

**(a) Maximum likelihood-based self-adaptive localization**

**(b) Least square-based self-adaptive localization**

As shown in Figures 3 and 4, the least square-based self-adaptive localization method provides less localization error than the maximum likelihood-based self-adaptive localization method. Conclusively, the least square-based self-adaptive localization method behaves higher localization performance.

###### 3.2.2. Accuracy Comparison with Monte Carlo-Based Localization Methods

Table 3 shows the localization accuracy of different Monte Carlo-based localization methods, including MCL [4], MCLS [5], and GPLA [6], where the number of nodes takes the value of 25, the number of anchor nodes takes value of 4, and the number of sample points takes value of 10, 20, 30, 200, and 1000, respectively. We also show the location accuracy of our proposed least square-based self-adaptive method in Table 3, where variance *σ* takes the value of 0.2.

Table 3 illustrates that the localization accuracy of Monte Carlo-based localization methods is lower than that of the proposed least square self-adaptive localization method in this paper. That is mainly owing to the least square optimization criterion, which makes localization estimation value closer to the real value.

###### 3.2.3. Accuracy Comparison with Bound-Box-Based Localization Methods

To further evaluate the performance of the least square-based self-adaptive localization method, a comparison was given in terms of localization error after 1000 iteration times between the least square-based self-adaptive localization method and the original and modified Bound-box localization algorithms [4–7], as shown in Table 4.

In Bounding-box (B-box for simplicity), the centroid of the overlap region among different communication ranges is treated as location estimation value. Considering different contributions of each distance estimation value, the weighted Bounding-box was proposed to improve the location accuracy, where the weighted values are the reciprocal of distance estimation values. In the 3-point centroid Bounding-box method, three anchor nodes are selected from four anchor nodes, and we get four groups of anchor nodes and their corresponding location estimation values; then we treat the mean of the four location estimation values as the final location estimation result. And the 3-point weighted centroid Bound-box is the weighted improved version of 3-point centroid Bound-box, where the weighted value is the reciprocal of the sum of the values of three distances in each group.

As shown in Table 4, the localization performance, expressed with two variances, using the self-adaptive localization algorithm after 1000 iteration times is comparative to that using the original or modified Bounding-box localization methods. It turns out that, compared with the localization algorithms that require preliminary environment test, the proposed self-adaptive localization algorithm does not require preliminary environment test for radio propagation parameters, while the localization accuracy is close to the original and modified Bounding-box localization methods, though the processing time is longer.

##### 3.3. Analysis of Location Error Convergency

Location error convergence is the property that location errors of different iteration stages have the same tendency to the zero end state; that is, with the increment of iteration number, the value of location error gets smaller and smaller. We conducted an analysis of location error convergence to evaluate the convergence speed of different location methods.

After iterating 1000 times with the maximum likelihood-based self-adaptive localization method, the convergence results of localization errors at the 25 fixed points within the localization area are shown in Tables 5 and 6; with the same conditions, the localization errors convergence graphs of least square-based self-adaptive localization method are shown in Tables 5 and 6.

As shown in Tables 5 and 6, the least square-based self-adaptive localization method provides a higher convergence rate of localization error in comparison with the maximum likelihood-based self-adaptive localization method. Specifically, about 84% of unknown nodes completed their convergence within 1000 iteration times using the former method, while only about 52% of unknown nodes completed their convergence within 1000 iteration times using the latter method. Comparatively, the proposed least square-based self-adaptive localization method is able to work at a higher convergence rate.

##### 3.4. Analysis of Location Processing Time

As the computational complexity of Monte Carlo-based localization method and self-adaptive localization method is the same, we analyze more detail; that is, we compare the processing times.

###### 3.4.1. Processing Time Comparison with Maximum Likelihood-Based Self-Adaptive Method

Tables 7 and 8 show the processing time of localization errors separately using the maximum likelihood-based self-adaptive localization method and the least square-based self-adaptive localization method at the iteration times of 10, 20, 30, 200, and 1000, with different variances of background noise.

As shown in Tables 7 and 8, at the same iteration times, the processing time using the maximum likelihood-based self-adaptive localization algorithm is about 4 times longer than that using the least square-based self-adaptive localization method. Conclusively, the least square-based self-adaptive localization method can provide a higher computational efficiency, for the least square technique reduces the computational amount in the radio parameter estimation process.

###### 3.4.2. Processing Time Comparison with Monte Carlo-Based Methods

Table 9 shows the localization processing time of different Monte Carlo-based localization methods, including MCL [4], MCLS [5], GPLA [6], and our proposed least square-based self-adaptive method, where the number of nodes takes the value of 25, the number of anchor nodes takes value of 4, and the number of sample points takes value of 10, 20, 30, 200, and 1000, respectively.

Table 9 illustrates that when the number of sample points is small, that is, it is less than 1000, localization processing time of Monte Carlo-based method is lower than that of the least square-based self-adaptive method. However, when the number of sample points is large, localization processing time of Monte Carlo-based method is bigger than that of the least square-based self-adaptive method. That is because least square-based self-adaptive method has ability on error convergence, while the number of iterations has to be set in advance in Monte Carlo-based method.

To sum up, the simulation results show that the proposed least square-based self-adaptive localization algorithm has definite advantages over the maximum likelihood-based self-adaptive localization algorithm in terms of both localization accuracy and localization processing time. Considering the fact that the nodes in a wireless sensor network are still, the environment changes relatively slowly and the signal attenuation parameter varies slowly with time in the communication environment; it is believed that the proposed least square-based self-adaptive localization method is capable of satisfying the typical dynamic localization requirement.

#### 4. Conclusion

The traditional WSN localization method requires a preliminary environmental test to determine the radio signal propagation parameters, leading to a complex localization process, highly experimental workload, and poor environment adaptability. In view of these weaknesses, this paper proposes a least square-based WSN self-adaptive localization method. Using least square technique and iteration strategy to estimate the radio parameters, this method not only reduces the computational amount in the localization process but also improves the localization accuracy. It provides methodological and technical means for the dynamic localization applications.

It is requisite for a self-adaptive localization method to be finally applied into an actual WSN localization system. For this reason, the proposed localization method is going to be demonstrated and evaluated in the true WSN localization environment.

#### Competing Interests

The authors declare that they have no competing interests.

#### Acknowledgments

This work is funded by National Natural Science Foundation of China (61601142 and 61671174), space support technology fund projects (2014-HT-HGD5), Natural Science Foundation of Shandong Province of China (ZR2015FM027), State Key Laboratory of Geo-information Engineering (no. SKLGIE2014-M-2-4), State Key Laboratory of Satellite Navigation System and Equipment Technology, Guangxi Key Laboratory of Automatic Detecting Technology and Instruments (YQ14205 and YQ15203), and Natural Scientific Research Innovation Foundation in Harbin Institute of Technology (HIT.NSRIF.201721).