# Indoor Carrier Phase Positioning Technology Based on OFDM System
## 2 Ranging System
### 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:  
\[H^{m}(k)=\sum_{l=1}^{L_{p}}h_{l}[nT_{s}]\mathrm{e}^{-j2\pi\frac{k-1}{N}\hat{ \tau}_{l}-j\phi_{l}}+w_{k}^{m}, \tag{11}\]  
where \(\hat{\tau}_{l}=N\Delta f_{\mathrm{SCS}}\tau_{l}[nT_{s}]\) is the transmission delay in units of sampling interval. \(\phi_{l}=2\pi f_{c}\tau_{l}[nT_{s}]\) is the phase shift caused by free-space propagation. 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]:  
\[h_{n}^{m}=\frac{\sin(\pi\hat{\tau}_{l})}{\sqrt{N}\sin\left(\frac{\pi}{N}(\hat{ \tau}_{l}-n)\right)}\sum_{L_{p}}h_{l}[nT_{s}]e^{-j\frac{\pi}{N}(n+(N-1)\hat{ \tau}_{l})-j\phi_{l}}. \tag{12}\]  
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 \([\hat{\tau}_{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: for \(n\in[[\hat{\tau}_{1}]-\frac{W}{2},[\hat{\tau}_{1}]+\frac{W}{2}]\), \(\hat{h}_{n}^{m}=h_{n}^{m}\), else \(\hat{h}_{n}^{m}=0\). Furthermore, \(W\) is the length of the window. 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:  
\[\left\{ \begin{array}{l}\bar{h}_{n}^{m}=\frac{h_{1}[nT_{s}]\sin(\pi t_{1})}{\sqrt{N }\sin(\frac{\pi}{N}(\tau_{1}-n))}e^{-j\frac{\pi}{N}(n+(N-1)\tau_{1})-j\phi_{1}}, n=[\tau_{1}]\\ \bar{h}_{n}^{m}=0,n\in\mathcal{N}_{[\tau_{1}}\end{array} \right., \tag{13}\]  
here, \(\mathcal{N}_{[\tau_{1}}=\{1,2,[\tau_{1}]-1,[\tau_{1}]+1,\cdots,N\}\). The frequency domain channel response after the window function can be written as:  
\[H_{k}^{m}=\frac{h_{1}[nT_{s}]\sin(\pi t_{1})e^{-j\frac{\pi}{N}([\tau_{1}]+(N-1 )\tau_{1})-j\phi_{1}-j\pi\frac{[\tau_{1}]}{N}k}}{\sqrt{N}\sin(\frac{\pi}{N}( \tau_{1}-[\tau_{1}]))}. \tag{14}\]  
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^{-j\pi\frac{[\tau_{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\frac{\pi}{N}([\tau_{1}]+(N-1)\tau_{1})}\). Furthermore, the sign of \(\frac{\sin(\pi t_{1})}{\sin(\frac{\pi}{N}(\tau_{1}-[\tau_{1}]))}\) will also affect the phase of sub-carriers.