## 3 Beamforming Optimization with AN
### Beamforming Optimization with AN in the MISO SWIPT CR-NOMA Network
\[\sum_{l^{\prime}=1}^{L}\left|\textbf{g}_{l}^{H}\textbf{v}_{l^{ \prime}}\right|^{2}+\sum_{m=1}^{M}\left|\textbf{g}_{l}^{H}\textbf{w}_{m}\right| ^{2}+\left|\textbf{g}_{l}^{H}\textbf{f}\right|^{2}+\sigma_{l}^{2}\geq\frac{ \psi_{l}}{(1-\theta_{l})},\,\forall_{l}\]0 \[\sum_{l^{\prime}=1}^{L}\left|\textbf{g}_{l}^{H}\textbf{v}_{l^{ \prime}}\right|^{2}+\sum_{m=1}^{M}\left|\textbf{g}_{l}^{H}\textbf{w}_{m}\right| ^{2}+\left|\textbf{g}_{l}^{H}\textbf{f}\right|^{2}+\sigma_{l}^{2}\geq\frac{ \psi_{l}}{(1-\theta_{l})},\,\forall_{l}\]1 \[\sum_{l^{\prime}=1}^{L}\left|\textbf{g}_{l}^{H}\textbf{v}_{l^{ \prime}}\right|^{2}+\sum_{m=1}^{M}\left|\textbf{g}_{l}^{H}\textbf{w}_{m}\right| ^{2}+\left|\textbf{g}_{l}^{H}\textbf{f}\right|^{2}+\sigma_{l}^{2}\geq\frac{ \psi_{l}}{(1-\theta_{l})},\,\forall_{l}\]2 (13c) \[\sum_{l^{\prime}=1}^{L}\left|\textbf{g}_{l}^{H}\textbf{v}_{l^{ \prime}}\right|^{2}+\sum_{m=1}^{M}\left|\textbf{g}_{l}^{H}\textbf{w}_{m}\right| ^{2}+\left|\textbf{g}_{l}^{H}\textbf{f}\right|^{2}+\sigma_{l}^{2}\geq\frac{ \psi_{l}}{(1-\theta_{l})},\,\forall_{l}\]3 (13d) \[\sum_{l^{\prime}=1}^{L}\left|\textbf{g}_{l}^{H}\textbf{v}_{l^{ \prime}}\right|^{2}+\sum_{m=1}^{M}\left|\textbf{g}_{l}^{H}\textbf{w}_{m}\right| ^{2}+\left|\textbf{g}_{l}^{H}\textbf{f}\right|^{2}+\sigma_{l}^{2}\geq\frac{ \psi_{l}}{(1-\theta_{l})},\,\forall_{l}\]4 (13e) \[\sum_{l^{\prime}=1}^{L}\left|\textbf{g}_{l}^{H}\textbf{v}_{l^{ \prime}}\right|^{2}+\sum_{m=1}^{M}\left|\textbf{g}_{l}^{H}\textbf{w}_{m}\right| ^{2}+\left|\textbf{g}_{l}^{H}\textbf{f}\right|^{2}+\sigma_{l}^{2}\geq\frac{ \psi_{l}}{(1-\theta_{l})},\,\forall_{l}\]5 (13f) \[\sum_{l^{\prime}=1}^{L}\left|\textbf{g}_{l}^{H}\textbf{v}_{l^{ \prime}}\right|^{2}+\sum_{m=1}^{M}\left|\textbf{g}_{l}^{H}\textbf{w}_{m}\right| ^{2}+\left|\textbf{g}_{l}^{H}\textbf{f}\right|^{2}+\sigma_{l}^{2}\geq\frac{ \psi_{l}}{(1-\theta_{l})},\,\forall_{l}\]6 (13g) \[\sum_{l^{\prime}=1}^{L}\left|\textbf{g}_{l}^{H}\textbf{v}_{l^{ \prime}}\right|^{2}+\sum_{m=1}^{M}\left|\textbf{g}_{l}^{H}\textbf{w}_{m}\right| ^{2}+\left|\textbf{g}_{l}^{H}\textbf{f}\right|^{2}+\sigma_{l}^{2}\geq\frac{ \psi_{l}}{(1-\theta_{l})},\,\forall_{l}\]7  
Problem (13) is a linear program that can be solved with the CVX module of MATLAB. In the Gaussian randomization technique, we generate \(G_{rand}\) candidate precoder vectors, where the final solution is the one that achieves the lower transmit power. The proposed algorithm with SDR and the Gaussian randomization technique is summarized in Algorithm 1. ```
inputs: Number of randomizations, \(G_{rand}\), \(\text{Pow}_{\min}=P_{\text{max}}\), optimal solution to the (12)-SDR problem: \(\left\{\mathbf{V}_{l}^{*},\mathbf{W}_{m}^{*}\right\},\mathbf{F}\). Obtain the eigen decomposition of the precoder matrices from the solution to problem (12)-SDR \(\mathbf{V}_{l}=\mathbf{Q}_{\text{SU},l}\Lambda_{\text{SU},l}\mathbf{Q}_{\text{ SU},l}^{H}\), \(\mathbf{W}_{m}=\mathbf{Q}_{\text{EH},m}\Lambda_{\text{EH},m}\mathbf{Q}_{\text{ EH},m}^{H}\), and \(\mathbf{F}=\mathbf{Q}_{f}\Lambda_{f}\mathbf{Q}_{f}^{H}\). for\(i=1:1:G_{rand}\)do  Generate the candidate precoder vectors based on random vectors \(x_{\text{SU},l^{\prime}}^{i}\), \(x_{\text{EH},m}^{i}\), and \(\kappa_{f}^{i}\): \(\mathbf{v}_{l}^{i}=\mathbf{Q}_{\text{SU},l}\Lambda_{\text{SU},l}^{1/2}x_{\text{ SU},l^{\prime}}^{i}\), \(\mathbf{w}_{m}^{i}=\mathbf{Q}_{\text{EH},m}\Lambda_{\text{EH},m}^{1/2}x_{\text{ EH},m}^{i}\), and \(\mathbf{f}^{i}=\mathbf{Q}_{f}\Lambda_{f}^{1/2}\kappa_{f}^{i}\). Use the CVX module to solve problem (13) to get scalar factors \(\left\{\tau_{\text{SU},l^{\prime}}^{i},\tau_{\text{EH},m}^{i}\right\}\tau_{f}^{i}\).