# A New Design of Codebook for Hybrid Precoding in Millimeter-Wave Massive MIMO Systems
## 3 Proposed Joint Codebooks Design Algorithm  
In order to save feedback overhead, the hybrid precoder, calculated at the receiver, needs to feed back to the transmitter after quantization in the FDD system. Consequently, it is vital to design the appropriate hybrid precoder codebook to improve the system performance. According to CoSaMP algorithm, a new joint codebooks design algorithm is introduced and combined with the dictionary learning algorithm to generate the digital precoding matrix and analog precoding matrix at the same time; this algorithm has improved system spectral efficiency compared with existing algorithms. In this paper, we assume that the size of the analog and digital codebook are \(N_{1}\) and \(N_{2}\), respectively. Under the condition that the size of the analog codebook is determined, the number of phase angles that the corresponding phase shifter can achieve is also determined as \(N_{1}\). The nonzero elements of the analog codebook are contained from (3) and the angles are uniformly distributed in the range of \([0,2\pi]\), therefore, the analog codebook can be written as \(\mathcal{F}_{\text{A}}=\left[\mathbf{F}_{1}^{\text{A}},\mathbf{F}_{2}^{\text {A}},\cdots,\mathbf{F}_{N_{1}}^{\text{A}}\right]=\left[\mathbf{a}_{t}\left( \frac{2\pi}{N_{1}}\right),\mathbf{a}_{t}\left(\frac{2\pi}{N_{1}}2\right), \cdots,\mathbf{a}_{t}(2\pi)\right]\). The expression of (7) is equivalent to the problem of sparse signal recovery, except that the variables are different [1]. When the initial analog codebook is determined, the joint optimization problem of \(\mathbf{F}_{\text{RF}}\) and \(\mathbf{F}_{\text{BB}}\) can be converted into the reconstruction problem of the sparse constraint matrix with only one variable, so the optimal problem (7) can be rewritten as the following equivalent problem:  
\[ \begin{split}\widetilde{\mathbf{F}}_{\text{BB}}^{\text{opt}}=& \text{arg}\min_{\mathbf{F}_{\text{BB}}}\left\|\mathbf{F}_{\text{opt}}- \mathbf{F}_{\text{A}}\widetilde{\mathbf{F}}_{\text{BB}}\right\|_{F},\\ \text{s.t.}&\left\|\text{diag}\left(\widetilde{ \mathbf{F}}_{\text{BB}}\widetilde{\mathbf{F}}_{\text{BB}}^{H}\right)\right\|_{ 0}=N_{\text{t}}^{\text{RF}},\\ &\left\|\mathbf{F}_{\text{A}}\widetilde{\mathbf{F}}_{\text{BB}} \right\|_{F}^{2}=N_{\text{s}},\end{split}  \tag{8}\]  
where \(\left\|\text{diag}\left(\widetilde{\mathbf{F}}_{\text{BB}}\widetilde{\mathbf{ F}}_{\text{BB}}^{H}\right)\right\|_{0}=N_{\text{t}}^{\text{RF}}\) is a sparsity constraint and the sparsity of the digital precoding matrix is fixed, which equals to the number of RF chains at the transmitter. When there are only \(N_{\text{t}}^{\text{RF}}\) nonzero rows in the \(\widetilde{\mathbf{F}}_{\text{BB}}\), there are correspondingly only \(N_{\text{t}}^{\text{RF}}\) columns selected in the analog codebook \(\mathbf{F}_{\text{A}}\). Therefore, the digital precoder \(\mathbf{F}_{\text{BB}}\) is the composition of the nonzero \(N_{\text{t}}^{\text{RF}}\) row of \(\widetilde{\mathbf{F}}_{\text{BB}}\), and the analog precoder \(\mathbf{F}_{\text{RF}}\) is composed of the corresponding \(N_{\text{t}}^{\text{RF}}\) column in the \(\mathbf{F}_{\text{A}}\). We can obtain the channel sample matrix from the channel model and then obtain the corresponding optimal unconstrained matrix, so according to Formula (8), we can get the corresponding analog precoder and digital precoder. The paper utilizes dictionary learning to construct analog codebooks and digital codebooks, i.e., the dictionary is firstly fixed to update the sparse matrix, then the sparse matrix is fixed to update the dictionary, the iteration steps are repeated until the dictionary and sparse matrix are optimal.