An Adaptive Calibration Algorithm Based on RSSI and LDPLM for Indoor Ranging and Positioning

The positioning algorithm based on received signal strength indication (RSSI) and the logarithmic distance path loss model (LDPLM) is widely used in indoor positioning scenarios due to its convenient detection and low costs. However, the classic LDPLM with fixed coefficients and fixed error estimation usually reduces the ranging accuracy, but it is rarely studied in previous literature. This study proposes an adaptive calibration ranging algorithm based on LDPLM, which consists of two parts: coefficient adaptive algorithm and error correction algorithm. The coefficient adaptive algorithm is derived by utilizing the error theory and the least squares method. The error correction algorithm is defined as the linear regression equation, in which coefficients are determined by the least squares method. In addition, to reduce the influence of RSSI’s fluctuation on ranging accuracy, we propose a simple but effective filtering algorithm based on Gaussian. The experimental results show that compared with the classic LDPLM and polynomial fitting model, the ranging accuracy of the proposed algorithm is improved by 58% and 51%, respectively, and the positioning cumulative prediction error of the proposed model is reduced by 69% and 80%, respectively.


Introduction
Location-based services (LBS) is an information service model that integrates multiple location technology and data processing technology, and uses modern communication technology to provide end users with comprehensive location information-related services [1]. With the rapid development of wireless communication networks and mobile Internet, LBS has become a business with broad market prospects. For example, in the consumer field, LBS is widely used in indoor navigation and information-pushing service. In the field of safety emergency response, LBS is applied to underground positioning of the coal mine, which can provide early warning before the disaster occurs, quickly locate the miners, and guide the robot to rescue when a disaster occurs. In addition, in the sectors of education, tourism, medical care, and others, LBS also has a wide range of application needs [2]. Positioning technology is an important prerequisite for LBS. Therefore, it is of great significance to study the positioning algorithm with high positioning accuracy and fast positioning speed.
In general, positioning is divided into indoor and outdoor scenarios. In indoor environment, positioning using the wireless local area network (WLAN) as the basic infrastructure is gaining increasing attention. WLAN is based on the IEEE 802.11 series standards issued by the Institute of Electrical and Electronics Engineers (IEEE). It uses high-frequency radio frequency signals, such as wireless electromagnetic waves in the 2.4 GHz or 5 GHz band, as transmission medium. In 2018, a textbook titled "Wireless network technology: principle, experiment, and network design" states that WLAN has the characteristics of flexible use, convenient expansion, effective cost, and simple installation [3]. Meanwhile, with the advancement of wireless communication technologies and the development of indoor communication requirements, WLAN has developed rapidly. According to a report titled "Cisco Annual Internet Report (2018-2023)" released by Cisco Systems Inc., by 2023, the number of global public WLAN hotspots will increase from 169 million in 2018 to nearly 628 million, a fourfold increase [4]. WLAN has been widely constructed as the fundamental infrastructure of indoor wireless communication, as well as a large number of smartphones and personal computers supporting WLAN have been popularized, which provides favorable conditions for utilizing existing WLAN infrastructure for indoor positioning.
In recent years, many scholars have carried out a lot of research on the indoor positioning technology based on WLAN, and have achieved fruitful results [5]. For example, the ranging positioning technology is a typical kind of achievement [6]. The principle of ranging positioning technology is to measure the distance, time difference, or angle information between anchor points firstly, and then calculate the specific coordinates of to-be-positioned points by utilizing positioning algorithms such as trilateral measurement, triangulation, or maximum likelihood estimation. Typical ranging techniques include time of arrival (ToA), time difference of arrival (TDoA) [7,8], angle of arrival (AoA) [9,10], frequency difference of arrival (FDoA) [11,12], and RSSI [13,14]. The LDPLM model is a classic RSSI-based ranging algorithm, which realizes ranging by establishing a mapping relationship between RSSI and distance. Compared with the previous ranging techniques, LDPLM is more widely used due to its advantages of easy deployment, low power consumption, and low costs. However, the classic LDPLM has two main defects, which affect the ranging accuracy. One is the estimation of the coefficient term and error term of the model. To solve this problem, some scholars propose improved algorithms to estimate the coefficient and error term of the LDPLM. For example, Li Guoquan et al. used back propagation neural network optimized by particle swarm optimization to train the LDPLM model to reduce the positioning error [15]. Liu Yong et al. proposed the FA and PSO algorithm to optimize the parameters of the model, and then correct the ranging error [16]. The other is the fluctuation of RSSI. In fact, all kinds of RSSI-based ranging algorithms encounter this problem. The reason is that the transmission of WLAN signal is easily affected by the indoor environment, resulting in fluctuations. In 2020, we conducted systematic and quantitative research on the factors affecting the indoor accuracy of RSSI-based positioning. Our research notes that, in addition to the multi-path effect, the RSSI signal is also greatly affected by factors such as co-frequency interference and adjacent frequency interference, direction and height differences between the receiver antenna and the transmitter antenna, and the hardware heterogeneity of receiving devices [17].
To improve the ranging accuracy and reduce the positioning prediction error of the classic LDPLM, we propose the adaptive calibration algorithm based on LDPLM for indoor ranging and positioning. The adaptive calibration algorithm consists of two parts: coefficient adaptive algorithm and error correction algorithm. In this paper, the term anchor point refers to the coordinates of the point where the access point (AP) is located. The term reference point refers to the point with known coordinates of a specific location. Both the anchor point and the reference point are used to solve the undetermined parameters of the adaptive calibration algorithm. The term to-be-positioned point refers to the point where the position coordinates need to be estimated. The main contributions of our work are as follows.
(1) We design a coefficient adaptive algorithm, which can dynamically calculate the coefficients of the classic LDPLM according to the RSSI at different anchor points and reference points. Furthermore, we design an error correction linear regression equation to reduce the error caused by the coefficient adaptive algorithm. Compared with the classic LDPLM model and the polynomial fitting ranging model, the adaptive calibration algorithm can effectively improve the ranging accuracy and reduce the positioning prediction error and positioning cumulative prediction error.
(2) Based on our previous research on indoor RSSI interference factors, we design a simple but effective filtering algorithm based on Gaussian. The filtering algorithm adopts the 2σ criterion to process RSSI, which is used as the input of the proposed adaptive calibration algorithm.
The rest of this paper is organized in the following way. Section 2 introduces the related background theory and technology. Section 3 presents the proposed methodology in detail. Section 4 illustrates the experimental setup and analyzes the experiment results. Finally, conclusions and suggestions for future works are discussed in Section 5.

Preliminaries
In this section, we introduce the related background theory and technology, mainly including the classic LDPLM and polynomial fitting model used for comparative experiments, the least squares method for solving positioning coordinates, and the RSSI Gaussian filtering algorithm.

Classic LDPLM
The LDPLM points out that the range fading characteristics of WLAN signal in an indoor environment obey the lognormal distribution [18]. In free space, assume that F is the electric field power density of the transceiver antenna, G r is the gain of the transceiver antenna, λ is the wavelength of the WLAN signal, and L is the system loss. Therefore, the received signal power P r can be expressed as When the wireless signal propagates in space, the signal power will attenuate with distance, so the electric field power density of the transceiver antenna F can be expressed as where P t is the transmitter signal power, and G t is the antenna gains of the transmitter and the transceiver. In this paper, the transmitter refers to the AP of WLAN, and the transceiver refers to the wireless network interface card (WNIC) supporting WLAN. Parameter d refers to the distance between the transmitter and the transceiver. Bring Formula (2) into Formula (1) and ignore the system loss L, the power received by the transceiver at a distance d from the transmitter obeys the Fries transfer formula. Therefore, this mapping relationship can be expressed as follows: Assume that the antenna gains of the transmitter and the transceiver are the same, as well as considering the fading effect of WLAN signals transmission in the indoor environment, the expression (3) can be embodied into classic LDPM, as shown below: where R(d) and R 0 (d 0 ) represent the RSSI of the reference point at the distance d and d 0 , respectively. n is the path loss coefficient related to the specific indoor environment, which represents the change speed of the path loss with the increase of distance. X σ is the noise interference represented by a Gaussian normally distributed random variable with a mean value of 0 and mean square error value of σ, which is used to indicate the error of the model.
In the classic LDPLM, R(d) uses the mean value of RSSI measured many times at the to-be-positioned point, R 0 (d 0 ) uses the mean value of RSSI measured many times at the reference point with 1 m, while n and X σ usually take a fixed value based on experience. Adopting fixed coefficients leads to the relatively large error of calculated distance d.
In Section 3, we propose a coefficient adaptive algorithm, which dynamically calculates the corresponding coefficient term n according to the input RSSI of different anchor points and reference points.

Polynomial Fitting Ranging Model
The polynomial fitting ranging model mainly establishes a polynomial fitting function between the RSSI and the distance according to the physical characteristics of the RSSI attenuating with the increase of distance in indoor environment [18].
First, measure the actual measurement distance d i , i = 1, 2, . . . , m, from m points with known specific coordinate points, i.e., reference points, to a certain transmitter and the actual measurement mean value R(d i ) of the transmitter RSSI continuously measured at m points with known specific coordinate points. Then, establish the polynomial fitting ranging model of R(d i ) and d i , as shown in the following expression: (5) is for a single transmitter, in which coefficients a, b, c are to be determined. In order to determine the coefficients of a, b and c for a specific transmitter, it is only necessary to collect the data of R(d i ) and d i from three reference points. The polynomial fitting ranging model is a simple but effective model. Yao Jinyi et al. pointed out in a study that in fitting models of RSSI and distance, the polynomial fitting ranging model has higher ranging accuracy than the linear or the logarithmic fitting ranging models [18].

Positioning Based on Least Squares
The least squares method is an effective mathematical optimization technology. It finds the best fitting function of test data by minimizing the sum of squares of errors. Gauss-Markov theory points out that under the assumption of classical linear regression, the least squares estimator is a linear unbiased estimator with minimum variance. In other words, compared with any linear unbiased estimator obtained by other methods, the least square method is the best.
Assume that there are m(m 3) APs in the indoor environment, and their known coordinates are (x 1 , y 1 ), (x 2 , y 2 ), . . . , (x m , y m ), respectively. The coordinate of to-be-positioned point A is A(x, y). The distances from to-be-positioned point A to each AP are d 1 , d 2 , . . . , d m . Thus, simultaneous equations are given as follows: The simultaneous equations are a system of nonlinear equations. To solve this system of nonlinear equations, we subtract the m-th equation from the previous n − 1 equations to obtain a linearized equation where . .
The least square method is used to find the optimal solution of the Equation (7). the error ε existing in the measurement can be expressed as follows: To obtain the minimum value of Q(x), the differential derivation of Equation (8) is as follows: dQ If AA T is nonsingular, the solution X is as follows:

RSSI Gaussian Filtering Algorithm
Our previous research points out that RSSI is greatly affected by the indoor environment, which affects the ranging accuracy of RSSI-based ranging algorithms [17]. Therefore, before actually using RSSI values, it is necessary to eliminate abnormal values from the RSSI collected in the experiment to obtain a set of relatively smooth values. A large number of studies show that in the indoor environment, the random variable RSSI approximately obeys the normal distribution in most cases [19]. Therefore, the 3σ criterion is used to discriminate errors and eliminate outliers is adopted in this paper.
The 3σ criterion assumes that the test data contains only random errors. The original data is processed to obtain the standard deviation, and then an interval is determined according to a certain probability. Values exceeding this interval are considered outliers. Reference [20] assumes that the RSSI in the indoor environment obeys a Gaussian distribution with mean value µ and variance σ 2 . Then its probability density function can be expressed as follows: This paper selects the 2σ as the range to remove outliers from the collected data. Specifically, calculate the arithmetic mean of all RSSI values in the range of [µ − 2σ, µ − 2σ] as the final RSSI value for ranging.

Introduction to the Adaptive Calibration Algorithm
This section is divided into two parts: the first one introduces the adaptive calibration algorithm, and the second part describes the positioning process. The adaptive calibration algorithm includes coefficient adaptive algorithm and error correction algorithm. The coefficient adaptive algorithm is used for dynamically calculating the coefficients of the classic LDPLM. The error correction algorithm is used for reducing the error caused by the coefficient adaptive algorithm.

Coefficient Adaptive Algorithm
In the classic LDPLM, as shown in the expression (4), assume that the coordinate of the anchor point A and the m reference points are known, and the distances from the m reference points to the anchor point A are also known as d 1 , d 2 , . . . , d m . An AP is placed at the anchor point A. Then, The RSSI of the AP at the anchor point A is continuously measured for a period of time at each reference point, and the average value R(d i ) is calculated after processing by the 2σ criterion described in Section 2. Thus, the above process can be expressed as follows: According to the principle of indirect adjustment and error theory, the error equation of the form V = Bx − L can be obtained as follows by transforming Expression (12): where According to the principle of the Least squares method, assume that each measurement is an independent equal precision observation, the coefficients in expression (13) can be determined by minimizing the sum of square error between the predicted value of the RSSI calculated by the model R(d i ) and the actual value of the RSSI R(d i ), that is In expression (14), take the partial derivative with respect tox, we can get: Through the above method, the model coefficients can be dynamically and independently determined for the AP at each anchor point. Next, we present a linear regression equation to reduce the noise interference X σ in detail.

Error Correction Algorithm
Due to the influence of an indoor complex environment, there are errors between the measured value of RSSI and the real value of RSSI. In expression (12), these errors are expressed as the noise interference X σ . Based on the expression (12), a linear regression equation is defined to correct the errors. The new model is constructed as follows: In expression (17), Equation (1) is transformed from expression (12) to calculate the distance d i from the reference point i to the anchor point. On this basis, a distance error correction linear regression equation d i = a + bd i is defined to adjust the distance d i calculated by Equation (1), where a and b are linear regression coefficients.
In the actual measurement, we set a set of reference points for each anchor point, and the distance from each reference point to this specific anchor point is known as (d 1 , d 2 , . . . , d m ). To determine the linear regression coefficients a and b, we use the method that minimizes the sum of the squared differences of the true and calculated distances, that In order to eliminate the error among multiple measurements, according to the principle of indirect adjustment and error theory, the error equation of the form V = Cx − L can be obtained as follows: According to the least square principle, the linear regression coefficients can be determined as:

Localization Process
Taking three reference points as an example, the indoor positioning steps based on the propagation model method are as follows. And the positioning process is shown in Figure 1.
(1) Determine the path propagation loss distance model according to the positioning environment.
(2) Initialize the position of anchor points and record their relative coordinate information.
(3) Set reference points in the positioning area and collect the real distance and RSSI values, and determine the model parameters in the positioning environment according to the information of the sample.
(4) Use the RSSI collected by to-be-positioned points and the obtained signal propagation loss model to estimate the distance between to-be-positioned points and anchor points.
(5) Using the estimated distances to three anchor points estimated by to-be-positioned points, combined with a positioning algorithm to determine the relative position coordinates of to-be-positioned points.

Experiments and Discussions
In this section, we first introduce the algorithm performance evaluation indicator and the experimental setup, followed by experimental results and discussions.

Evaluating Indicator
Due to the influence of hardware equipment, indoor communication environment, and other factors, there are certain errors in the measurement of various positioning parameters, resulting in errors in the final estimated target position coordinates. In this paper, the localization error is used to evaluate the localization accuracy of the model. The location error ERROR is generally expressed by the Euclidean distance between the estimated location and the true location where (x 0 , y 0 ) represents the real coordinate location of the positioning user, and (x i , y i ) represents the location coordinates estimated by the positioning algorithm. It should be noted that the coordinate position described in the process of indoor positioning in this paper is the relative coordinate in the experimental scene rather than the real geographic coordinate.

Experimental Setup
The experimental environment in this paper was set in the wireless network training room 221 on the second floor of Li Zhi Building, Minnan Normal University. The real scene of the experimental environment is shown in Figure 2. In this experiment, three anchor points were set with the coordinates (0.6, 1.2), (4.8, 1.8), and (4.8, 6.0), respectively. At the same time, five reference points were set, and their coordinates are (3.0, 2.4), (3.0, 6.6), (1.8, 5.4), (2.4, 0.6), and (4.8, 0.6), respectively. There were also four to-be-positioned points. The coordinate unit is meter, abbreviated as m. The reference points are used to establish the propagation model, and the to-be-positioned points are used to verify the effect of models. Three signal transmitting devices TL-WR842N were placed at the three anchor points, respectively. TL-WR842N is a cheap and easily available small office & home office (SOHO) wireless router which is produced by TP-Link Corporation Limited. TL-WR842N adopts 802.11n wireless technology, and the wireless transmission rate is up to 300 M bps at the 2.4 GHz band. It also adopts 2 × 2 multiple-input & multiple-output (MIMO) technology with 2 external antennas, which can provide stable wireless connections and optimal coverage. For convenience, the three TL-WR842N devices were represented as AP 1 , AP 2 , and AP 3 , respectively. The five reference points were represented as A, B, C, D, and E, respectively. The four to-be-positioned points were represented as p_a, p_b, p_c, and p_d, respectively. The distribution of anchor points, reference points, and to-be-positioned points is shown in Figure 3. The omni-directional antennas of TL-WR842N were all perpendicular to the ground. The service set identifiers (SSIDs) of the three TL-WR842N were named TP-LINK_F5B9, TP-LINK_CB37, and TP-LINK_A2F4, respectively. The transmission power of three TL-WR842N were all set as default power uniformly. To reduce the co-channel interference and adjacent frequency interference, the three TL-WR842N used wireless channels 1, 5, and 12, respectively. The Lenovo notebook computer with Realtek 8821AE Wireless LAN 802.11ac PCI-E Wireless network card was used as the receiver to collect the RSSI of the three signal transmitting devices TL-WR842N. The WirelessMON with version 4.0 was used as the RSSI signal acquisition software. Media access control (MAC) address, SSID, collection time, and RSSI of each AP were recorded respectively. The signal acquisition interface of WirelessMON is shown in Figure 4.   There are many objects in the laboratory that affect the transmission of Wi-Fi signals, such as desks, computers, switches, etc. We collected RSSI signals at five reference points and four to-be-positioned points according to the following rules. At each point of reference points and to-be-positioned points, for each anchor point, 60 RSSI signals were collected continuously at one time. To reduce the interference of multi-path effects and other factors, RSSI signals were collected twice in turn. Therefore, 1080 RSSI signals were obtained for each anchor point, and 3240 data were obtained for all three anchor points. The RSSI Gaussian filtering algorithm was used to process the collected RSSI signals, and then calculated the arithmetic mean value of the RSSI signal collected at each anchor point as the RSSI value of the anchor point collected at that point.
After processing the collected RSSI with the RSSI Gaussian filtering algorithm, the measurement data of reference points and to-be-positioned points are shown in Tables 1 and 2. Table 1. Measurement data of reference points.

Reference Point
Coordinates  Table 2. Measured data of to-be-positioned points.

To-Be-Positioned Point
Coordinates In the Tables 1 and 2, d 1 , d 2 , and d 3 represent the actual measured distances to AP 1 , AP 2 , and AP 3 , respectively. R(d 1 ), R(d 2 ), and R(d 3 ), represent the mean values of the actual measured RSSI signals collected from AP 1 , AP 2 , and AP 3 , respectively. X(d 1 ), X(d 2 ), and X(d 3 ) denote the actual measurement standard deviations of RSSI from AP 1 , AP 2 , and AP 3 obtained by continuous measurement, respectively.

Ranging Results of Classic LDPLM
By substituting the values in Table 1 into Equation (16), the coefficients R 0 (d 0 ) and n of the classic LDPLM can be obtained. Then the coefficients of each AP transmitter are obtained as shown in Table 3, and they are re-substituted into the model to observe and fit the current indoor environment. The RSSI values of the measured data in Table 2 and the coefficients of the classic LDPLM in Table 3 are substituted into Equations (4). The calculated distance is obtained and compared with the actual measured distance. The results are shown in Table 4. Table 4. The classic LDPLM ranging results and errors (m). In Table 4, d 1 , d 2 , and d 3 represent the solution distance of the model from the tobe-positioned point to AP 1 , AP 2 , and AP 3 respectively. di f f 1 (d), di f f 2 (d), and di f f 3 (d) represent the absolute error between the calculated distance and the actual measured distance from each to-be-positioned point to AP 1 , AP 2 , and AP 3 respectively. S_di f f is the sum of the error between the settlement distances of the model and the actual measurement distances from each to-be-positioned point to three APs, i.e., the sum of di f f 1 (d), di f f 2 (d), and di f f 3 (d).

Ranging Results of Polynomial Fitting Ranging Model
By substituting the values in Table 1 into Equation (5), the coefficients a, b, and c can be obtained by the least square method. The coefficients of each TP-LINK transmitter are shown in Table 5. Then they are replaced with the polynomial fitting ranging model to observe and fit the current indoor environment. The RSSI values of the measured data in Table 2 and the parameter estimation values of the polynomial fitting ranging model in Table 5 are substituted into Equation (5). The calculated distances can be obtained and compared with the actual measured distances. The results are shown in Table 6. Table 6. Polynomial fitting ranging model ranging results and errors (m). Because the ranging model based on the polynomial fitting will become a quadratic equation of one variable when solving the solution, there will be non-existent solutions or existing negative solutions, but the actual distance cannot be negative. To fully prove the accuracy of the adaptive calibration algorithm proposed in this paper and make the experimental results more convincing, the optimal value obtained by the polynomial fitting ranging model is retained in Table 6. That is, in the case of negative solutions, the negative values of the two distance solutions are eliminated and the positive solutions are selected. At the same time, in the case of two positive solutions, the solution closer to the actual distance is taken as the model solution. "-" in Table 6 indicates that the equation has no solution, that is, in some cases, the distance can not be calculated through the polynomial fitting ranging model.

Ranging Results of Adaptive Calibration Algorithm
Coefficients a and b can be obtained by substituting the values in Table 1 into Equation (19). The solved coefficients of each TP-LINK transmitter are shown in Table 7. And then they are brought back into the error correction algorithm to observe and fit the current indoor environment. Substitute the RSSI values of the measured data in Table 2 and the solved coefficients of the error correction linear regression equation in Table 7 into Equation (17) to obtain the calculated distances, which are compared with the actual measurement distances. The results are shown in Table 8.

Comparison and Analysis of Models' Ranging Results
Extract the last column of attribute value S_di f f from Tables 4, 6 and 8, which are respectively expressed as S i _di f f , i = 1, 2, 3, and get the result as shown in Table 9. The p_a, p_b, p_c, p_d in Table 9 represent the to-be-positioned points. Because the coordinates of each to-be-positioned point are obtained by the joint action of three APs. Therefore, the smaller the S i _di f f , the more accurate the ranging result of the to-be-positioned point, and the more helpful to improve the positioning accuracy. SU M is the sum of four to-be-positioned points S i _di f f , i = 1, 2, 3. It represents the sum of the error between the model calculated distance and the actual measured distance from all to-be-positioned points to three AP transmitters. The smaller the SU M, the better the positioning accuracy.
"-" in Table 9 indicates that the polynomial fitting ranging model fails to calculate the model distance in some cases. It can be seen from Table 9 that four to-be-positioned points a, b, c, and d, the S 3 _di f f obtained by the proposed model is smaller than S 1 _di f f and S 2 _di f f obtained by the former two models. This means that for a single to-be-positioned point, the ranging error obtained by the proposed model is smaller than that of the former two models. At the same time, it can be seen from the SU M value that the total ranging error of all to-be-positioned points of the proposed model is 3.56, which is less than 8.57 and 7.28 of the former two models, and the total ranging accuracy is improved by 58% and 51%, respectively.

Comparison and Analysis of Models' Positioning Results
Based on the ranging results obtained from the above three ranging models, we calculated the specific coordinates of each model for to-be-positioned points by the least square positioning algorithm. The results are shown in Table 10. In Table 10, model 1, model 2, and model 3 represent the classic LDPLM model, the polynomial fitting ranging model, and the adaptive calibration model, respectively. To compare the model results more intuitively, we drew a comparison chart of the actual coordinates of to-be-positioned points and calculated coordinates of the three models, as shown in Figure 5. In Figure 5, " " represents the calculated coordinates of the to-be-positioned points by model 1, "•" represents the calculated coordinates of the tobe-positioned points by model 2, " " represents the calculated coordinates of the tobe-positioned points by model 3, and " " represents the actual coordinates of the tobe-positioned points. The connecting line between the actual coordinates of the to-bepositioned points and the model calculated coordinates of the to-be-positioned points represents the prediction error between them. The connecting line can be expressed by the Euclidean distance, that is, the Equation (20) represented in this paper. In other words, we used the Euclidean distance to evaluate the positioning prediction errors of the three models. The prediction errors of the three models at the four to-be-positioned points a, b, c, and d are shown in Figure 6a. And the cumulative prediction errors of the three models are shown in Figure 6b. In Figure 6a, we used graphics with different shapes to represent different models, where " " represents the prediction error of model 1, "•" represents the prediction error of model 2, and " " represents the prediction error of model 3. The prediction error of model 2 at the to-be-positioned point b is "NULL". The reason is that model 2 cannot solve the distance at the to-be-positioned point b and thus cannot obtain the calculated coordinate. From Figure 6a, it can be found that for each to-be-positioned point, the prediction error of the adaptive calibration model (model 3) proposed in this paper is the smallest, the classic LDPLM model (model 1) is the second, and the polynomial fitting ranging model (model 2) is the largest. From Figure 6b, it can be found that the cumulative prediction error of the adaptive calibration model (model 3) is also the smallest, the classic LDPLM model (model 1) is the second, and the polynomial fitting ranging model (model 2) is the largest. Compared with model 1 and model 2, the positioning cumulative prediction error of the proposed model is reduced by 69% and 80%, respectively.

Conclusions
In this paper, we propose the adaptive calibration algorithm based on LDPLM and RSSI for indoor ranging and positioning. The adaptive calibration algorithm consists of two parts: coefficient adaptive algorithm and error correction algorithm. The coefficient adaptive algorithm solves the problem that the coefficients of the classic LDPLM cannot be adjusted adaptively. While the error correction algorithm reduces the error caused by the coefficient adaptive algorithm. Furthermore, we design a simple but effective filtering algorithm based on Gaussian to process RSSI. The experimental results show that our work effectively improves the ranging accuracy and reduces the positioning prediction error and the positioning cumulative prediction error. Future works may further consider the real-time performance and computational complexity of the proposed system at a practical level. In addition, the adaptability of the proposed system in different wireless networks, such as the low-power internet of things (IoT), also needs further consideration.