Modified Least Squares Algorithm for Three-Dimensional Target Location Based on Wireless Communication Base Stations

*e observed values of time of arrival (TOA) for the radio signals between the target and the wireless communication base stations are mainly affected by signal non-line-of-sight (NLOS) propagation in target location. TOA with NLOS makes a lot of signal noises and propagation delays, that is, location errors. For the first time, this paper focuses on the problem of modifying the Z-axis location coordinates in three-dimensional (3D) target location. A novel algorithm is proposed by establishing the modified least squares 3D location model for the accurate target location. Meanwhile, an optimal base station selection strategy is proposed by using the spectral clustering algorithm, which is based on the spatial distribution of the base stations. Compared with the existing algorithms, the proposed algorithm in this paper has better performance on the accurate target 3D location in real scenes, which has a high value of practical application.*e simulations illustrate that the location error of the proposed algorithm is smaller than those of other existing algorithms based on the same simulation data and conditions.


Introduction
3D location of the target is an important technology along with the rapid development of wireless communication technology in the era of big data [1], which is developed in the study of accurate 3D location of the target under NLOS recently. 3D location technology has been widely applied to many fields such as Google Maps, GPS, and other guided systems. For example, the doctor can use location technology to track the ultrasound to investigate the effects of geographical location of the target different positions on the location of the internal jugular vein [2]. e above location systems are stipulated in the analysis of geographical location of the target based on wireless communication base stations.
e main method of this technology is that the geographical location of the target is treated as the research goal in the network, and then some mathematical indexes such as line of sight (LOS), NLOS, TOA, time difference of arrival (TDOA), and angle of arrival (AOA) are used for target location based on wireless communication base stations. Finally, the network gets the 3D coordinates of the target by calculating the actual distances and the estimated distances between the wireless communication base stations and the target. In the past decades, lots of researchers had been devoted to 3D location technology and many interesting results were obtained. e difficulties of target location lie in how to get accurate 3D location of the target in unstable and unreliable external network environment and how to improve the robustness of locating. ere are many reasons for 3D localization errors of the target [1][2][3][4][5][6][7][8].

Received Signal Interference Ratio by the Base Station.
e signal strength reflects the specific source and approximate location of the target. e received signal interference ratio generally needs to be considered because it is interfered by the information from other channels.

Multipath Propagation.
In the multipath propagation of signals, the same signal received by the base station may have time and space delay, which reduces the accuracy of the 3D location. erefore, how to avoid the delays in the multipath propagation of signals and achieve effective recovery of the multipath transmitted signals is one of the key technologies to the accurate target location.

NLOS Propagation.
NLOS propagation leads to signal deviation, time, and space delay, which affects the real-time transmission of signals. Due to the complexity of the physical medium of the intermediate obstacles, it is difficult for base stations to analyze the received signals.

Number of Base Stations.
e number of base stations is a relatively important factor which will lead to localization error. How to select the optimal number of base stations is a research hotspot, because the optimal number of base stations can ensure accurate location of the target and reduce the cost of hardware.

Location of Base Station.
e location of base station is also an important factor which affects the localization accuracy of the target. e reasonable setting of base station location can reduce the localization errors caused by NLOS.

Design of Location Algorithm.
e unreasonable localization algorithm is easy to cause the localization errors. e designed location algorithm cannot achieve accurate location of the target due to the change of external environment in the process of the actual location. erefore, it is very important to establish a dynamic system for localization algorithm, so that we can effectively achieve intelligent location of the target.
Motivated by the aforementioned observation, we explore the Z-axis accuracy 3D location problem and propose a modified least squares algorithm of target 3D location in this paper. Main contributions are summarized as follows.
(i) is work for the first time introduces a method to correct the Z-axis location coordinate value of 3D location. Compared with the existing works, our 3D location model has better performance in location accuracy. (ii) An innovative approach is established to the modified least squares of target 3D location model for the Z-axis coordinate and the minimum wireless communication base station selection algorithm. e rest of this paper is organized as follows. Section 2 introduces the related work. Section 3 gives the main algorithm of 3D location. In Section 4, we have a discussion on the base station selection strategy to get the minimum number of wireless communication base stations for 3D location. In Section 5, the experimental results are presented and discussed. Finally, the paper is concluded in Section 6.

Related Work
According to classical target location algorithms, the existing target location works can be classified into locating based on ultra-wideband radios [2,3] and wireless signal communications [4,5] in the present stages. e wireless communication 3D location technology achieves great progress and has been used in many application fields. Chen et al. [6] have proposed a new 3D target localization method that uses iterative maximum weighted likelihood estimation and takes into account the spatial distribution of pseudotargets. e wireless location also has a big application in Internet of ings (IoT) [9][10][11][12]. Localization algorithms are also widely used in some practical target tracking applications. Jondhale et al. [13] have proposed a range-free generalized regression neural network localization algorithm as an alternative to the traditional range-based trilateration technique for a largescale wheat farmland. ey also present the modified Optimal Fitted Parametric Exponential Decay Model-(OFPEDM-) based signal path loss model to deal with the issue of environmental dynamicity. e result demonstrates superior localization performance (localization accuracy of the order of few centimeters over traditional trilateration irrespective of nonlinear system dynamics, path loss model, and environmental dynamicity. Oded et al. [14] have proposed the location estimation of a target node in a multipath environment based on one-way transmission of OFDM signals from unsynchronized base stations. Direct 3D location estimation in dense multipath [15,16] has a high location accuracy. Pablo and Dehghan [17] have proposed the tree topology and radial distance constraint models, which can be applied to complex wireless and wired network communications, warehouse facility location, electrical power systems, water supply networks, and transportation networks, just to name a few. TOA/TDOA's localization in IEEE 802.11 is increasingly sophisticated [18]. Jondhale et al. [19] have proposed a modified Kalman filtering framework based real-time target tracking against environmental dynamicity in wireless sensor networks. e results confirm that the proposed algorithms achieve better tracking accuracy and real-time performance, irrespective of environmental dynamicity, compared with the traditional RSSI (Received Signal Strength Indication) based algorithm. Jondhale et al. [20] use generalized regression neural networks to achieve Kalman filtering framework based real-time target tracking in wireless sensor networks. e proposed algorithms demonstrate superior tracking performance (tracking accuracy in the scale of few centimeters) irrespective of nonlinear system dynamics as well as environmental dynamicity. Jondhale et al. [21] proposed an application of generalized regression neural network as an alternative to these traditional techniques to obtain first location estimates of moving person using a hybrid network of PSOC BLE nodes and smart phone, which are further refined using Kalman filtering framework.
Mixed model based on mathematics plays a significant role in indoor and outdoor 3D location [22][23][24]. Brena et al. [25] have summarized the indoor location technologies and mentioned a lot of 3D techniques. However, as far as we know, the location technology for Z-axis coordinate information has not been addressed at the present stage. At least the accuracy has to be improved. ree-side measurement location [7,8] is one of the most basic target location methods, and it can achieve accurate localization in complex environments. To overcome the disjunction between received signal strength and distance estimates, Raguraman et al. [26] have proposed the algorithms that include preprocessing factors for manipulating received signal strength to follow a sphere-based deployment region for deployment of particles. Kumar et al. [27] considered the edge weights between each target node and neighboring anchor nodes to compute the location of the target node, which can overcome the nonlinearity between received signal strength and distance.
e Z-axis coordinate of the target plays a significant role in 3D location, which exists in wireless communication location system widely. On one hand, Z-axis coordinate can cause a big impact on target accurate location, especially in some complex external environments, such as city, ocean, and sky. Z-axis information is easy to be ignored, because the Z-axis coordinate differs from those of X-axis and Y-axis by two levels of magnitudes, which results in the imbalance of data value. On the other hand, the intermediary of the signal transmission is complex in the practical application scenes. For example, TOA, AOA, LOS, TDOA, and NLOS are affected by many factors. To establish the 3D location model based on wireless communication base stations, other influencing factors such as multipath propagation and different mobile electronic devices also should be considered comprehensively [16,24,25]. At the same time, the fusion of various measurement data can improve the noise resistance and location accuracy effectively. Due to the movement of target terminal equipment, the observed distance error model can be improved into a dynamic error correction model. e difficulty of the Z-axis location coordinates (TOA caused by NLOS in this paper) has caused great confusion among researchers. erefore, this is an interesting and challenging problem for us to study and research.

Analysis of Modified Observation Distance.
In this section, the detailed design ideas of our model will be discussed. By analyzing the functional relationship between the observation distance calculated by TOA and the actual distance with the estimated coordinates between the base station and target, the observation distance modification algorithm model can be established. Since the scenes of the obtained measurement data are different in the specific implementation steps of the algorithm, the parameters of the modified model need to be improved. erefore, the Z-axis coordinate data should be weighted; that is because the optimal parameters can be obtained by solving the optimization equation. To determine the weight value, the heuristic search algorithm is used to obtain the optimal parameter values. e TOA value between the target i and the base station j is noted as t ij ; the velocity of light is c � 3 × 10 8 m/s. e real coordinate of the target i is (x i , y i , z i ), and the coordinate of the base station j is (x j , y j , z j ). e observed distance is S ij and the real distance calculated by coordinates is S ij ′ . e computational formula is shown as follows: We use the regression analysis to analyze the observed distance and the real distance and construct a linear relationship of them. erefore, the relationship between the observation distances, which are calculated by TOA from the target to the base stations, and the real distances can be established as follows: where k is the modified correction factor.

Modified Least Squares
Algorithm. e principle of the three-side measurement location method is to calculate the distances between multiple base stations and the target, so as to determine the location coordinate of the target. It is shown in Figure 1 that, for a two-dimensional (2D) location system, the coordinates of an undetermined target can be determined by using three or more communication base stations. Similar to the three-side measurement method, in a 3D location system, the coordinates of an undetermined target to be determined by the distances need at least 4 base station nodes. e location diagram is shown in Figure 2.
In practical applications, the least squares algorithm is adopted to process the data firstly in order to reduce the influence of measurement error. e main method of least squares algorithm is to minimize the mean square error of the established function with the real value.

e Original Least Squares Algorithm.
e 3D coordinates of the base stations are represented as . . , N, and the coordinate of the observed target is M � (x, y, z). en the least square estimation of the 3D coordinates of the target is (x, y, z) � arg min

Complexity 3
where d i � ct i , c � 3 * 108 m/s, t i is the TOA value between target M and communication base station B i , i � 1, 2, · · · , N, and i represents the ID number of base stations.

Modified Observation Distance.
We can get the modified distance between the target and wireless communication base station d * i based on formula (2), which is shown as follows:

Amplification of Z-Axis Coordinate.
Expand the distance term in formula (3) as follows: e above term containing z i is easy to be ignored because z i is much smaller compared with x i , y i . It easily leads to the loss of the Z-axis coordinate information of the base station, resulting in a big error of the Z-axis coordinate

Modified Least Squares
Algorithm. e modified least square estimation of the 3D coordinates is obtained by modifying the original least squares algorithm as follows: We can solve the above equation and obtain where A ′ � 2 while Calculate the real distances between the target and the base stations. Both of the real distances and the mean square error of the corrected observation distances are less than the set threshold step 1 Update the error coefficient k by a certain step size, and modify the observation distances step 2 Calculate the target coordinates by using the modified observations end while Obtain the optimal error coefficient k Fix the coefficient k, and optimize the weights W 1 , W 2 : while Calculate the real distances between the target and the base stations. Both of the real distances and the mean square error of the corrected observation distances are less than the set threshold step 1 Update W 1 , W 2 by a certain step size step 2 Get the target coordinates after using the weighted least squares method end while Obtain the optimal weights W 1 , W 2 Calculate the target coordinates by the final optimized error coefficient k and weights W 1 , W 2 Output: e 3D coordinates (x * , y * , z * ) of the target ALGORITHM 1: Modified least squares algorithm for the 3D target location.

Complexity 5
and W 2 and fix them, change the error function coefficient k, and calculate the errors between the target and base stations. Secondly, we calculate all target square errors and obtain the mean square error by using iterative algorithm. e coefficient k under the minimum mean square error is the optimal coefficient. Finally, we fix the optimal coefficient k and change the weights W 1 and W 2 by a certain step size.
erefore, the optimal weights W 1 and W 2 are obtained if the error is less than the set threshold.

e Flow Chart of the Proposed Algorithm.
e flow chart of the proposed algorithm is shown in Figure 3. e beginning of realizing the 3D target location is to read the base 6 Complexity station location information and the target TOA data firstly. en modify the model according to modified least squares algorithm for the 3D target location, which is shown as Algorithm 1. e proposed algorithm is mainly to modify the Z-axis coordinates and eventually use the minimum mean square error to determine the weight parameters of the algorithm.

Analysis of Minimum Base Station Location
Selection Strategy e base stations in the network have strong spatial similarity when they are close to each other. It means that these base stations are in all probability under the same influence conditions in the real scenes, and their contributions to the target location are redundant. Considering the above problems, adjacent base stations are assigned to one same cluster firstly. erefore, we can select the optimal base station in each cluster, which can provide as much information as possible for target location. Subsequently, this model reduces the computational complexity and the load balance of the base stations. e base stations with different types are often located far apart from each other, and this will lead to big errors, which are caused by signals refraction and reflection during the signal transmission from the target to the base stations in the real scenes.

Spectral Clustering of the Spatial Locations of Base
Stations. For the sparsity of space, the base stations are clustered into different clusters firstly based on spatial location. e spatial location distributions of the base stations are comprehensively considered in this paper.
erefore, a few representative base stations are selected from each cluster after spectral clustering of the spatial base stations.
Assume that the spatial coordinates of the base stations are known. erefore, we can determine the useful base stations around the target. e TOA values have data redundancy when the distances among the base station nodes are close. e spatial location spectrum clustering of base station nodes can be carried out firstly.

e Selection Strategy of the Minimum Number of Location Base Stations.
Firstly, the coordinate data of the base stations are clustered by method of spectral clustering and the number of clusters is represented as m.
e corresponding m is the optimal number of base station classification when the change slope of mean square error tends to be stable. en we find the optimal base stations in each cluster. e selection of the optimal base stations is actually to search for the closest base station node to the target in each cluster. e specific operation is introduced as follows. Firstly, we find the base stations that are closest to the target in each cluster as the initial optimal base stations according to the TOA. e TOA of these base stations are used to calculate the 3D coordinates of the target after obtaining m initial optimal base stations. Calculate the errors by all base stations between the observation distances and real distances after the coordinates of the target are obtained. If the selected base stations do not have the minimum error, reset the base stations with the minimum error as the ideal base stations. Fix the ideal base stations and then recalculate the target coordinates until the errors of the selected base stations are the smallest. en, the optimal base station is obtained in the current cluster. Repeat the above steps to select the optimal base station in each cluster by using the iterative optimization algorithm until the final optimal base station is selected in each cluster. e 3D coordinates of all targets obtained from these optimal base stations need to be measured accurately. e error is shown as follows.
where (x i , y i , z i ) and (x i ′ , y i ′ , z i ′ ) represent the calculated coordinate and the reference coordinate of the target i, respectively; error i is the error between calculated coordinate and reference coordinate of the target i; error is the mean error for all targets; n is the number of errors.
Increase the cluster number and repeat the above steps to find the optimal base stations under different cluster number and calculate the mean square error of the targets' coordinates. e minimum number m of base stations is needed to achieve accurate location when the change slope of the mean square error tends to be stable. e flow chart of the minimum base station location selection strategy is shown in Figure 4.

Experimental Work and Discussion
In this section, we conduct a series of experiments with our work. e simulation parameters are shown in Table 1.
Two sets of TOA measurements test data and 3D coordinates from the target to the base station, which are given in LOS or NLOS propagation environment, are shown as Test data 1 and Test data 2 (all the test data come from the China postgraduate mathematical contest in modeling). To verify the effectiveness of the proposed algorithm, we do the 3D location target experiment under Test data 1 and Test data 2. e experimental environment is Windows 7 64-bit system, MATLAB 2012a software, i7-4720HQ CPU, and 8 Gb memory. Tables 2 and 3 show the target 3D location results between the estimated coordinates and the actual coordinates of our model under Test data 1 and Test data 2. According to the fact that the change slope of mean square error tends to be stable, we find the minimum number m of location base stations is 7. It can be seen from Tables 2 and 3 that the estimated coordinates calculated by our model are consistent with the real coordinates. Figures 5 and 6 show the 3D location MATLAB simulation results under 2 sets of Test data, respectively. It can be seen from Tables 2 and 3 and Complexity Figures 5 and 6 that the X-axis and Y-axis coordinates of most targets estimated by our model correspond to their real coordinates. is is because our model optimizes the coefficients and weights to eliminate the influence of observation data errors on the Z-axis in different scenes. e simulation results show that the mean square error of the Xaxis and Y-axis is 0.3 m, and the error of the Z-axis is 0.5 m.
ese results reflect that the proposed modified least squares algorithm has a very high location accuracy in 3D target location.      Figure 7 shows the mean square error of locations of different algorithms in same experiment and test data. Table 4 gives the mean localization error rate of Z-axis of different algorithms. It can be seen from Figure 7 that the mean location errors of this paper are the smallest. is is because the algorithm proposed in this paper modifies the errors of Z-axis and the measured distance, respectively, which is shown in Table 4. erefore, the noise effect of measured distance is smaller than those of [7,8] and the location of Z-axis can reach the accuracy level of X-axis and Y-axis. At the same time, the parameters are modified repeatedly by the minimum mean error in the parameter selection stage of the proposed algorithm, so that the overall distance error is smaller and the location accuracy is higher.

Conclusion
is paper extended the 3D target location technology based on wireless communication networks. Considering that the TOA of radio signals is mainly affected by NLOS and other factors, our algorithm can achieve the accurate 3D locating results of the target. e main innovation of this paper is the establishment of the modified least squares algorithm for target 3D location, especially for the Z-axis location coordinates.
For the reason of technical difficulty, we just consider the case of NLOS influence on the communication signals in this paper. However, the target location environment is complex in real application scenes, and the wireless signal propagation from the target to the base stations will be affected by many factors. To improve the signals noise resistance and achieve target location accuracy, future works shall include the fusion of various measurement data, effective combination of other location techniques, and the error model of observed TOA value.

Data Availability
e simulation data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest related to this work.