# Joint Hybrid Beamforming Design for Millimeter Wave Amplify-and-Forward Relay Communication Systems
## 4 Hybrid Beamforming Design for FD AF Relay Systems
### Proposed HBF-MO-FD-R Algorithm
By setting the gradient of the objective function to zero, we can obtain  
\[\text{s.t.} \tag{50b}\]5  
where \(c_{31}=\text{tr}\Big{(}\overline{\mathbf{F}}^{H}\mathbf{\Theta}_{1}\Big{)}\), \(c_{32}=\gamma_{1}^{-2}\sigma_{\text{RF}}^{2},c_{33}=\text{tr}\Big{(}\overline {\mathbf{G}}\overline{\mathbf{H}}_{1}\overline{\mathbf{F}}^{H}\overline{ \mathbf{H}}_{1}^{H}\overline{\mathbf{G}}^{H}\mathbf{\Theta}_{2}\Big{)}+\text{ tr}\Big{(}\overline{\mathbf{F}}\overline{\mathbf{F}}^{H}\mathbf{\Theta}_{1}\Big{)} \text{tr}\\ \Big{(}\overline{\mathbf{G}}\mathbf{\Phi}_{1}\overline{\mathbf{G}}^{H} \mathbf{\Theta}_{2}\Big{)}+\gamma_{1}^{-2}\sigma_{\text{RF}}^{2}\text{tr} \Big{(}\overline{\mathbf{G}}\overline{\mathbf{G}}^{H}\mathbf{\Theta}_{2}\Big{)},\,c_{34}=\gamma_{1}^{-2}\gamma_{2}^{-2}\sigma_{\text{D}}^{2},\) and we define  
\[\text{s.t.} \tag{50b}\]6 \[\text{s.t.} \tag{50b}\]7  
Substituting (62) into the equation of IMSE, the objective function is equivalent to  
\[\text{s.t.} \tag{50b}\]8  
In the meantime, the optimization sub-problem is reduced to  
\[\text{s.t.} \tag{50b}\]9 (65a) s.t. \[\mathbf{G}_{\text{U}_{2}} =\Big{[}\mathbf{G}_{\text{RF}_{2}}^{H}\overline{\mathbf{H}}_{2}^{ H}\mathbf{W}\mathbf{W}^{H}\overline{\mathbf{H}}_{2}\mathbf{G}_{\text{RF}_{2}}+ \text{tr}\Big{(}\mathbf{W}^{H}\mathbf{\Phi}_{2}\mathbf{W}\Big{)}\mathbf{G}_{ \text{RF}_{2}}^{H}\mathbf{\Theta}_{2}\mathbf{G}_{\text{RF}_{2}}\]0  
Finally, the gradient \(\
abla\text{J}3(\mathbf{W}_{\text{RF}})\) can be written as  
\[\mathbf{G}_{\text{U}_{2}} =\Big{[}\mathbf{G}_{\text{RF}_{2}}^{H}\overline{\mathbf{H}}_{2}^{ H}\mathbf{W}\mathbf{W}^{H}\overline{\mathbf{H}}_{2}\mathbf{G}_{\text{RF}_{2}}+ \text{tr}\Big{(}\mathbf{W}^{H}\mathbf{\Phi}_{2}\mathbf{W}\Big{)}\mathbf{G}_{ \text{RF}_{2}}^{H}\mathbf{\Theta}_{2}\mathbf{G}_{\text{RF}_{2}}\]1 \[\mathbf{G}_{\text{U}_{2}} =\Big{[}\mathbf{G}_{\text{RF}_{2}}^{H}\overline{\mathbf{H}}_{2}^{ H}\mathbf{W}\mathbf{W}^{H}\overline{\mathbf{H}}_{2}\mathbf{G}_{\text{RF}_{2}}+ \text{tr}\Big{(}\mathbf{W}^{H}\mathbf{\Phi}_{2}\mathbf{W}\Big{)}\mathbf{G}_{ \text{RF}_{2}}^{H}\mathbf{\Theta}_{2}\mathbf{G}_{\text{RF}_{2}}\]2  
with \(\mathbf{C}_{32}\)=\(\mathbf{I}_{\text{N}_{\text{S}}}+\overline{\mathbf{F}}^{H}\overline{\mathbf{H}}_{1}^{H} \overline{\mathbf{G}}^{H}\overline{\mathbf{H}}_{2}^{H}\mathbf{W}_{\text{RF}} \mathbf{C}_{31}^{-1}\mathbf{W}_{\text{RF}}^{H}\overline{\mathbf{H}}_{2} \overline{\mathbf{G}}\overline{\mathbf{H}}_{1}\overline{\mathbf{F}}.\)  
The proposed MO based HBF algorithm for the FD relay system is summarized in Algorithm 3. ```
0:\(\mathbf{H}_{1}\), \(\mathbf{\overline{H}}_{2}\), \(\mathbf{\overline{H}}_{\text{SI}}\), \(\sigma_{\text{R}}^{2}\), \(\sigma_{\text{D}}^{2}\), \(\mathbf{\Phi}_{1}\), \(\mathbf{\Phi}_{2}\), \(\mathbf{\Theta}_{1}\), \(\mathbf{\Theta}_{2}\). 0:\(\gamma_{1}\), \(\gamma_{2}\), \(\mathbf{F}_{\text{RF}}\), \(\mathbf{F}_{\text{U}}\), \(\mathbf{G}_{1}\), \(\mathbf{G}_{2}^{\text{SIC}}\), \(\mathbf{W}_{\text{RF}}\), \(\mathbf{W}_{\text{B}}\). 1:Initialize\(\mathbf{F}_{\text{RF}}\), \(\mathbf{F}_{\text{U}}\), \(\mathbf{G}_{\text{RF}_{1}}\), \(\mathbf{G}_{\text{RF}_{2}}\), \(\mathbf{G}_{\text{B}_{1}}\), \(\mathbf{G}_{\text{U}_{2}}\), \(\mathbf{W}_{\text{RF}}\) and \(\mathbf{W}_{\text{B}}\) randomly, and set \(\gamma_{1}=\gamma_{2}=1\), \(k=1\). 2:while\(\text{IMSE}_{k}-\text{IMSE}_{k-1}>\varepsilon\)do
3: Calculate \(\
abla\)J1(\(\mathbf{F}_{\text{RF},k}\)) according to (42) and compute \(\mathbf{F}_{\text{RF},k+1}\) by using the MO method. 4: Update \(\gamma_{1,k+1}\), \(\mathbf{F}_{\text{U},k+1}\) and \(\mathbf{\overline{F}}_{k+1}\) according to (38) and (39). 5: Calculate \(\
abla\)Q1\(\left(\mathbf{G}_{\text{RF}_{1},k}\right)\) according to (47) and compute \(\mathbf{G}_{\text{RF}_{1},k+1}\) by using the MO method. 6: Update \(\mathbf{G}_{\text{B}_{1},k+1}\) and \(\mathbf{G}_{1,k+1}\) according to (44). 7: Calculate \(\
abla\)Q2\(\left(\mathbf{G}_{\text{RF}_{2},k}\right)\) according to (54) and compute \(\mathbf{G}_{\text{RF}_{2},k+1}\) by using the MO method.