The two-way beamforming system is considered including two transceiver nodes and multiple relay nodes. All transceiver nodes and relay nodes are equipped with a single antenna, as shown in Fig. 1, and two transceiver nodes are not directly connected. The relay works under the AF or DF protocol with half duplex over fading channels. We assume that there are no links between relays. There are also no external interference links to relays. We assume that channel coefficients of all nodes are known, and the channel between the transceiver and the relay nodes is reciprocal. The channel gain is constant over one send-receive block with independent and identically distributed. The mutual interference between relays can be suppressed by interference suppression which increases the system complexity. Thus, we ignore the mutual interference and assume that each relay only receives signal from two transceiver nodes. Let \(f_i\) and \(h_i\) be the channel gain between transceiver nodes to relay *i*. \(f_i\) and \(h_i\) is known to the transceiver and relay nodes. All the relays have no their own power supply. Their power is totally coming from energy harvesting. \(g_i\) denotes the received signal at relay *i* from two transceivers, and \(y_i\) is the signal sent to transceivers. \(R_{\mathrm{th}}\) is the outage threshold. The signal received at relay *i* from two transceivers can be written as

$$\begin{aligned} g_i=\sqrt{P_0}f_i s_1+\sqrt{P_0}h_i s_2+v_{i}, \end{aligned}$$

(1)

where \(P_0\) and \(s_i\) are the fixed transmit power and the transmit signal from two transceivers, respectively. We assume that \({\mathbb {E}}[|s_1|^2]=1\), \({\mathbb {E}}[|s_2|^2]=1\), \(v_{i}\sim CN(0,\sigma _{A}^2)\) is the additive noise introduced by relay *i*. \(\alpha _i\) is the PS factor which splits the received signal in two parts, information processing part is \(\alpha _i,\) and energy harvesting is \(1-\alpha _i\), \(\alpha _i\in (0,1)\). The signal \(d_{in}\) is for information processing.

$$\begin{aligned} d_{in}=\sqrt{\alpha _i}g_i+v_{ip}, \end{aligned}$$

(2)

where \(v_{ip}\sim CN(0,\sigma _{P}^2)\) is the information processing additive noise, and the signal for energy harvesting is

$$\begin{aligned} e_i = \sqrt{1-\alpha _i}g_i. \end{aligned}$$

(3)

### AF relaying

In AF relaying mode, the relay receives signal from two transceivers; after information processing and energy harvesting, it amplifies and forwards the signal. The relay *i* amplifies the signal with factor \(\beta _i,\) and then sends it to two transceivers as shown in Fig. 2. The relay *i* sends the signal amplified by the factor \(\beta _i\) to two transceivers with phase adjusted by \(\theta _i\)

$$\begin{aligned} y_i=\beta _ie^{j\theta _i}d_{in}. \end{aligned}$$

(4)

The average transmit power is

$$\begin{aligned} {\mathbb {E}}[|y_i|^2]=\beta _i^2(\alpha _i P_0 |f_i|^2+\alpha _i P_0 |h_i|^2+\alpha _i \sigma _A^2+\sigma _P^2), \end{aligned}$$

(5)

and according to the PS method, the average power harvesting is

$$\begin{aligned} {\mathbb {E}}[|e_i|^2]=(1-\alpha _i)P_0(|f_i|^2+ |h_i|^2+\frac{\sigma _A^2}{P_0}). \end{aligned}$$

(6)

Because the relay *i* has no its own power supply, the harvested energy for relay at least is equal to its transmit power

$$\begin{aligned} {\mathbb {E}}[|y_i|^2]=\xi {\mathbb {E}}[|e_i|^2], \end{aligned}$$

(7)

where \(\xi\) is the energy conversion efficiency. Therefore,

$$\begin{aligned} \beta _i=\sqrt{\frac{\xi (1-\alpha _i)(P_0 |f_i|^2+P_0 |h_i|^2+\sigma _A^2)}{\alpha _i(P_0 |f_i|^2+P_0 |h_i|^2+\sigma _A^2)+\sigma _P^2}} \end{aligned}$$

(8)

We assume that \(\alpha _i P_0 |f_i|^2+\alpha _i P_0 |h_i|^2 + \alpha _i \sigma _A^2 \gg \sigma _P^2\), so \(\beta _i\) be written as

$$\begin{aligned} \beta _i \approx \sqrt{\dfrac{\xi (1-\alpha _i)}{\alpha _i}}. \end{aligned}$$

(9)

The signal received at transceivers s1 and s2 from multiple relays by maximal ratio combination (MRC) is:

$$\begin{aligned} s_1^\mathrm{AF}=\sum _{i=1}^M f_i y_i+ w_1, \end{aligned}$$

(10)

$$\begin{aligned} s_2^\mathrm{AF} = \sum _{i=1}^M h_i y_i + w_2, \end{aligned}$$

(11)

where \(w_1\sim CN(0,\sigma _{D1}^2)\) and \(w_2\sim CN(0,\sigma _{D2}^2)\) are the additive noise introduced by the antenna at transceivers s1 and s2. *M* is the number of relay nodes. Considering the self-interference constraint (SIC), by eliminating the self-interference component, \(s_1^\mathrm{AF}\) and \(s_2^\mathrm{AF}\) are further transformed as

$$\begin{aligned} s_1^\mathrm{AF} &={\varvec{f}}^\top {\varvec{t}} + w_1 \\ &=\sqrt{\xi P_0}\left( \sum _{i=1}^M\sqrt{1-\alpha _i} f_i h_i e^{j\theta _i}\right) s_2 \\ &\quad+ \sqrt{\xi }\sum _{i=1}^M\sqrt{1-\alpha _i} f_i e^{j\theta _i} \left( v_{i}+\dfrac{v_{ip}}{\sqrt{\alpha _i}}\right) +w_1, \end{aligned}$$

(12)

$$\begin{aligned} s_2^\mathrm{AF} &={\varvec{g}}^\top {\varvec{t}} + w_2 \\ &=\sqrt{\xi P_0}\left( \sum _{i=1}^M\sqrt{1-\alpha _i} f_i h_i e^{j\theta _i}\right) s_1 \\&\quad+ \sqrt{\xi }\sum _{i=1}^M\sqrt{1-\alpha _i} h_i e^{j\theta _i} \left( v_{i}+\dfrac{v_{ip}}{\sqrt{\alpha _i}}\right) +w_2, \end{aligned}$$

(13)

Therefore, the SNR in AF mode at transceivers s1 and s2 is given by

$$\begin{aligned} \gamma _1^\mathrm{AF}=\dfrac{P_0|\sum _{i=1}^M\sqrt{1-\alpha _i} f_i h_i e^{j\theta _i}|^2}{\sum _{i=1}^M(1-\alpha _i)\left( \sigma _A^2+\dfrac{\sigma _P^2}{\alpha _i}\right) |f_i|^2+\dfrac{\sigma _{D1}^2}{\xi }}, \end{aligned}$$

(14)

$$\begin{aligned} \gamma _2^\mathrm{AF}=\dfrac{P_0|\sum _{i=1}^M\sqrt{1-\alpha _i} f_i h_i e^{j\theta _i}|^2}{\sum _{i=1}^M(1-\alpha _i)\left( \sigma _A^2+\dfrac{\sigma _P^2}{\alpha _i}\right) |h_i|^2+\dfrac{\sigma _{D2}^2}{\xi }}, \end{aligned}$$

(15)

Obviously, when \(\theta _i=-\arg f_i-\arg h_i\), the maximal SNR is obtained. By substituting \(\theta _i\) in (14) and (15), we have

$$\begin{aligned} \gamma _1^\mathrm{AF} = \dfrac{P_0(\sum _{i=1}^M\sqrt{1-\alpha _i} |f_i h_i|)^2}{\sum _{i=1}^M(1-\alpha _i)\left( \sigma _A^2+\dfrac{\sigma _P^2}{\alpha _i}\right) |f_i|^2 + \dfrac{\sigma _{D1}^2}{\xi }}, \end{aligned}$$

(16)

$$\begin{aligned} \gamma _2^\mathrm{AF} = \dfrac{P_0(\sum _{i=1}^M\sqrt{1-\alpha _i} |f_i h_i|)^2}{\sum _{i=1}^M(1-\alpha _i)\left( \sigma _A^2+\dfrac{\sigma _P^2}{\alpha _i}\right) |h_i|^2 + \dfrac{\sigma _{D2}^2}{\xi }}. \end{aligned}$$

(17)

Then, the achievable rate from s1 to s2 and from s2 to s1 is given, respectively.

$$\begin{aligned} R_1^\mathrm{AF}=\dfrac{1}{2}\log _2(1+\gamma _1^\mathrm{AF}), \end{aligned}$$

(18)

$$\begin{aligned} R_2^\mathrm{AF}=\dfrac{1}{2}\log _2(1+\gamma _2^\mathrm{AF}). \end{aligned}$$

(19)

The sum rate for AF relaying protocol is defined as

$$\begin{aligned} R^\mathrm{AF}=R_1^\mathrm{AF} +R_2^\mathrm{AF}. \end{aligned}$$

(20)

The outage probability at node s1 and s2 is

$$\begin{aligned} Pout_{si}^\mathrm{AF}=Pr\{R_i^\mathrm{AF} < R_{\mathrm{th}}\}, i=1,2 \end{aligned}$$

(21)

Both links from s1 to relays to s2 and from s2 to relays to s1 should keep communication by the relayed path. To keep the two-way communication well, the outage probability is the sum of outage probability at s1 and s2.

$$\begin{aligned} P_{\mathrm{out}}^\mathrm{AF}= Pr\left\{ \dfrac{1}{2}\log _2(1+\gamma _1^\mathrm{AF})<R_{\mathrm{th}}\right\} + Pr\left\{ \dfrac{1}{2}\log _2(1+\gamma _2^\mathrm{AF}) <R_{\mathrm{th}}\right\} . \end{aligned}$$

(22)

### DF relaying

When the relay *i* works in DF mode, as shown in Fig. 3, after information processing and energy harvesting, the relay forwards information to transceivers. The relay node *i* receives signal from two transceivers with physical-layer network coding (PNC) scheme [34]. We have

$$\begin{aligned} S_{1i}^\mathrm{DF} =\sqrt{P_0}f_i s_1+v_{1i}, \end{aligned}$$

(23)

$$\begin{aligned} S_{2i}^\mathrm{DF} =\sqrt{P_0}h_i s_2+v_{2i}, \end{aligned}$$

(24)

$$\begin{aligned} s_{ri}^\mathrm{DF} =\sqrt{P_0}f_i s_1+\sqrt{P_0}h_i s_2+v_{i}, \end{aligned}$$

(25)

\(v_{1i}\sim CN(0,N_0)\) and \(v_{2i}\sim CN(0,N_0)\) is the additive noise introduced by the relay *i* antenna. \(v_{i}\sim CN(0,N_0)\) is the additive noise introduced by the relay *i* antenna. Using the power splitting technique, the energy that the relay *i* harvests from s1 and s2 is given as

$$\begin{aligned} E_{ri}^\mathrm{DF} =(1-\alpha _i)P_0(|f_i|^2+ |h_i|^2), \end{aligned}$$

(26)

The relay *i* uses its power \(E_{ri}^\mathrm{DF}\) to send information. Here, we assume the relay *i* can successfully decode and encode signal without error. In this way, the SNR at the relay node *i* from s1 is

$$\begin{aligned} \gamma _{r_{s1}}^\mathrm{DF}=\dfrac{P_0\alpha _i(|f_i|^2)}{N_0}. \end{aligned}$$

(27)

the SNR at the relay node *i* from s2 is

$$\begin{aligned} \gamma _{r_{s2}}^\mathrm{DF}=\dfrac{P_0\alpha _i(|h_i|^2)}{N_0}. \end{aligned}$$

(28)

the SNR at the relay node *i* from s1 and s2 is

$$\begin{aligned} \gamma _{i}^\mathrm{DF}=\dfrac{P_0\alpha _i(|f_i|^2+|h_i|^2)}{N_0}. \end{aligned}$$

(29)

because we assume the relay *i* can successfully decode and encode signal without error, so the signal-to-noise ratio is greater than outage threshold of node s1 and s2. Then,

$$\begin{aligned} \gamma _{r_{s1}}^\mathrm{DF}\ge r_{\mathrm{th}}, \end{aligned}$$

(30)

$$\begin{aligned} \gamma _{r_{s2}}^\mathrm{DF}\ge r_{\mathrm{th}}, \end{aligned}$$

(31)

where \(r_{\mathrm{th}}\) is the SNR outage threshold, and we can get that

$$\begin{aligned} \alpha _i \ge \dfrac{r_{\mathrm{th}} N_0}{|f_i|^2 P_0}. \end{aligned}$$

(32)

$$\begin{aligned} \alpha _i \ge \dfrac{r_{\mathrm{th}} N_0}{|h_i|^2 P_0}. \end{aligned}$$

(33)

Obviously,

$$\begin{aligned} \alpha _i \ge \dfrac{r_{\mathrm{th}} N_0}{(|f_i|^2+|h_i|^2)P_0}. \end{aligned}$$

(34)

Since \(\alpha _i\) is known to be smaller than 1, we have

$$\begin{aligned} max\left\{ \dfrac{r_{\mathrm{th}} N_0}{|f_i|^2 P_0}, \dfrac{r_{\mathrm{th}} N_0}{|h_i|^2 P_0}\right\} \leqslant \alpha _i <1. \end{aligned}$$

(35)

Therefore, the signal sent by relay *i* is given by

$$\begin{aligned} y_i^\mathrm{DF}=\sqrt{P_{r_i}^\mathrm{DF}}(s_{ri}), \end{aligned}$$

(36)

where \(P_{r_i}^\mathrm{DF}\) is the transmit power of relay node *i*. To let the relay work in normal state, the power harvested should be equal to its transmit power, i.e.,

$$\begin{aligned} P_{r_i}^\mathrm{DF}=\xi E_{ri}^\mathrm{DF}. \end{aligned}$$

(37)

Therefore,

$$\begin{aligned} P_{r_i}^\mathrm{DF}=\xi (1-\alpha _i)P_0(|f_i|^2+|h_i|^2 ). \end{aligned}$$

(38)

Then, the relays forward information to destinations using harvested energy. Again, considering SIC, after eliminating the self-interference component, the received signal at destination \(s_1\) and destination \(s_2\) is given by

$$\begin{aligned} z_1^\mathrm{DF}&=\sum _{i=1}^M f_iy_i^\mathrm{DF}+ w_{z1} \\ &=\sum _{i=1}^M\sqrt{\xi P_0}\sqrt{1-\alpha _i}\sqrt{|f_i|^2+|h_i|^2 }f_i s_2+w_{z1}, \end{aligned}$$

(39)

$$\begin{aligned} z_2^\mathrm{DF} &=\sum _{i=1}^M h_iy_i^\mathrm{DF}+ w_{z2} \\ &=\sum _{i=1}^M\sqrt{\xi P_0}\sqrt{1-\alpha _i}\sqrt{|f_i|^2+|h_i|^2}h_i s_1+w_{z2}. \end{aligned}$$

(40)

where \(w_{z1}\sim CN(0,N_0)\) and \(w_{z2}\sim CN(0,N_0)\) are the additive noise introduced by the transceiver antenna. Therefore, the SNR at destination node is

$$\begin{aligned} \gamma _{s1}^\mathrm{DF} = \dfrac{P_0(\sum _{i=1}^M\sqrt{1-\alpha _i}\sqrt{|f_i|^2+|h_i|^2}|f_i|)^2 }{\dfrac{N_0}{\xi }}, \end{aligned}$$

(41)

$$\begin{aligned} \gamma _{s2}^\mathrm{DF}=\dfrac{P_0(\sum _{i=1}^M\sqrt{1-\alpha _i}\sqrt{|f_i|^2+|h_i|^2}|h_i|)^2 }{\dfrac{N_0}{\xi }}, \end{aligned}$$

(42)

the achievable rate of node s1 is

$$\begin{aligned} R_{s1}^\mathrm{DF}=\dfrac{1}{2}\log _2(1+\gamma _{s1}^\mathrm{DF}), \end{aligned}$$

(43)

the achievable rate of node s2 is

$$\begin{aligned} R_{s2}^\mathrm{DF}=\dfrac{1}{2}\log _2(1+\gamma _{s2}^\mathrm{DF}), \end{aligned}$$

(44)

and the sum rate at destination nodes is

$$\begin{aligned} R_{d}^\mathrm{DF}&=R_{s1}^\mathrm{DF} + R_{s2}^\mathrm{DF} \\ &=\dfrac{1}{2}(\log _2(1+\gamma _{s1}^\mathrm{DF}+\gamma _{s2}^\mathrm{DF}+\gamma _{s1}^\mathrm{DF}\gamma _{s2}^\mathrm{DF})). \end{aligned}$$

(45)

The outage probability at node s1 and s2 is given by

$$\begin{aligned} Pout_{si}^\mathrm{DF}= Pr\{R_{si}^\mathrm{DF} < R_{\mathrm{th}}\},i=1,2 \end{aligned}$$

(46)

The sum outage probability is

$$\begin{aligned} P_{\mathrm{out}}^\mathrm{DF}= Pout_{s1}^\mathrm{DF}+ Pout_{s2}^\mathrm{DF}, \end{aligned}$$

(47)

From (45), we can observe that maximizing \(R_{d}^\mathrm{DF}\) under constraint (35) can be achieved by simply optimizing the variable \(\alpha _i\).