## 6 Modified Unitary R-D Root MUSIC
Moreover, to reduce memory consumption, the implemented solution just needs to store the diagonal of \(\mathbf{O}^{-1}\) as a column vector and compute the element-wise (Hadamard product) of that vector with \(\mathbf{h}_{ss}(t)\) defined in Equation (32). More specifically, let \(\mathbf{d}= \begin{bmatrix}z^{0}&z^{1}&\ldots&z^{2M-2}\end{bmatrix} ^{T}\) be the cited column vector, since \(\mathbf{h}_{ss}(t)\circ\mathbf{d}=\mathbf{O}^{-1}\mathbf{h}_{ss}(t)\), the implemented solution calculates \(\mathbf{H}\) by applying the Hadamard product of \(\mathbf{d}\) in each element of \(\mathbf{H}_{ss}\) as shown in Equation (44),  
\[\mathbf{h}(t_{i})=\mathbf{h}_{ss}(t_{i})\circ\mathbf{d}\quad i=1,2,\ldots,N, \tag{44}\]  
replacing Equation (36). Particularly, the computation in Equation (44) is faster than (36), since the RF switch compensation is a matrix in Equation (36), whereas in Equation (44) it is a vector \(\mathbf{d}\). Moreover, Algorithm 1 calculates the RF switch compensation (\(\mathbf{O}^{-1}\)) whose complexity is \(\mathcal{O}(n)\). ```
Input: the carrier frequency offset (\(\Delta f_{c}\)) and time slot (\(\Delta T_{slot}\)) Output: the elements of the diagonal of \(\mathbf{O}^{-1}\) stored in \(\mathbf{d}\). 1 Define \(\mathbf{d}\in\mathbb{C}^{2M-1}\) such that \(\mathbf{d}_{1}\gets 1\) and calculate \(z\gets e^{-j2\pi\Delta f_{c}\Delta T_{2}}\). 2 for\(k=2,\cdots,2M-1\)do
3\(\mathbf{d}_{k}\leftarrow\mathbf{d}_{k-1}z\)
4 end for
```  
**Algorithm 1**computation of the RF switch compensation (\(\mathbf{O}^{-1}\))  
We can compute the two covariance noise subspaces (\(\mathbf{U}_{N,x}\) and \(\mathbf{U}_{N,y}\)) indirectly via their respective signal subspace (\(\mathbf{U}_{S,x}\) and \(\mathbf{U}_{S,y}\)) by Equations (45) and (46) [36],  
\[\mathbf{U}_{N,x}(\mathbf{U}_{N,x})^{H}=\mathbf{I}_{n}-\mathbf{U}_{S,x}(\mathbf{ U}_{S,x})^{H}, \tag{45}\]  
\[\mathbf{U}_{N,y}(\mathbf{U}_{N,y})^{H}=\mathbf{I}_{n}-\mathbf{U}_{S,y}(\mathbf{ U}_{S,y})^{H}. \tag{46}\]  
Remember that the implemented solution only estimates one single DOA, which means, \(d=1\). Thus, the signal subspace is composed of only one eigenvector, which means we can apply the Power Method [37] that only estimates one eigenvector, which is the signal subspace, as proved in the next paragraph. The noise subspace is composed of \(N-1\) eigenvectors corresponding to the smallest eigenvalues. Therefore, if we calculate the covariance noise subspace directly, we would apply an EVD method that computes all eigenvectors and eigenvalues. In addition, computing all of them requires a very complicated and time-consuming algorithm in addition to more memory footprint. Notably, the complexity of the QR Algorithm, a typical method for EVD, is \(6n^{3}+\mathcal{O}(n^{2})\) per iteration [38], not to mention the Hessenberg decomposition that could be performed before the QR Algorithm, and an algorithm to create the noise subspace from the probable unsorted pairs of eigenvalue-eigenvector. However, since they could be unsorted, to construct a noise subspace a reasonable approach seems to apply a sorting algorithm that could have an average complexity between \(\mathcal{O}(n\log(n))\) to \(\mathcal{O}(n^{2})\)[39]. While the Power Method has a complexity of \(\mathcal{O}(n^{2})\) per iteration, it calculates the signal subspace, requires very simple computations, and experimentally we found it converges mostly in four iterations only in our solution. Figure 6 depicts the algorithm overview of the covariance noise subspace computation. The left one computes the covariance directly while its fastest version (the right one) calculates the covariance indirectly via signal subspace. To guarantee the Power Method will converge, the matrix must be diagonalizable, there must exist only one eigenvalue with the greatest absolute value, and it must be a real number [40].