Input: $${N_t}$$, $${N_r}$$, K, N, M, $${{\mathbf {H}}}$$. Analog stage: According $${C_{n,{\mathrm{max}} }} \in {\mathrm{max}} \left\{ {\left. {\begin{array}{*{20}{l}}{{C_1}}&{{C_2}}&{\begin{array}{*{20}{l}} \cdots&{{C_N}}\end{array}}\end{array}} \right\} } \right.$$, determine the optimization order. for $$1 \le n \le N$$ do 1) Update matrix $${{\mathbf {T}}}_{n - 1}$$, obtain the submatrix $${{{\mathbf {G}}}_{n - 1}}.$$ 2) Obtain the value of $${{{{\bar{{\mathbf {a}}}}}}_{n,opt}}.$$ 3) Compute $${{{{\bar{{\mathbf {a}}}}}}_n} = \frac{1}{{\sqrt{M} }}{e^{j\angle {{{{{\bar{{\mathbf {a}}}}}}}_{n,opt}}}}$$ and get $${{{\mathbf {F}}}_{\mathrm{RF}}}$$ from (9). End for End stage Digital stage: 4) Define the transit matrix $${{{\mathbf {H}}}_{{\mathop {\mathrm{int}}} ,k}} = {{{\mathbf {H}}}_k}{{{\mathbf {F}}}_{\mathrm{RF}}},k \in \{1,2, \ldots ,K\} .$$ 5) Define the matrix $${{{{\tilde{{\mathbf {H}}}}}}_k} = {\left[ {\begin{array}{*{20}{l}} {\begin{array}{*{20}{l}} {\begin{array}{*{20}{l}} {{{\mathbf {H}}}_{{\mathop {\mathrm{int}}} ,1}^T,}&\cdots \end{array},}&{{{\mathbf {H}}}_{{\mathop {\mathrm{int}}} ,k - 1}^T,}&{{{\mathbf {H}}}_{{\mathop {\mathrm{int}}} ,k + 1}^T,}&\cdots \end{array},}&{{{\mathbf {H}}}_{{\mathop {\mathrm{int}}} ,K}^T} \end{array}} \right] ^T}.$$ 6) Compute digital precoding matrix $${{{\mathbf {F}}}_{\mathrm{BB}}}{{\mathrm{=}}}\left[ {\begin{array}{*{20}{l}}{{{\mathbf {F}}}_{\mathrm{BB}}^1}&{{{\mathbf {F}}}_{\mathrm{BB}}^2}&\cdots&{{{\mathbf {F}}}_{\mathrm{BB}}^K}\end{array}} \right] .$$ End stage Obtain the total equivalent baseband channel $${{{\mathbf {H}}}_{total}} = {{\mathbf {H}}}{{{\mathbf {F}}}_{\mathrm{RF}}}{{{\mathbf {F}}}_{\mathrm{BB}}}.$$ Compute $${{\mathbf {P}}}$$ by using water-filling power allocation of the total equivalent channel $${{{\mathbf {H}}}_{total}}.$$ End stage Output: $${{{\mathbf {F}}}_{\mathrm{RF}}},\;{{{\mathbf {F}}}_{\mathrm{BB}}},\;{{\mathbf {P}}}.$$