## 3 Enhancing Security Through Joint Precoding and Artificial Noise Design
### Secrecy Rate Optimization Through Joint Precoding and Artificial Noise Design
\begin{split}\bigtriangledown_{\mathbf{P}}R_{L}(\mathbf{P})= \frac{\log_{2}e}{2^{k}}\sum_{\mathbf{s}_{i}^{m}\in\mathcal{S}}\frac{\sum_{ \mathbf{s}_{i}^{m}\in\mathcal{S}}\Xi_{b}\mathbf{P}\left(\mathbf{s}_{i}^{m}- \mathbf{s}_{i}^{m}\right)\left(\mathbf{s}_{i}^{m}-\mathbf{s}_{i}^{m}\right)^{H }\exp\left(\mathbf{\Omega}_{b}^{\prime}\right)}{\sigma_{b}^{2}\sum_{\mathbf{s }_{i}^{m}\in\mathcal{S}}\exp\left(\mathbf{\Omega}_{b}^{\prime}\right)}-\\ &\frac{\log_{2}e}{2^{k}}\sum_{\mathbf{s}_{i}^{m}\in\mathcal{S}} \frac{\sum_{\mathbf{s}_{i}^{m}\in\mathcal{S}}\Xi_{b}\mathbf{P}\left(\mathbf{ s}_{i}^{m}-\mathbf{s}_{i}^{m}\right)\left(\mathbf{s}_{i}^{m}-\mathbf{s}_{i}^{m} \right)^{H}\exp\left(\mathbf{\Omega}_{e}^{\prime}\right)}{\sum_{\mathbf{s}_{i}^ {m}\in\mathcal{S}}\exp\left(\mathbf{\Omega}_{e}^{\prime}\right)}\end{split}  \tag{16}\]  
with \(\Xi_{b}=\zeta^{2}\mathbf{H}^{H}(\Theta_{b})\mathbf{H}(\Theta_{b})\) and \(\Xi_{e}=\zeta^{2}\mathbf{H}^{H}(\Theta_{e})\left(\mathbf{\Sigma}^{-1/2} \right)^{H}\mathbf{\Sigma}^{-1/2}\mathbf{H}(\Theta_{e})\). The proposed algorithm-based gradient descent to solve (15) is summarized in Algorithm 1. ```
initialization:
1. Set the initial step size \(\delta\), the minimum step size \(\delta_{\min}\), the iteration index \(t=0\), and the maximum iteration number \(t_{\max}\). 2. Set the fixed power-control factor \(\zeta\). 3. Set the initial precoding matrix \(\mathbf{P}_{0}\) with constrain \(\text{tr}\left(\mathbf{P}_{0}\mathbf{P}_{0}^{H}\right)\leq P_{t}\). while\(t<t_{\max}\)do
1. Set \(t=t+1\). 2. Compute \(R_{L,t-1}=R_{L}(\mathbf{P}_{t-1})\) based on (14). 3. If \(\delta\geq\delta_{\min}\), go to the next step. Otherwise, output \(\mathbf{P}_{t-1}\) and stop. 4. Compute the gradient \(\bigtriangledown_{\mathbf{P}}R_{L}(\mathbf{P}_{t-1})\) based on (16). 5. Set \(\mathbf{P}_{t}^{\prime}=\mathbf{P}_{t-1}+\delta\bigtriangledown_{\mathbf{P}}R _{L}(\mathbf{P}_{t-1}^{\prime})\). 6. \(\mathbf{P}_{t}^{\prime}=\frac{\bigtriangledown_{\mathbf{P}}\mathbf{P}_{t}^{ \prime}}{\sqrt{\text{tr}\left(\mathbf{P}_{t}^{\prime}\right)^{H}}}\). 7. Compute \(R_{L,t}^{\prime}=R_{L}(\mathbf{P}_{t})\) based on (14). 8. If \(R_{L,t}^{\prime}>R_{L,t-1}\), set \(R_{L,t}=R_{L,t}^{\prime}\), \(\mathbf{P}_{t}=\mathbf{P}_{t}^{\prime}\). Otherwise, set \(\delta=\delta/2\) and return to Step 3. 9. end while Output:\(\mathbf{P}=\mathbf{P}_{t}\). ```  
**Algorithm 1** An iterative algorithm based on gradient descent to solve \(\mathbf{P}\) for maximizing the secrecy rate with fixed \(\zeta\)  
(2) Optimizing \(\zeta\) with fixed \(\mathbf{P}\): For a fixed precoding matrix \(\mathbf{P}\), the optimization problem in (9) centers around finding a \(\zeta\) that maximizes the secrecy rate. Based on the approach proposed in [26], we maximize the product of the SNR at Bob and the ISNR at Eve to obtain a suboptimal closed-form solution for \(\zeta\). Intuitively, the physical meaning of this approach is to adjust the value of \(\zeta\) in order to maximize the SNR at Bob while increasing the interference at Eve and reducing the signal strength at Eve, thereby enhancing the secrecy rate. Specifically, the product of the SNR at Bob and the ISNR at Eve is  
\[F(\zeta)=\underbrace{\frac{\zeta^{2}\text{tr}\big{(}\mathbf{H}(\Theta_{b}) \mathbf{P}\mathbf{P}^{H}\mathbf{H}^{H}(\Theta_{b})\big{)}}{\sigma_{b}^{2}}}_{ \text{SNR at Bob}}\times\underbrace{\big{(}1-\zeta^{2}\big{)}P_{t}\text{tr} \Big{(}\mathbf{H}(\Theta_{\epsilon})\mathbf{V}^{0}\big{(}\mathbf{V}^{0}\big{)} ^{H}\mathbf{H}^{H}(\Theta_{\epsilon})\Big{)}}_{\text{ISNR at Eve}} \tag{17}\]  
Let \(\zeta^{2}=\kappa\), and then the first derivative of the function \(F(\kappa)\) with respect to \(\kappa\) is  
\[