## 4 Ultrasonic-Assisted RIS Phase Shift Matrix Design Based on Subspace Self-Organizing Iterations
### RIS Initial Phase Shift Matrix Solving Based on Ultrasonic-Assisted PF Algorithm
As shown in (44), we can see that the matrix is orthogonal to the noise subspace, so we can construct the following spectral function:  
\[\Phi(\boldsymbol{\phi}_{m}(k))=\frac{1}{\boldsymbol{\Psi}^{H}(k)\boldsymbol{ \Gamma}^{H}\boldsymbol{\Psi}(k)} \tag{45}\]It can be seen that the matrix \(\mathbf{\Gamma}\) contains the observed information, while the angular information \(\mathbf{\vartheta}_{m}(k)\) contains priori information, so the spectral function in (39) can be used to improve the likelihood function and update the particle weights; the likelihood function in (38) can be expressed as  
\[\widetilde{P}(\mathbf{\hat{Y}}^{\prime}(k)|\varsigma_{i}(k))=\Phi(\mathbf{ \vartheta}_{m}(k)) \tag{46}\]  
In this algorithm, the prior distribution \(P(\varsigma_{i}(k)|\varsigma_{i}(k-1))\) is obtained according to the state transition model \(\mathbf{\aleph}(k)\)  
\[P(\varsigma_{i}(k)|\varsigma_{i}(k-1))=f\left\{\sum\limits_{j=1}^{J}\left( \mathbf{\aleph}_{j}(k)\frac{p_{j}^{*}(\mathbf{\aleph}_{j}(k))}{\sum\limits_{j= 1}^{J}p_{j}^{*}(\mathbf{\aleph}_{j}(k))}\right)\right\} \tag{47}\]  
where \(\mathbf{\aleph}_{j}(k)\) is the \(j\)-th possible motion state of the vehicle at the moment \(k\), \(J\) is the total number of motion states, \(p_{j}^{*}(\mathbf{\aleph}_{j}(k))\) is the probability of this state occurring, and \(f(\cdot)\) is the mapping relationship. Equation (47) updated the results \(\mathbf{\aleph}_{j}(k)\) in real time by continuously updating the particle weights based on the measurement model and the state transition model. The particle \(\varsigma_{i}(k)\) is updated by the prior distribution  
\[\varsigma_{i}(k)\sim P(\varsigma_{i}(k)|\varsigma_{i}(k-1)) \tag{48}\]  
The formula for calculating the particle weights in the update phase is expressed as  
\[\overline{w}_{i}(k) =\overline{w}_{i}(k-1)\frac{P(\mathbf{\hat{Y}}^{\prime}|\varsigma _{i}(k))P(\varsigma_{i}(k)|\varsigma_{i}(k-1))}{P(\varsigma_{i}(k)|\varsigma_ {i}(k-1))} \tag{49}\] \[=\overline{w}_{i}(k-1)P(\mathbf{\hat{Y}}^{\prime}|\varsigma_{i}( k))\]  
The normalized weight is expressed as  
\[\hat{w}_{i}(k)=\frac{\overline{w}_{i}(k)}{\sum\limits_{i=1}^{J}\overline{w}_{ i}(k)} \tag{50}\]  
After a series of iterations, some particles that tend to degenerate are generated, i.e., the weights of the particles become very small. To solve this problem, it is necessary to resample at the appropriate time. The number of particles should be kept constant and the weight of each particle rescaled to its initial value \(1/\rho\). Let \(\psi_{q}(k)\) be a one-dimensional DOA result, and the angular transformation relation with two-dimensional DOA is  
\[ \begin{cases}\cos\psi_{q}(k)=\cos\beta_{q}(k)\cos\varphi_{q}(k)\\ \sin^{2}\psi_{q}(k)=\sin^{2}\beta_{q}(k)\cos^{2}\varphi_{q}(k)+\sin^{2}\varphi_ {q}(k)\end{cases}  \tag{51}\]  
Thus, the DOA tracking result of the \(m\)-th ultrasonic array element can be expressed as  
\[\psi_{m}(k)=\sum\limits_{i=1}^{\rho}\hat{w}_{i}(k)\varsigma_{i}(k) \tag{52}\]  
Since the DOA ultrasonic information reflects the relative position relationship between the vehicle and the joint ultrasonic-RIS array, we take the most representative angle in the tracking results and also consider the azimuth information of BS relative to RIS based on the principle of specular reflection; thus, we can obtain a rough phase shift matrix of RIS \(\mathbf{\Phi}_{0}=diag\left[e^{i\varphi_{0}},e^{i\varphi_{0}},\cdots,e^{i\varphi_ {0}}\right]\in\mathbb{C}^{N_{RIS}\times N_{RIS}}\). Then, the vehicle motion state transition model in V2X communication scenario is represented by the following equation  
\[\Re(k+1)=\mathbf{\lambda}\Re(k)+\hbar\overline{n}+\overline{N}(k) \tag{58}\]  
where \(\mathbf{\lambda}\) is the state transfer matrix of vehicle motion, \(\mathbf{\hbar}\) is the control matrix of vehicle motion, and \(\overline{N}(k)\) is the Gaussian noise matrix generated during the vehicle motion. \[\mathbf{\lambda}= \begin{bmatrix}\mathbf{\lambda}&&\\ &1&\tau\\ &&1\end{bmatrix}  \tag{59}\]  
\[\mathbf{\hbar}=