## 4 Phase Shift Optimization
### Delay Spread, Doppler Shift, and Doppler Spread after Phase Shift Optimization  
Based on (29), it is easy to know that if \(k_{i_{m},i_{n}}(t)\in\mathbb{Z}\), then \(\phi_{i_{m},i_{n}}(t)\) can align the phases of direct and cascaded links. Note that \(k_{i_{m},i_{n}}(t)\geq 0\) since \(\tau_{i_{m},i_{n}}(t)\geq\tau_{0}(t)\). Therefore, if\(k_{i_{m},i_{n}}(t)\in\mathbb{Z}_{0}^{+}\) and is larger than or equals to \(f_{c}(\tau_{i_{m},i_{n}}(t)-\tau_{0}(t))\), then the received power can be maximized. \(\mathbb{Z}_{0}^{+}\) is non-negative integer sets. Accordingly, the Doppler spread between the direct and the \(i\)-th RIS links is  
\[D_{0i}(t)=f_{c}\max_{i_{m},i_{n}}\bigg{|}\frac{d}{dt}\bigg{(}\frac{k_{i_{m},i_{ n}}(t)}{f_{c}}+\frac{\gamma_{i_{m},i_{n}}}{2\pi f_{c}}\bigg{)}\bigg{|}, \tag{31}\]  
where \(k_{i_{m},i_{n}}(t)\geq f_{c}(\tau_{i_{m},i_{n}}(t)-\tau_{0}(t))\) and \(k_{i_{m},i_{n}}(t)\in\mathbb{Z}_{0}^{+}\). Based on _Remark 2_, \(\frac{d}{dt}\big{(}\mathbb{E}\big{\{}\gamma_{i_{m},i_{n}}\big{\}}\big{)}=0\), and \(\frac{d}{dt}(k_{i_{m},i_{n}}(t))=0\). Then, \(\mathbb{E}\big{\{}D_{\text{RIS}}(t)\big{\}}=0\). Similarly, \(\mathbb{E}\big{\{}D_{\text{RIS}}(t)\big{\}}=0\) and \(\mathbb{E}\big{\{}D_{i}(t)\big{\}}=0\). Therefore, the Doppler spread of the proposed system with \(K\) RISs with HWI for one vehicle pass is still zero, i.e., \(D(t)=0\). Considering (17) and (29), we have  
\[T_{i}(t)=\max_{i_{m},i_{n}}\bigg{\{}\tau_{i_{m},i_{n}}(t)+\frac{k_{i_{m},i_{n }}(t)}{f_{c}}+\frac{\gamma_{i_{m},i_{n}}}{2\pi f_{c}}\bigg{\}}-\tau_{0}(t). \tag{32}\]  
It can be seen that \(T_{i}(t)\) can be affected by \(k_{i_{m},i_{n}}(t)\) and \(\gamma_{i_{m},i_{n}}\). In other words, the phase shift set and the RIS HWI can increase delay spread. In order to minimize \(T(t)=\max\{T_{i}(t)\}\), \(k_{i_{m},i_{n}}(t)\) should be as small as possible. Therefore, the phase shift set of the \(i\)-th RIS, i.e., the solution of P1 in (30), should be designed as  
\[\Phi_{i_{m},i_{n}}^{\text{opt}}(t)=2\pi\bigg{(}f_{c}\big{(}\tau_{0}(t)-\tau_{i _{m},i_{n}}(t)\big{)}+k_{i_{m},i_{n}}^{\text{opt}}(t)\bigg{)}, \tag{33}\]  
where \(k_{i_{m},i_{n}}^{\text{opt}}(t)=\lceil f_{c}(\tau_{i_{m},i_{n}}(t)-\tau_{0}(t ))\rceil\). Table 4 compares different \(k_{i_{m},i_{n}}(t)\) strategies and shows that \(\Phi_{i_{m},i_{n}}^{\text{opt}}(t)\) in (33) is a promising design of for a phase shift set, although it cannot mitigate the delay spread due to the existence of the direct LoS link. In particular, Strategy I cannot maximize the received power, since the phase shift set with this strategy is not able to align the phases of direct and cascaded links. The phase shift sets with Strategy II and III can maximize the received power and remove the Doppler spread. However, Strategy II cannot minimize the delay spread, since \(k_{i_{m},i_{n}}(t)\) has not been minimized. Algorithm 1 generates the phase shift set \(\phi_{i_{m},i_{n}}^{\text{opt}}(t)\) using PI. Specifically, PI can be used to calculate the distances \(d_{0}(t)\), \(d_{\text{BS}}^{i_{m},i_{n}}\) and \(d_{i_{m},i_{n}}^{N}(t)\) in real time. Then, the time delay \(\tau_{0}(t)\) and \(\tau_{i_{m},i_{n}}(t)\) can be obtained. The phase shift set \(\phi_{i_{m},i_{n}}^{\text{opt}}(t)\) is thus achieved accordingly. It is noteworthy that this algorithm does not include complicated operations such as iterations or alternative optimizations. Therefore, the proposed system has lower computational complexity. \begin{table}
\begin{tabular}{c c} \hline
**Strategy** & **Result** \\ \hline Strategy I \(k_{i_{m},i_{n}}(t)\in\mathbb{R}\), and & \(\text{Cannot}\max\{P_{R}(t)\}\). \\ \(k_{i_{m},i_{n}}(t)\) = \(\lceil f_{c}(\tau_{i_{m},i_{n}}(t)-\tau_{0}(t))\rceil\). & \(\text{Cannot}\max\{P_{R}(t)\}\). \\ Strategy II: \(k_{i_{m},i_{n}}(t)\in\mathbb{Z}\), and & \(\text{max}\{P_{R}(t)\}\), remove \(D(t)\). \\ \(k_{i_{m},i_{n}}(t)\) = \(\lceil f_{c}(\tau_{i_{m},i_{n}}(t)-\tau_{0}(t))\rceil\). & \(\max\{P_{R}(t)\}\), remove \(D(t)\), and \(\min\{T(t)\}\).