## 2 System Model
### The Proposed Secure Beam Hybrid Precoding Algorithm: GSVD-Sparsity
Algorithm 3 presents the procedure for solving hybrid precoding using the OMP algorithm. Inspired by the sparsity of the beamspace channel \(\mathbf{H}_{b}\), \(\mathbf{F}_{RF}\) is not limited to being constructed from the dictionary matrix \(\mathbf{A}_{t}\) formed by the array response vectors of the antenna domain channel \(\mathbf{H}\). It can also be constructed from the dictionary matrix \(\mathbf{A}_{t,b}=[\mathbf{a}_{t}(\vec{\phi}_{1}^{t}),\mathbf{a}_{t}(\vec{\phi}_ {2}^{t}),\ldots,\mathbf{a}_{t}(\vec{\phi}_{N_{t}}^{t})]\) formed by the array response vectors of the beamspace channel representation. In the beamspace channel, the number of dominant propagation paths is relatively small, and these dominant paths correspond to higher transmission power. Therefore, the array response vectors \(\mathbf{a}_{t}(\vec{\phi}_{j}^{t})\) corresponding to the AoDs of the \(N_{RF}^{t}\) optimal propagation paths can be selected from \(\mathbf{A}_{t,b}\) to construct \(\mathbf{F}_{RF}\), which is known as the peak search method. Each \(\mathbf{a}_{t}(\vec{\phi}_{j}^{t})\) in \(\mathbf{F}_{RF}\) can form a transmission beam. The angles of these beams are aligned with the \(N_{RF}^{t}\) optimal propagation paths in the beamspace channel, which exhibit significant transmission power. Thus, when \(\mathbf{F}_{BB}\) performs a linear combination of these array response vectors, high transmission efficiency can still be achieved. Similarly, by selecting the array response vectors \(\mathbf{a}_{r}(\vec{\phi}_{i}^{t})\) corresponding to the AoAs of the \(N_{RF}^{r}\) optimal propagation paths from \(\mathbf{A}_{r,b}=[\mathbf{a}_{r}(\vec{\phi}_{1}^{t}),\mathbf{a}_{r}(\vec{\phi} _{2}^{t}),\ldots,\mathbf{a}_{r}(\vec{\phi}_{N_{r}}^{t})]\), \(\mathbf{W}_{RF}\) can be constructed, and \((\mathbf{F}_{RF},\mathbf{W}_{RF})\) can be determined accordingly. ```
Input: optimal digital precoder \(\mathbf{F}_{opt}\); dictionary matrix \(\mathbf{A}_{i}\); number of RF chains \(N_{RF}^{l}\);
1: Initiation \(\mathbf{F}_{RF}=\varnothing\); \(\mathbf{F}_{res}=\mathbf{F}_{opt}\);
2: Iteration for \(i=1:N_{RF}^{l}\) do 1. Projection \(\mathbf{G}=\mathbf{A}_{i}^{H}\mathbf{F}_{res}\); 2. Support set update \(j=\arg_{l=1,\ -,\ \ldots,\ N_{sl}N_{res}}(\mathbf{G}\mathbf{G}^{H})_{l,j}\); \(\mathbf{F}_{RF}=\left[\mathbf{F}_{RF}\middle|\mathbf{A}_{i}^{(j)}\right]\); 3. Least squares \(\mathbf{F}_{BB}=\left(\mathbf{F}_{RF}^{H}\mathbf{F}_{RF}\right)^{-1}\mathbf{F }_{RF}^{H}\mathbf{F}_{opt}\); 4. Update residual \(\mathbf{F}_{res}=\frac{\mathbf{F}_{opt}-\mathbf{F}_{RF}\mathbf{F}_{BB}}{\left\| \mathbf{F}_{opt}-\mathbf{F}_{RF}\mathbf{F}_{BB}\right\|_{F}}\) end for
```  
**Algorithm 3** OMP. Given that \(\left(\mathbf{F}_{RF},\mathbf{W}_{RF}\right)\) has been solved, \(\left(\mathbf{F}_{BB},\mathbf{W}_{BB}\right)\) can be obtained using the least squares method. \[\mathbf{F}_{BB}=\left(\mathbf{F}_{RF}^{H}\mathbf{F}_{RF}\right)^{-1}\mathbf{F }_{RF}^{H}\mathbf{F}_{opt}, \tag{21}\] \[\mathbf{W}_{BB}=\left(\mathbf{W}_{RF}^{H}\mathbf{W}_{RF}\right)^{-1} \mathbf{W}_{RF}^{H}\mathbf{W}_{opt}.\]  
Finally, the secure beam precoder/combiner pair \(\left(\mathbf{F}_{RF}\mathbf{F}_{BB},\mathbf{W}_{RF}\mathbf{W}_{BB}\right)\) is obtained. The pseudo-code for computing the hybrid precoder using GSVD-Sparsity is provided in Algorithm 4. Therefore, to address the non-convex optimization problem in the decomposition of \(\mathbf{F}_{opt}(\mathbf{W}_{opt})\), the GSVD-Sparsity algorithm selects the strongest power paths from the sparse channel matrix of the legitimate user to construct the RF precoder. Based on this, the hybrid precoder at the transmitter and the hybrid combiner at the receiver are then derived. Since the sparse channel matrix is location-dependent, only the legitimate user located at a specific position possesses the corresponding sparse matrix. The eavesdropper, being at a different location, does not have access to such position-specific information.