# Indoor Carrier Phase Positioning Technology Based on OFDM System
## 2 Ranging System
### High-Precision TOA Estimation Scheme Based on Carrier Phase
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:  
\[H_{k=N/2}^{m}=\frac{h_{1}[nT_{s}]\sin(\pi\dot{\tau}_{1})}{\sqrt{N}\sin(\frac{ \pi}{N}(\dot{\tau}_{1}-n))}\mathrm{e}^{-j\pi\tau_{1}-j\phi_{1}}+w_{N/2}^{m}, \tag{15}\]  
the proof is given in the Appendix A. Therefore the phase at \(k=N/2\) can be written as:  
\[\hat{\phi}=-angle\left(e^{-j\pi\dot{\tau}-j\dot{\phi}_{1}-\dot{\varpi}_{p}} \right);0\leq\hat{\phi}\leq 2\pi, \tag{16}\]  
here, \(\dot{\varpi}_{p}\) is the phase noise caused by \(w_{N/2}^{m}\). Due to the trigonometric function properties, the part beyond \(2\pi\) 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 on \(\dot{\tau}_{1}=N\Delta f_{\mathrm{SCS}}\tau_{1}[nT_{s}]\) and \(\phi_{1}=2\pi f_{c}\tau_{1}[nT_{s}]\), the phase-based ranging can be written as:  
\[\hat{\phi}+2\pi N_{\mathrm{I}}=\pi N\Delta f_{\mathrm{SCS}}\tau_{1}[nT_{s}]+2 \pi f_{c}\tau_{1}[nT_{s}]+\hat{\varpi}_{p}, \tag{17}\]  
Figure 1: Power delay profile. here, \(N_{\text{I}}\) is the unknown integer ambiguity. Divide Equation (17) by \(2\pi\) and simplify the equation:  
\[ \begin{split}\phi&=\frac{N}{2}\Delta f_{\text{SCS}} \tau_{1}[nT_{s}]+f_{c}\tau_{1}[nT_{s}]-N_{\text{I}}+w_{P}\\ &=\frac{d}{\lambda}-N_{\text{I}}+w_{P},\end{split}  \tag{18}\]  
here, \(\phi=\frac{\phi}{2\pi}\) is the normalized phase measurement, \(w_{P}=\frac{\psi_{P}}{2\pi}\) is the normalized phase noise, \(d=c\tau_{1}[nT_{s}]\) is the geometric distance between the antennas of transmitter and receiver, \(\lambda=\frac{c}{f_{c}+\frac{N}{2}\Delta f_{\text{SCS}}}\) is the equivalent wavelength. Further, introducing terminal \(r\) and the BS \(i\), we have:  
\[\phi_{r}^{i}=\frac{d_{r}^{i}}{\lambda}-N_{r}^{i}+w_{r,P}^{i}. \tag{19}\]  
* \(\phi_{r}^{i}\) (known) is the carrier phase measurement (unit: carrier circle). * \(\lambda\) (known) is the wavelength calculated from \(c\), \(f_{c}\), \(N\), and \(\Delta f_{\text{SCS}}\), (unit: m). * \(N_{r}^{i}\) (unknown) is the integer ambiguity (unit: carrier circle). * \(w_{r,P}^{i}\sim\mathcal{N}\left(0,\tilde{\sigma}_{r,i}^{2}\right)\) (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.