# High-Precision Ranging Method of 5G NR Co-Band PRS in Industrial Internet Scenarios
## 3 Proposed Timing Recovery Scheme
### Coarse Synchronization Solution  
For coarse synchronization of the signal, a CP-based timed symbol synchronization method can be used, which exploits the repetitive characteristics of the CP [26]. Also, to mitigate the influence of the CFO, the coarse synchronization scheme is implemented by  
\[\delta=\arg\max_{n}\sum_{i=0}^{N_{CP}-1}|y[n+i]y^{*}[n+i+N]|-\frac{\varrho}{2} \sum_{i=0}^{N_{CP}-1}\left([y[n+i]|^{2}+|y[n+i+N]|^{2}\right) \tag{10}\]  
\[\xi=-\frac{1}{2\pi}\arctan\left(y[\delta+i]y^{*}\left[\delta+i+N]\right) \tag{11}\]  
Figure 2: The proposed 5G NR Co-band PRS reception framework.  
where \(\delta\) and \(\hat{\epsilon}\) denote the estimated value of the signal STO and CFO, respectively. In addition, \(\rho=\text{SNR}/(\text{SNR}+1)\)[27]. It is worth noting that at this point, the minimum granularity of \(\delta\) is one sampling unit, while \(\hat{\epsilon}\) can be used to compensate for the residual CFO.  
However, in the actual sampling process, it is inevitable to truncate the time domain signal with a long sampling time into blocks of data of frame-by-frame length. To avoid spectral leakage caused by non-integer period truncated signals, it is common practice to apply a windowing function to the signal. 5G NR uses a rising cosine roll-off windowing function for each OFDM symbol in subframes, as shown in Figure 3 below.  
Due to the presence of the window function, the window paraflap of the latter symbol overlaps with the tail of the previous symbol, resulting in a significant bias in the CP-based STO estimation method. Therefore, the existing method needs to incorporate weighted corrections, and the weighted function is set as  
\[w_{n,e}[i]=\begin{cases}1&i\leq n-e\\ 0.5\Big{(}1-\frac{\sin(\pi(e+1-2(n-i+1)))}{2e}\Big{)}&other\end{cases} \tag{12}\]  
where \(n\) denotes the signal truncation length and \(e\) denotes the window length. The coarse synchronization scheme was amended by  
\[\delta=\arg\max_{n}\sum_{i=0}^{N-1}|y[n+i]w_{n,e}[i][n+i+N]|-\frac{\rho}{2} \sum_{i=0}^{N-1}\Big{(}|y[n+i]w_{n,e}[i]|^{2}+|y[n+i+N]|^{2}\Big{)}. \tag{13}\]  
Next, we need to obtain location-assisted information such as the physical layer cell ID \(N_{ID}^{cellI}\), subcarrier spacing, and the starting position of the PRS in the resource grid (referred to as PointA) via the SSB. Since this part usually occurs during the initial network search process in the UE, there is no additional overhead for the UE. The specific process is as follows. The UE first searches for the primary synchronization signal (PSS) and secondary synchronization signal (SSS) to determine the center frequency and physical cell ID (PCI) of the SSB. Then, the subcarrier frequency offset of the SSB (i.e., kSSB) and the physical downlink control channel (PDCCH) carrying the scheduling information, which determines the time-frequency location of control-resource set (CORESET), are obtained via PBCH. Finally, the PointA and system bandwidth are obtained by monitoring system information block 1 (SIB1).  
In addition, the current PSS/SSS signals of 5G NR are generated by m-Sequence of length bit 127, where PSS is determined by \(N_{ID,2}^{\text{SL}}\in\{0,1...335\}\) and SSS is determined jointly by \(N_{ID,1}^{\text{SL}}\in\{0,1,2\}\) and \(N_{ID,2}^{\text{SL}}\in\{0,1...335\}\). The corresponding cell ID is determined by  
\[N_{ID}^{cellI}=N_{ID,1}^{SL}+3N_{ID,2}^{SL} \tag{14}\]