# A Novel Time Delay Estimation Algorithm for 5G Vehicle Positioning in Urban Canyon Environments
## 2 System Model
### 5G Baseband Signal Model  
According to 3 GPP New Radio (NR) Technical Specification (TS) 38.211 [32], the downlink signal of 5G is generated based on cyclic prefix orthogonal frequency division multiplexing (CP-OFDM), and it is obtained by a stepwise procedure illustrated in Figure 2 and described below. First, pseudo-random sequences are generated by a sequence generation module. Then, the pseudo-random sequence is mapped with the QPSK symbol to get a 5G reference signal sequence, and the reference signal sequence is mapped to resource elements in different ways according to different uses. Then, inverse fast Fourier transform (IFFT) is carried out on the resource elements to generate 5G time-domain signal, and the baseband signal is generated through cyclic prefix and digital-to-analog (D/A) conversion. The pseudo-random sequence in TS38.211 adopts the 31-length gold code, which is generated as follows:  
\[ \begin{split} c(n)=(x_{1}(n+N_{C})+x_{2}(n+N_{C}))\text{mod}\,2\\ x_{1}(n+31)=(x_{1}(n+3)+x_{1}(n))\text{mod}\,2\\ x_{2}(n+31)=(x_{2}(n+3)+x_{2}(n+2)+x_{2}(n+1)+x_{2}(n))\text{mod}\,2 \end{split}  \tag{1}\]  
where \(N_{C}=1600\), the initialization of first gold sequence \(x_{1}(n)\) is \(x_{1}(1)=1\), \(x_{1}(n)=0\), \(n=1,2,\ldots,30\), and the initialization of the second gold sequence \(x_{2}(n)\) is \(c_{init}=\sum_{i=0}^{30}x_{2}(i)\cdot 2^{i}\), \(c_{init}\) depends on the purpose of the reference signal and mod2 is modulo-2 addition. The reference signal sequence \(r(m)\) is mapped by QPSK symbols from the 31-length gold sequence in the following way:  
\[r(m)=\frac{1}{\sqrt{2}}(1-2c(2m))+j\frac{1}{\sqrt{2}}(1-2c(2m+1)), \tag{2}\]  
The generation method of 5G baseband signal in 3 GPP TS38.211 is defined by  
\[ \begin{split} s_{l}^{(p,\mu)}(t)=\Bigg{\{}\begin{array}{ll} \bar{s}_{l}^{(p,\mu)}(t)&t_{\text{start},l}^{\mu}\leq t<t_{\text{start},l}^ {\mu}+T_{\text{symb},l}^{\mu}\\ 0&\text{otherwise}\end{array}\\ \bar{s}_{l}^{(p,\mu)}(t)=\sum_{k=0}^{N_{\text{grid},k}^{\text{size},\mu}N_{ \text{sc}}^{\text{RB}}-1}a_{k,l}^{(p,\mu)}e^{2\pi\Big{(}k+k_{0}^{\mu}-N_{ \text{grid},k}^{\text{size},\mu}N_{\text{sc}}^{\text{RB}}/2\Big{)}\Big{)} \Big{(}t-N_{\text{CP}}^{\mu}T_{\text{c}}-t_{\text{start},l}^{\mu}\Big{)}}\\ k_{0}^{\mu}=\Big{(}N_{\text{grid},x}^{\text{start},\mu}+N_{\text{grid},x}^{ \text{size},\mu}/2\Big{)}N_{\text{sc}}^{\text{RB}}-\Big{(}N_{\text{grid},x}^{ \text{start},\mu\mu_{0}}+N_{\text{grid},x}^{\text{size},\mu_{0}}/2\Big{)}N_{ \text{sc}}^{\text{RB}}2^{\mu_{0}-\mu}\\ tT_{\text{symb},l}^{\mu}=\Big{(}N_{\text{u}}^{\mu}+N_{\text{CP},l}^{\mu}\Big{)}T_ {\text{c}},\end{split}  \tag{3}\]  
where \(s_{l}^{(p,\mu)}(t)\) is the time-continuous signal on antenna port \(p\) and subcarrier spacing configuration \(\mu\) for OFDM symbol \(l\in\Big{\{}0,1,\ldots,N_{\text{slot}}^{\text{subframe},\mu}N_{\text{symb}}^ {\text{slot}}-1\Big{\}}\) in a subframe. \(N_{\text{grid},x}^{\text{size},\mu}\) is the size of the resource grid, \(N_{\text{grid},x}^{\text{start},\mu}\) is the start of the resource grid, \(N_{\text{sc}}^{\text{RB}}\) is number of subcarriers per resource block, \(a_{k,l}^{(p,\mu)}\) is the value of resource element \((k,l)\) for antenna port \(p\) and subcarrier spacing configuration \(\mu\), \(N_{\text{CP},l}^{\mu}\) is cyclic prefix length, \(T_{\text{c}}\) is basic time unit for NR, \(\mu_{0}\) is the largest \(\mu\) value among the subcarrier spacing configurations. Some of the configuration parameters are used for coordinate with other reference signals in 5G, and their values do not affect the waveform of the 5G positioning reference signal. Figure 2: The procedure of 5G baseband signal generation. In order to facilitate the verification of the algorithm in this paper, we simplify the generation method of a 5G baseband signal, remove configuration parameters which are used for coordinate with other reference signals, and retain necessary parameters to generate 5G signal waveform.