Indoor Carrier Phase Positioning Technology Based on OFDM System

Carrier phase measurement is a ranging technique that uses the receiver to determine the phase difference between the received signal and the transmitted signal. Carrier phase ranging has a high resolution; thus, it is an important research direction for high precision positioning. It is widely used in global navigation satellite systems (GNSS) systems but is not yet commonly used inwireless orthogonal frequency division multiplex (OFDM) systems. Applying carrier phase technology to OFDM systems can significantly improve positioning accuracy. Like GNSS carrier phase positioning, using the OFDM carrier phase for positioning has the following two problems. First, multipath and non-line-of-sight (NLOS) propagation have severe effects on carrier phase measurements. Secondly, ambiguity resolution is also a primary issue in the carrier phase positioning. This paper presents a ranging scheme based on the carrier phase in a multipath environment. Moreover, an algorithm based on the extended Kalman filter (EKF) is developed for fast integer ambiguity resolution and NLOS error mitigation. The simulation results show that the EKF algorithm proposed in this paper solves the integer ambiguity quickly. Further, the high-resolution carrier phase measurements combined with the accurately estimated integer ambiguity lead to less than 30-centimeter positioning error for 90% of the terminals. In conclusion, the presented methods gain excellent performance, even when NLOS error occur.


Introduction
With the rapid development of industries such as the Internet of Things and industrial control, high-precision indoor positioning technology has become an important issue to be solved. It is challenging to receive valid satellite navigation signals in the indoor environment, and other high-precision positioning technologies need to be studied. In recent years, positioning services based on wireless communications are rapidly developing. The mobile cellular network covers a wide area and is one option for dense urban areas and indoor positioning. Benefit from the advance of 5G technology, high-precision positioning using the wireless access network has become a hot research direction. In wireless networks, traditional ranging-based positioning methods include angle of arrival (AOA), received signal strength (RSS), and time-of-arrival (TOA). Among them, AOA determines location of the user by measuring the angle between the terminal and the base station (BS) [1]. Since measuring angle often requires a sufficient number of antennas at the receiver, the application range of AOA technology is limited. RSS technology needs to establish an accurate signal energy propagation model, making it challenging to achieve high measurement accuracy [2]. TOA-based positioning technology converts arrival time to a distance and then uses the distance information for positioning. TOA has been widely used due to its low requirements of positioning equipment [3]. This paper mainly studies highprecision TOA measurement and positioning algorithms based on orthogonal frequency division multiplex (OFDM) systems.
TOA estimation can be considered as a channel estimation problem. Many documents carry out channel impulse response (CIR) estimation from the time domain or frequency domain perspective in the OFDM multi-carrier system [4][5][6][7][8][9]. Typical schemes are crosscorrelation algorithms based on the pseudo-randomness of the transmission sequence, including the maximum criterion algorithm and the threshold algorithm [4]. However, this positioning method is limited by the signal bandwidth and receiver resolution, and it is challenging to achieve sub-meter accuracy. Besides, TOA-based parameter estimation techniques have been widely studied, including multiple signal classification algorithm (MUSIC) [10], Signal Parameters via Rotational Invariant Techniques (ESPRIT) [11], and Space-Alternating Generalized Expectation maximization (SAGE) [12] algorithms. These algorithms are not limited by the system sampling rate but are determined by the search interval for time delay estimation. A smaller search interval will effectively improve the accuracy of TOA estimation but will significantly increase the computational complexity. The vast computational overhead makes it difficult to apply such algorithms to real-time user localization scenarios. Other studies have attempted to apply phase ranging techniques to indoor localization [13][14][15]. However, specific phase emission and measurement devices are challenging to reduce the cost of localization effectively. Phase measurement techniques based on OFDM systems can provide high accuracy positioning measurements while satisfying communication requirements, and therefore are a research direction for phase-based positioning. References [16][17][18] describe methods for distance measurement through the phase difference of subcarriers in OFDM systems. Still, such schemes are often only suitable for LOS propagation or multipath propagation when the Rice factor is high. Carrier phase localization techniques based on wireless cellular networks have been proposed in the literatures [19,20]. Furthermore, carrier phase measurement in multipath environments and the suppression of non-line-of-sight (NLOS) error require further research.
There are two modes for receivers in global navigation satellite systems (GNSS): pseudorandom code (C/A code or P-code) and the carrier phase [21,22]. The ranging principle of pseudorandom code mode is similar to TOA, and the measurement error of pseudorandom code mode is vast. The carrier phase ranging method uses the carrier phase of the measurement signal to extract the propagation distance information. Under line-of-sight (LOS) conditions, the carrier phase's measurement error is a small fraction of the carrier wavelength and can reach the centimeter range. However, the carrier phase measurement includes unknown integer ambiguity: the distance between the user and the BS in terms of carrier wavelength can be divided into an integral part of the wavelength plus a fractional function. During the initialization of positioning, the phase measurement is in the range [0, 2π], so only fractional multiples of the distance can be measured, which causes the problem of integer ambiguity. Once this problem is solved, the carrier phase positioning can meet the requirements of high accuracy.
Inspired by reference [19], the positioning accuracy might be significantly improved if the carrier phase technology can be extended in the indoor location system. Compared with GNSS positioning, wireless networks can work in challenging scenarios and have more flexible carrier frequency configurations, fewer error sources, and more minor path losses. These characteristics constitute the advantages of supporting carrier phase technology in wireless networks. However, despite these advantages, there are many challenges while applying carrier phase positioning in wireless networks: Multipath and NLOS propagation in the indoor environment, fast resolution of integer ambiguities in wireless networks, etc.
In summary, this paper proposes a carrier phase-ranging scheme based on the OFDM system. Under the premise of high accuracy ranging, this paper focuses on two aspects: carrier phase measurement in a multipath environment and how to solve the integer ambiguity quickly and accurately. First, we model the carrier phase measurement in a multipath environment and analyze the integer ambiguity generation. Second, we propose an extended Kalman filter (EKF) for solving the integer ambiguity. The EKF-based algorithm can solve the position of the terminal while solving the integer ambiguity. Further, we describe how to utilize the EKF to mitigate the errors caused by NLOS propagation.
The overall structure of this study contains five chapters. Section 2 describes the model for studying TOA and phase estimation in OFDM systems. In Section 3, we propose an EKF that combines carrier phase and TOA measurements to enhance positioning accuracy and reduce the impact of NLOS error on mobile positioning. Numerical simulation results are presented in Section 4 to prove the effectiveness of the new methods. In Section 5, we summarize conclusions drawn from this paper.
In this paper, vectors and matrices are denoted by boldface lower-case letters and boldface upper-case letters. The superscript [.] T denotes the transpose. The superscript [.] ij and the subscript [.] ab represent, respectively, the single-difference (SD) between the transmitters and between the receivers.

Ranging System
Consider OFDM transmission with N subcarriers, subcarrier spacing ∆ f SCS and sampling interval T S = 1/(N∆ f SCS ). OFDM transmission is block oriented. Assume N quadrature-amplitude modulation (QAM) symbols X m k , k ∈ {1, . . . , N} are grouped into a vector X m = X m 1 , . . . , X m N T and transmitted in the m-th OFDM symbol in a slot. A unitary inverse discrete-time Fourier transform (IDFT) on X m gives a continuous time representation of the complex envelope of an OFDM symbol of duration T = NT s = 1/∆ f SCS (note: here T does not include cyclic prefix).
the time-domain signal x m (t) is up-converted to the carrier frequency f c for transmission.
Assume the channel is the quasi-static channel, i.e., the channel does not change during the transmission of one OFDM symbol, the quasi-static channel can then be described by a time discrete CIR h = h 0 (t), h 1 (t), . . . , h L p −1 (t) T , multipath channel model can be expressed as: L p is the total number of paths which include one LOS path and L p − 1 NOLS paths, h l (t) is the gain for the l-th path, δ(t − τ l (t)) is the Dirac delta function, τ l (t) is the TOA of the l-th path, h d (t, τ) are the diffuse multipath components (DMC) [23], which represent the non-discrete part of the channel. The received signal after passing through the multipath channel can be expressed as: w m is the color noise consisting of w m n and s m (t) ⊗ h d (t, τ), where w m n ∼ N 0, σ 2 is the complex additive noise with zero mean and σ 2 variance. If the received signal contains color noise, it is necessary to consider the use of whitening filters to convert the color noise to white noise [24]. Furthermore, the received m-th OFDM symbol can be expressed by: After down-conversion and removal of the samples of the received signal which belong to the cyclic prefix, the received signal y m (t) is converted into a discrete time domain signal y m [n]:

Conventional Cross-Correlation TOA Estimator
Signal arrival time needs to be obtained from reference signals. In Long Term Evolution (LTE) Release 9, positioning reference signals (PRS) were used to improve TOA-based positioning. PRS are pseudo-random sequences with good autocorrelation. With the help of the autocorrelation characteristics of the PRS sequence, it is easier to find the direct path in the environment of multipath transmission. The cross-correlation expression is: where (.) denotes the complex conjugate function, x[n]is the replica of the transmitted PRS. Furthermore, based on the autocorrelation of the PRS series, we have: where w m [n] is the downsampled additive noise. From Equation (7), it can be seen that the magnitude of the correlation function is affected by the carrier phase 2π f c τ i [nT s ]. To exclude this effect, we use |R xy [τ]| instead of R xy [τ] for TOA estimation. Taking the threshold method as an example, TOA is determined by estimating the time delay of the first (earliest) peak in the magnitude of the normalized cross-correlation function above a certain threshold [4].τ here, ζ is the preset threshold. Correlation profile-based methods can estimate the propagation delay of the first path in a multipath environment. Still, due to the limited sampling rate of the system, the measurement accuracy of this method is low. Rewritingτ to T i r and introducing terminal r and the BS i, then the estimated TOA can be modeled as [25]: • T i r (known) is the TOA measurement from terminal r to BS i (unit:s). • c is the speed of radio waves in vacuum, 299,792,458 (unit: m/s).
is the geometric distance between the antennas of transmitter i and receiver r (unit: m).
• (x i , y i ) (known) is the two-dimensional vector giving the coordinates of BS i. • (x, y) (unknown) is the location of the terminal to be solved.
• w i r,T ∼ N 0, σ 2 r,i (unknown) is a random Gaussian variable accounting for the residual estimation error (unit: m).

High-Precision TOA Estimation Scheme Based on Carrier Phase
From Equation (5), combine the known PRS signal, the frequency domain channel response is written as: As can be seen from Equation (11), the distance between the BS and the terminal is reflected in each subcarrier phase. However, due to the signal aliasing of multiple transmission paths, it is difficult to directly estimate phase information of the first path from the unprocessed subcarrier phase. Therefore, we convert the frequency domain channel response to the time domain for further analysis. Furthermore, when the distance (in units of sampling interval) is not an integer multiple of the sampling interval, the time domain channel response is subject to energy leakage [26]: Much of the literature [27,28] describes using Equation (7) or (9) to find the integer multiple sampling points closest to the transmission delay, denoted as [τ 1 ], and [.] is a rounding function. The time domain signal is processed to eliminate the effects of multipath effects. The window can be expressed as: We use the tapped delay line model to characterize the frequency-selective channel, and each tap represents a different channel delay in units of the sampling interval of the receiver. Figure 1 shows a schematic of the window at W = 0. Based on the correlation of the transmit sequence, the terminal can determine the arrival delay of the direct path. The manipulation of the power delay profile further eliminates the effects of multipath. Additionally, it is worth noting that actual distance to the BS in this example is 12.4 sampling intervals. Due to the limitation of the system sampling rate, the TOA obtained by the cross-correlation algorithm is 12 sampling intervals, which generates a significant measurement error. Furthermore, as shown in the figure, the distance is a non-integer multiple of the sampling interval resulting in leakage between taps. For the convenience of analysis, we consider W = 0 and the window can be expressed as: The frequency domain channel response after the window function can be written as: The time-domain window eliminates the effect of multipath on the carrier phase, but introduces additional problems at the same time.
(1) The phase difference between sub-carriers e −j2π [τ 1 ] N can no longer accurately reflect the distance. The system resolution also limits the time delay measured through the subcarrier phase due to the effect of the time domain window.
(2) The time-domain window processing introduces some phase noise. For example, e −j π N ([τ 1 ]+(N−1)τ 1 ) . Furthermore, the sign of will also affect the phase of sub-carriers. It can be proved that the subcarrier phase of k = N/2 can effectively reflect the distance information from the terminal to the BS. Furthermore, the channel frequency response of subcarrier k = N/2 can be approximated as: the proof is given in the Appendix A. Therefore the phase at k = N/2 can be written as: here,ŵ P is the phase noise caused by w m N/2 . Due to the trigonometric function properties, the part beyond 2π cannot be found when solving for the phase; thus, the integer ambiguity arises. Considering the phase shifts experienced in the channel, e.g., phase noise, base oṅ , the phase-based ranging can be written as: here, N I is the unknown integer ambiguity. Divide Equation (17) by 2π and simplify the equation: here, φ =φ 2π is the normalized phase measurement, w P =ŵ P 2π is the normalized phase noise, d = cτ 1 [nT s ] is the geometric distance between the antennas of transmitter and receiver, λ = is the equivalent wavelength. Further, introducing terminal r and the BS i, we have: • φ i r (known) is the carrier phase measurement (unit: carrier circle). • λ (known) is the wavelength calculated from c, f c , N, and ∆ f SCS , (unit: m). • N i r (unknown) is the integer ambiguity (unit: carrier circle). • w i r,P ∼ N 0,σ 2 r,i (unknown) is the residual estimation error (unit: carrier circle). The time delay from the user to the BS can be deduced by measuring the phase of the N/2 subcarrier. Equation (16) shows that the system sampling rate does not limit the carrier phase measurement, and thus the accuracy of the carrier phase-based ranging technique is high. Furthermore, we use the phase-lock-loop (PLL) [29] to measure the carrier phase. At the initial locking moment of the PLL, the carrier phase measurement is between [0, 1]. After that, the change of user position will be reflected in the measured phase (continuous phase tracking allows carrier phase more than 1 or less than 0), thus ensuring that the integer ambiguity is constant during the user positioning. However, since the integer ambiguity is unknown, the carrier phase measurements are challenging to be used directly for user location solutions. Therefore, we propose a location algorithm combining carrier phase and TOA measurements in the following.

Positioning Algorithm
The ambiguity resolution is one of the primary problems in carrier phase measurement. In this section, we propose an EFK algorithm based on TOA and carrier phase measurements. This algorithm can estimate the position while estimating the integer ambiguity.

TOA and Carrier Phase Measurements
According to Equations (10) and (19), further considering the non-ideal factors such as clock error and NLOS error, the TOA measurements and carrier phase between the i-th BS and user equipment (UE) r at a specific epoch can be written as: • δt i (unknown) is the clock error of the transmitter i (unit: s). • δt r (unknown) is the clock error of the receiver r (unit: s). • m i r (unknown) represents the channel bias introduced by NLOS reflections (unit: m). The SD of the TOA and carrier phase measurements from the receiver r by measuring the signals from two transmitters i and j can be expressed as: where the double superscript "ij" indicates the differential operation between transmitters i and j, i.e., s ij r = s i r − s j r ; s ∈ {T, φ, d, δt, N, m, w}. According to Equations (10) and (19), the measurement noise w ij r,T and w ij r,P are still independent Gaussian noise with following distributions, i.e., The SD operation of Equation (21) removes the measurement errors common to the receiver, e.g., the receiver clock offset δt r . Furthermore, the double-difference (DD) TOA and carrier phase measurements from two transmitters i and j, and two receivers r and u can be expressed as: where the double superscript "ij" indicates the differential operation between transmitters i and j, and double subscript "ru" indicates the differential operation between receivers r and u, s DD operation removes the measurement biases related to the transmitters and the receivers, such as the transmitter clock offsets and receivers clock offsets. We introduce the concept of reference device, where it is assumed that u is the reference device and that the location of terminal u is known. It can be seen by Equation (23) that the introduction of the reference device helps to eliminate the clock error. We can construct the SD measurements from the DD measurements, which are not impacted by the receiver and the transmitter clock biases. Given that d ij u can be obtained from the known locations of the reference device u and the BSs, we can construct the SD measurementsT ij r and Φ ij r : Equation (25) shows theT ij r and Φ ij r are not impacted by the receiver and the transmitter clock biases. It is worth noting that the reference device can be either a UE with a known exact location or a BS. For some positioning scenarios, the deployment of additional hardware can cause a significant overhead; therefore, 3GPP has agreed on selecting the reference device, i.e., the device with the known location can be a UE and/or a BS (also known as evolved gNB) [30].

Extended Kalman Filter
For an EKF design, one needs first to define the unknown EKF states. An EKF for carrier phase positioning may include the following EKF states: • UE position. EKF for positioning needs to include the states associated with the unknown UE position. The EKF may use the 2D (or 3D) UE position coordinates directly as the EKF states. For example, in the following discussion of the EKF design, we assume the EKF states include a 2D position. • UE velocity. With the consideration of UE mobility, the EKF states may also include the UE velocity. The number of states for UE velocity is generally the same as the number of states for UE position.
• Integer ambiguities. The premise of using the carrier phase for location is to solve integer ambiguities. According to Equation (25), it is necessary to solve the DD integer ambiguities while solving the user position.
Let the position of the UE at epoch k be s(k). In the absence of other information, assume that the velocity of UE keeps constant, the position at the next epoch can be expressed as s(k + 1) = s(k) + vT. Furthermore, in the case of no cycle slip, the ambiguities remain consistent in each epoch. Assume the system states include 2D position, 2D velocity, and the DD integer ambiguities are obtained from m cells, and the system can be represented as: Assume the j-th cell is selected as the reference cell. The EKF state vector x can be expressed as follows: where s = (x, y) models the UE position; v = (v x , v y ) is the UE velocity, and , . . . , N mj ru ] includes the DD integer ambiguities. Based on the selected EKF states, the state transition equation of the discrete EKF for carrier phase positioning can be written as: The one-step state transition matrix is as follows: where F 12 represents an identity matrix, and 0 represents a zero matrix. ∆T is the time interval of the state transition of the Kalman filter. σ 2 x , σ 2 y and σ 2 v x , σ 2 v y represent the uncertainty in the prediction of the UE position and velocity.
The measurement equations of the discrete EKF as: Z(k + 1) is the SD measurement vector, W Z (k + 1) is the measurement noises, R T and R P represent, respectively, the convince matrix of the measurement noises W T and W P . R T is non-diagonal matrixes due to DD operation on the measurements as shown in Equation (24). R P can be obtained similarly. h(x(k + 1))is a nonlinear function that describes the relationship between the state vector and the measurement vector: There is a need to linearize the measurement Equation (30) around the estimated UE location to use the EKF algorithm. The Jacobian matrix H can be obtained as: Given the state and measurement equations in previous sections, the EKF algorithm can be applied to calculate the estimate of x(k + 1) based on the SD measurements. EKF algorithm [31,32] includes the following time-update and measurement update equations. Furthermore, the time-update equation are: x(k + 1|k) = F(k)x(k|k); P(k + 1|k) = F(k)P(k|k)F T (k) + Q(k); (39) where x(k|k) and P(k|k) are, respectively, the estimated state vector and its covariance matrix at the epoch t = t k . x(k + 1|k) and P(k + 1|k) represent, respectively, the predicted state vector and its covariance matrix at the epoch t = t k+1 , based on x(k|k) and P(k|k).
The matrixes F(k) and Q(k) are defined in Equation (29). Furthermore, the measurement update equation are: H(x(k + 1|k)) is the Jacobian matrix given by Equation (35), the measurement equation h(x(k + 1|k)) is defined in Equation (34), and calculated based on the predicted position (x(k + 1|k), y(k + 1|k)) at time t = t k+1 .

NLOS Error Recognition and Elimination Based on EKF
Equation (25) shows that DD operation may not cancel out the impact of the NLOS. Furthermore, we propose an EKF-based scheme for NLOS error identification and elimination. (41) According to the state and measurement equations at t = t k , EKF can predict the SD measurements at t = t k+1 . Because the NLOS error reaches several meters, if there is NLOS propagation at t = t k+1 , the SD measurements will deviate greatly from the predicted value of EKF. NLOS error can be identified and corrected according to the deviation: The threshold setting depends on the maximum DD measurement noise. For the deviation greater than Λ, the NLOS error needs to be updated. The predicted measurements of EKF are used to improve the positioning accuracy.

EKF Initialization
For the first step of the EKF (t = 0), the estimated initial UE position (x(0), y(0)) is obtained from the time difference of arrival (TDOA) or other approaches [33]. The initial estimates of (v x (0), v y (0)) can be set to 0. The initial ambiguities N (44) here, N ij u is the SD integer ambiguity of the reference device. The initial covariance matrix P 0 can be set as the diagonal matrix as follows: P(0) = diag P x (0), P y (0), P v x (0), P v y (0), P N (0) ; P N (0) = P N 1j (0), . . . , P N (j−1)j (0), P N (j+1)j (0), . . . , P N mj (0) ; where P x (0), P y (0) can be set based on the assumed maximum positioning error of the TDOA. P v x (0), P v y (0) can be set based on the expected maximum velocity of the UE; P N 1j (0), . . . , P N mj (0) are set based on the maximum assumed DD measurement error.

Interaction with the Ambiguity Resolution Block
The EKF estimated float DD carrier-phase ambiguities would be sent to ambiguity resolution block to get integer DD carrier-phase ambiguities to improve positioning accuracy. For this purpose, after each EKF step k, the float solution of the DD carrier-phase ambiguities N(k | k) and the corresponding to covariance matrix P N (k) are provided to the ambiguity resolution block for searching the DD integer ambiguities N(k | k). To fix integer ambiguities, we use MLAMBDA, a modified LAMBDA method for integer least squares ambiguity determination [34,35].
DD integer ambiguities N(k | k) can be used to update N(k | k). However, the EKF performance may be degraded if unreliable N(k | k) is used to update N(k | k). Thus, before using N(k | k) to update N(k | k), there is a need to test the reliability of the DD integer ambiguities N(k | k).
The following approach is used to test the reliability of DD integer ambiguities N(k | k).
• Initialization: Set a predefined threshold for the ratio test: > 0, e.g., = 0.5. Set a predefined maximum count n max , e.g., n max = 5. Set counter n(0) = 0. • Step 1: For each epoch k, requesting the MLAMBDA to output two sets of the DD integer ambiguities. With the request, MLAMDA will return one group of the best estimates and one group of the second-best of the DD integer ambiguities and together with the corresponding residuals, say r 1 (k) and r 2 (k). • Step 2: Calculate the ratio of r 1 (k)/r 2 (k), and compared it with a predefined threshold . The smaller r 1 (k)/r 2 (k) indicates that the best DD integer ambiguities estimates and the second-best estimates are close. If r 1 (k)/r 2 (k) < , the counter n(k) is increased by 1, i.e., n(k) = n(k − 1) + 1. Otherwise, set n(k) = 0. • Step 3: If n(k) > n max , declared that the N(k | k) is reliable DD integer ambiguity resolution. Once reliable DD integer ambiguity resolution N(k | k) is obtained, it can be used to update the EKF.

Interaction with the Pre-Processing Measurement Block
Before each EKF operation, the EKF needs to adjust the state variables and covariance matrices based on TOA and carrier phase measurements.
If at time t = t k , it is detected that there is a cycle slip for the phase measurements from i-th cell, the corresponding state, and covariance of the cell need to be reset. N ij ru can be reset based on the TDOA measurementT ij r and the SD carrier phase measurement Φ ij r . The diagonal element P(k|k) corresponding to N ij ru will be set based on the maximum assumed integer ambiguities measurement error.
Suppose at time t = t k , the measurements associated with an existing i-th cell are no longer available. In that case, the corresponding state N ij ru needs to be removed from EKF, and so the elements of covariance matrix P(k|k) related the N ij ru . The dimension of the EKF will be reduced correspondingly.
If t = t k , the measurements associated with a new cell are available, the EKF will add a new state of integer ambiguity for that cell. The corresponding state of the cell is calculated based on the TDOA measurementT ij r and the SD carrier phase measurement Φ ij r . The diagonal element of P(k|k) corresponding to N ij ru will be set based on the maximum assumed integer ambiguities measurement error. Figure 2 shows the signal processing diagram for the real-time kinematic positioning based on TOA and carrier phase measurements.

Numerical Results
In this paper, MATLAB is used to verify the algorithm. Furthermore, one PRS subframe is used in each PRS positioning occasion. Perfect muting is assumed in the simulation. The positioning scene is shown in Figure 3, where six BSs are regularly distributed in the building, and the reference device is located in the center of the scene. In the simulation, it is assumed that there is a synchronization error in Network. Therefore, there are timevarying synchronization errors at the BS side and the terminal side. The detailed simulation parameters are listed in Table 1. For other parameters including the number of multipath in the indoor scenarios, the criteria for generating LOS/NLOS, and the path loss, please refer to [36]. In the simulation, moving speed of the terminal is 1 m/s, and the position solution interval is 0.1 s. The terminal moves according to a specific track in which the length is 60 m, and the number of sampling epoch is 600. High accuracy localization using the carrier phase requires a fast and accurate solution of the integer ambiguity. Therefore, we use the following perspectives to evaluate the effectiveness of the algorithm: • The accuracy and convergence speed of the integer ambiguity. • The terminal that can judge whether the solved integer ambiguity is reliable or not. Equation (25) shows that the SD carrier phase measurement Φ ij r contains the DD integer ambiguity N ij ru . Therefore, we use the DD integer ambiguity for performance comparison. Define the integer ambiguity estimation error as: Figure 4 illustrates the four DD integer ambiguity estimation errors. When e N = 0, it represents that the estimated integer ambiguity is the same as the actual ambiguity. Furthermore, the first BS is used as the reference BS in our experiment. All integer ambiguity errors were significant at epoch 0 due to the sizeable initial position estimation error. In the 92nd epoch, BS21, BS41, and BS51 all estimate the integer ambiguity correctly and remain unchanged in the subsequent epochs; BS31 always has an error of 1 circle during the experiment. The mistake of BS31 did not affect the localization accuracy because the other integer ambiguities were correctly estimated.   Figure 5 shows the ratio test was used to check whether the DD integer ambiguities output by the EKF are reliable at the current epoch. The dashed line represents the preset threshold = 0.5. After the 113th epoch, the reliability rates are all below the threshold. Therefore the algorithm determines that the obtained integer ambiguities are reliable after the 113th epoch. Combined with Figure 4, it can be seen that it is valid to use the ratio test to determine whether the DD integer ambiguities converge to the actual value. We evaluate the performance of the 'TOA+CP EKF' based differential positioning method as in Figure 6. In addition, we also list two other cases for comparison, wherein 'GMM EKF' [31] is a method to perform positioning solution by TDOA measurement, which eliminates the NLOS error by model NLOS propagation as Gaussian mixture model; 'EKF' [32] represents a commonly used EKF location algorithm based on TDOA measurement. To eliminate the effect of clock errors, all three algorithms mentioned above use TDOA obtained from Equation (25) instead of TOA for positioning, and the algorithm proposed in this paper also requires SD carrier phase measurements. Figures 6 and 7 show the performance of the three algorithms during mobile localization. Since all three algorithms use differential measurements for position solving, it can be seen from the results that the time-varying synchronization errors do not affect the positioning accuracy. At the initial epoch, the accurate integer ambiguity has not been solved, so the carrier phase measurement is difficult to determine the initial position. Therefore, initial positions of all three algorithms are calculated from the Chan algorithm [33] using TDOA measurements. It can be seen from Figures 6 and 7 that in the first few epochs, the positioning error of 'TOA+CP EKF' is significant, which is caused by the inaccurate integer ambiguity. In subsequent periods, as the algorithm correctly fix the integer ambiguity, the positioning error gradually decreases. Furthermore, the carrier phase measurement is not limited by the system sampling rate, which, combined with the correct integer ambiguity, makes the carrier phase algorithm suitable for scenarios with high accuracy requirements. Comparatively, both 'GMM EKF' and 'EKF' use only TDOA for user position tracking, which leads to lower positioning accuracy.
The CDFs for the localization error from both methods are shown in Figure 8. The 'TOA+CP EKF' method has the best performance, with 90% of the horizontal positioning errors within 0.27 m. Therefore, the carrier phase-based localization technique can meet the high accuracy localization requirements. The 'GMM EKF' method has the middle performance due to the algorithm using TDOA for user location tracking and NLOS elimination. Since the system sampling rate limits the TDOA measurement resolution, the positioning accuracy is low. 'EKF' method has the worst performance because it only uses the TDOA and has limited effectiveness in eliminating NLOS error. We simulated the localization accuracy of this algorithm with the different number of BSs. In our experiments, as shown in Figure 9, we set the length of the indoor scenario to 100 m and the width to 20 m. Furthermore, the coordinates of the six BSs are   Figure 10, it can be seen that the localization accuracy of the algorithm proposed in this paper decreases as the number of BSs decreases. The decrease in the number of available BSs leads to a more extended solution period for the integer ambiguity and thus decreases the localization accuracy. In addition, compared with Figure 8, the decrease in LOS probability does not cause severe degradation of the localization accuracy, so the NLOS error suppression scheme proposed in this paper is effective.

Conclusions
The main research direction of this paper is to apply carrier phase technology in OFDM systems to improve ranging and positioning accuracy. Compared with single-point positioning using only TOA measurement, carrier phase information is more accurate than TOA measurement, and it is a possible choice for indoor high-precision positioning. This paper intends to solve two problems of indoor carrier phase positioning: 1. Phase measurements in a multipath environment. 2. Fast and precise integer ambiguity resolution in real-time positioning scenarios. First, this paper analyzed the effect of multipath propagation on phase measurement in detail, and proposed a correlation profile-based carrier phase measurement method. Second, this paper presents an EKF algorithm to estimate the integer ambiguity by the SD carrier and TDOA measurements. In addition to the integer ambiguity estimation, the algorithm also considers the effect brought by NLOS error. Experiments show that the algorithm proposed in this paper can quickly find the integer ambiguity and virtually eliminate the NLOS error, thus improving the positioning accuracy.

Conflicts of Interest:
The authors declare no conflict of interest.