# A Novel Time Delay Estimation Algorithm for 5G Vehicle Positioning in Urban Canyon Environments
## 3 Methodology
### LOS/NLOS Identification and NLOS Cancellation  
The received signal is cross-correlated, and the result of discrete cross-correlation under multi-path transmission is as follows:  
\[R_{A}(\tau)=\sum_{n=0}^{K_{A}-1}\Big{[}s_{T}(n-\tau)s_{R}^{*}(n)\Big{]}=\sum_{n=0 }^{K_{A}-1}\Bigg{[}s_{T}(n-\tau)\sum_{i}^{K}s_{T}^{*}(n-\tau_{i})\Bigg{]}, \tag{18}\]  
\[K_{A}=K_{R}+K_{T}-1, \tag{19}\]  
where the \(K_{R}\) is the length of discrete received baseband signal, \(K_{T}\) is the length of discrete transmit baseband signal, and \(K_{A}\) is the length of cross-correlation result of the transmit signal and received signal. Then, the peak of the discrete cross-correlation result was searched based on gradient to roughly estimate the multipath time delay. The gradient of cross-correlation result is:  
\[G_{A}(\tau)=R_{A}(\tau)-R_{A}(\tau-1), \tag{20}\]  
The \(G_{A}(\tau)\) is the gradient of cross-correlation result, the roughly time delay estimation result is:  
\[\tau_{i}=\underset{\tau}{\arg}[G_{A}(\tau-1)>0\wedge G_{A}(\tau)<0\wedge R_{A }(\tau)\geq P_{T}]\Big{(}i=1,2,\ldots,M_{p}\Big{)}, \tag{21}\]  
where \(\tau_{i}\) is the roughly time delay estimation result, \(P_{T}\) is the threshold of the search of cross-correlation, the peak value less than this threshold is not regarded as multipath delay, and \(M_{p}\) is the number of multipath time delay. The corresponding correlation peak value of each multipath delay is:  
\[P_{i}=R_{A}(\tau_{i})(i=1,2,\ldots,M_{p}), \tag{22}\]  
After obtaining the multipath time delay estimation of received signal and the corresponding correlation peak, NLOS/LOS identification can be conducted. The identification principle is: if the correlation peak with the minimum time delay is not the maximum correlation peak, it means that the signal has been propagated by NLOS. For LOS component which is weaker than the NLOS components, the peak of the LOS path can be detected by correlation, but after using the conventional MUSIC algorithm, the peak of the LOS path is submerged by the peak of the NLOS path. This phenomenon can be seen in Figure 1, where the power of the LOS path is not very weak, but the LOS path in the spectral function of the conventional MUSIC algorithm is severely affected by the NLOS path, and the peaks are submerged and the LOS path cannot be identified, so the NLOS component needs to be cancelled. The way of NLOS cancel is to reconstruct the non-direct path signal. The method of reconstruction of non-direct path signal is as follows.  
\[s_{NLOS}=\sum_{i=1}^{M_{p}-1}Am_{i+1}s_{T}(n-\tau_{i+1}), \tag{23}\]  
where \(s_{NLOS}\) is the non-direct path signal, \(Am_{i}\) is the amplitude loss of each non-direct path signal component, and the calculation method is as follows:  
\[Am_{i}=\frac{R_{A}(\tau_{i})}{\max\left[\sum_{n=0}^{K_{A}-1}s_{T}(n-\tau)s_{ T}^{*}(n)\right]}, \tag{24}\]  
Received signal minus the reconstruction of the non-direct path signal can get NLOS cancelled signal \(s_{NC}(n)=s_{R}(n)-s_{NLOS}(n)\). There are residual non-direct path signals component because the cross-correlation method is not accurate for time delay estimation, and a second or multiple NLOS cancellations can be applied by Equations (20)-(24). However, after repeated cancellations,the correlation peak of weak signal delay will be confused with the side peak of OFDM signal correlation, which will lead to greater error. The experimental part will give a comparative analysis of cancellation times and ranging accuracy. The next subsection mainly describes the covariation matrix and eigenvalue calculation. In order to simplify the description of the algorithm, the signals cancelled by different cancellation times are denoted as \(s_{\text{NC}}\).