## 3 Proposed Algorithm
### Alternating Minimization  
As the search volume for exhaustive search through Equation (13) is too large. We need to simplify the objective function. As we all know, the unconstrained full-digital precoding matrix \(\text{F}_{\text{opt}}\), which is the first \(\text{N}_{\text{s}}\) volumes of the right singular matrix of the channel matrix H, is the precoding matrix with the best theoretical spectral efficiency. Therefore, the design problem of the analog and digital precoding matrix can be written as:  
\[ \begin{array}{ll}\min_{\mathrm{F,B}}&\left\|\mathrm{F_{opt}-F\mathrm{B}} \right\|_{\mathrm{F}}^{2}\\ \mathrm{s.t.}&\left\|\mathrm{F_{i,}}\right\|_{0}=1,\ \ \forall\mathrm{i}\\ &\left|\mathrm{F_{i,j}}\right|=1_{\mathrm{Sj}}(\mathrm{i}),\ \ \ \forall\mathrm{i,j}\\ &\left\|\mathrm{F\mathrm{B}}\right\|_{\mathrm{F}}^{2}=\mathrm{N_{s}}\\ \end{array}  \tag{14}\]  
We use an alternating minimization method to decompose problem (14) into two sub-problems alternately: given analog precoder F, design digital precoder B; given digital precoder B, design analog precoder F. We do this iteratively until the value of the objective function of problem (14) increases compa with the previous iteration, then the analog and digital precoder obtained in the previous iteration will be taken as the optimal solution. The specific iteration process is as follows:  
Given the analog precoder F, the digital precoder can be directly calculated through the least squares method and normalized:  
\[\mathrm{B}=\frac{\sqrt{\mathrm{N_{g}}}\mathrm{F^{\dagger}}\mathrm{F_{opt}}}{ \left\|\mathrm{FF^{\dagger}}\mathrm{F_{opt}}\right\|_{\mathrm{F}}} \tag{15}\]  
Given digital precoder B, as the zero norm of each row of the analog precoder F in the given constraints is 1, the objective function of Formula (14) can be expanded as:  
\[\min_{1\leq j\leq N_{\mathrm{r}}^{\mathrm{t}}}\sum_{i=1}^{\mathrm{N_{t}}}\left[ \left(\mathrm{F_{opt,i}}-\mathrm{F_{ij}}\mathrm{B_{j,1}}\right)^{2}+\left( \mathrm{F_{opt,2}}-\mathrm{F_{ij}}\mathrm{B_{j,2}}\right)^{2}+\cdots+\left( \mathrm{F_{opt,N_{\mathrm{s}}}-F_{ij}}\mathrm{B_{j,N_{s}}}\right)^{2}\right] \tag{16}\]  
where \(\mathrm{F_{ij}}\) denotes the element in the i-th row and the j-th column of F. Formula (16) calculates the non-zero elements of F row by row. It can be found that Formula (16) is a unary quadratic model and has a minimum value. So, the value of \(\mathrm{F_{ij}}\) can be directly calculated and normalized to meet the constraints:  
\[ \begin{array}{ll}\mathrm{a_{ij}}=\frac{\mathrm{F_{opt,i}}}{\mathrm{B_{j,1} }+\mathrm{F_{opt,i}}}\mathrm{B_{j,2}+\cdots+\mathrm{F_{opt,N_{\mathrm{s}}}} \mathrm{B_{j,N_{s}}}}\\ \mathrm{F_{ij}}=\frac{\mathrm{a_{ij}}}{\left|\mathrm{a_{ij}}\right|},\mathrm{ i}=1,2,\ldots,\mathrm{N_{t}},1\leq\mathrm{j}\leq\mathrm{N_{rf}^{t}}\\ \end{array}  \tag{17}\]  
where \(\mathrm{a_{ij}}\) is a virtual variable. Combine Formulas (16) and (17) to design the analog precoder. The above is the process of the alternating minimization solution, and the algorithm flow is summarized in Algorithm 1. ```
0:\(\mathrm{F_{0}}\),\(\mathrm{F_{opt}}\)
0:\(\mathrm{F,B}\) Initialization: In the first iteration, set \(\mathrm{F}=\mathrm{F_{0}}\), calculate \(\mathrm{B}=\frac{\sqrt{\mathrm{N_{c}}}\mathrm{F^{\dagger}}\mathrm{F_{opt}}}{ \left\|\mathrm{FF^{\dagger}}\mathrm{F_{opt}}\right\|_{\mathrm{F}}}\), \(\mathrm{target}=\left\|\mathrm{F_{opt}}-\mathrm{F\mathrm{B}}\right\|_{\mathrm{F }}^{2}\), \(\mathrm{delta}=0\). 1:whiledelta \(\geq 0\)do

* Given \(\mathbf{B}\), solve problem (14) by solving problem (16) to obtain \(\mathbf{F}\) in (17) row by row. * Given \(\mathbf{F}\), solve problem (14) to obtain \(\mathbf{B}\) in (15). * Set \(\mathrm{delta}=\mathrm{target}-\left\|\mathrm{F_{opt}}-\mathrm{F\mathrm{B}} \right\|_{\mathrm{F}}^{2}\). * Update \(\mathrm{target}=\left\|\mathrm{F_{opt}}-\mathrm{F\mathrm{B}}\right\|_{\mathrm{F }}^{2}\). 2:returnF,B
```  
**Algorithm 1** Alternating Optimization Of Hybrid Precoding Matrix.