1 Introduction

Owing to its ability to overcome the loss in the spectral efficiency due to half-duplex transmission [1], considerable attention has been concentrated on the two-way relaying [2, 3]. In this scheme, two end nodes can transmit their signals to the relay simultaneously, and then the relay transmits the combined signal to both nodes. Each of the nodes can obtain its desired data by removing its own information, called self-interference. Therefore, only two time intervals are required for bi-directional transmission. Of particular interest is an analog network coding (ANC) protocol, which is a well-known amplify-and-forward (AF)-based two-way relaying protocol. The authors in [4, 5] have explored the application of opportunistic relay selection (ORS) to the ANC and shown that the system performance is improved significantly. However, these benefits depend on knowledge of the channel state information (CSI). Clearly, with the impact of system noise and imperfect channel estimation algorithms, the relay and two end nodes hardly have the perfect knowledge of CSI. Therefore, performance analysis and enhancement that take into account such CSI uncertainties play an important role in the design of practical systems. Such a study is more challenging compared with the context of one-way relaying networks. For instance, when the channel estimation error exists, users cannot completely subtract their own information from the observations, which results in strong residual self-interference.

Very recently, some related works on ANC have taken into consideration the impact of imperfect CSI [68]. For single-relay scenario, lower bound and upper bound of system outage probability for ANC are evaluated in [6, 7], respectively. For multi-relay scenario [8] based on ORS, the analyses are conducted by adopting an approximation which is originally proposed for the high SNR and only approximate expressions are derived. To the best of our knowledge, when CSI is not perfect, an exact performance analysis in terms of outage performance for ANC under ORS is still an open issue.

In this paper, we derive an exact and generalized closed-form outage probability expression of ORS algorithm for ANC protocol with channel estimation errors over independent and non-identically distributed (i.ni.d) Rayleigh links. Furthermore, to enhance the system performance, we perform power allocation that optimizes the system outage probability based on the knowledge of instantaneous channel information. Simulation results are in excellent agreement with the analytical results and show that the proposed power allocation algorithm offers considerable performance improvement over conventional uniform power allocation.

2 System Model

As shown in Fig. 1, we consider a two-way opportunistic relaying system in AF strategy, where two nodes \(A\) and \(B\) exchange information with each other using \(K\) relay nodes \(S_{relay} = \{ 1, 2, \ldots , K\}\) over Rayleigh fading channels. We assume that all the nodes are equipped with a single antenna and operate in a half-duplex mode. There is no direct path between \(A\) and \(B\), and the transmissions are subject to flat fading and additive noise. The transmit powers at \(A\), \(B\) and relays are denoted by \(P_a,\, P_b\, \text{ and } \,P_r\).

Fig. 1
figure 1

System model for the two-way relay channel with channel estimation errors

In the first time slot, both \(A\) and \(B\) transmit their signals simultaneously to all the relays. Then, relay \(k \in S_{relay}\) is selected as single forwarding node and the received signal at relay \(k\) can be written as \(y_k = h_{ak} \sqrt{P_a } x_a + h_{bk} \sqrt{P_b } x_b + n_k\), where \(x_a\) and \(x_b\) are the unit energy transmit symbols from \(A\) and \(B\), \(n_k \sim \mathcal CN (0,1)\) Footnote 1 is the additive while Gaussian noise (AWGN) at relay \(k,\, h_{ak} \sim \mathcal CN (0,\Omega _{h,ak})\) and \(h_{bk} \sim \mathcal CN (0,\Omega _{h,bk} )\) denote the channel coefficient between \(A,\, B\) and the relay \(k\).

During the second time slot, the relay broadcasts the combined signal \(y_k\) after multiplying it with amplifying gain, \(G\). We assume that both \(A\) and \(B\) have knowledge about their own symbols and can remove the back-propagating self-interference from the superimposed signals. However, as stated in the previous section, due to the channel estimation errors, the estimate of the channels gains, denoted as \(\hat{h}_{ak}\) and \(\hat{h}_{bk}\), are not necessarily the same as \(h_{ak}\) and \(h_{bk}\). According to [9], the channel estimation error model can be modeled as \(h_{ik} = \hat{h}_{ik} + e_{ik}\), where \(i \in \left\{ {a,\;b} \right\} \), \(e_{ik} \sim \mathcal CN (0,\Omega _{e,ik} )\) is the channel-estimation error. We assume that \(\hat{h}_{ak}\) and \(\hat{h}_{bk}\) are statistically independent of \(e_{ak}\) and \(e_{bk}\), respectively. As a result, \(\hat{h}_{ak} \sim \mathcal CN (0,\Omega _{\hat{h},ak} )\) and \(\hat{h}_{bk} \sim \mathcal CN (0,\Omega _{\hat{h},bk} )\), where \(\Omega _{\hat{h},ak} = \Omega _{h,ak} - \Omega _{e,ak}\) and \(\Omega _{\hat{h},bk} = \Omega _{h,bk} - \Omega _{e,bk}\). We further assume that \(\rho _a = \Omega _{e,ak} /\Omega _{h,ak}\) and \(\rho _b = \Omega _{e,bk} /\Omega _{h,bk}\), which can be called as relative channel estimation error ( \(0 \le \rho _i \le 1\), where \(\rho _i = 0\) means perfect CSI). In this corresponding, the power-scaled gain, \(G\), can be written as

$$\begin{aligned} G = \sqrt{\frac{{P_r }}{{P_a |\hat{h}_{ak} |^2 + P_b |\hat{h}_{bk} |^2 + P_a \Omega _{e,ak} + P_b \Omega _{e,bk} { \text{+ } }1}}} \end{aligned}$$
(1)

Since only \(\hat{h}_{ak}\) and \(\hat{h}_{bk}\) are known to node \(A\), the resulting signal at node \(A\) can be evaluated as

$$\begin{aligned} y_{ak}&= G\hat{h}_{ak} \hat{h}_{bk} \sqrt{P_b } x_b + G\sqrt{P_a } e_{ak} (2\hat{h}_{ak} + e_{ak} )x_a \nonumber \\&+\, G\sqrt{P_b } (\hat{h}_{ak} e_{ak} + \hat{h}_{bk} e_{bk} + e_{ak} e_{bk} )x_b \nonumber \\&+\, G(\hat{h}_{ak} + e_{ak} )n_k + n_a \end{aligned}$$
(2)

where the term \(G\sqrt{P_a } e_{ak} (2\hat{h}_{ak} + e_{ak} )x_a\) is the residual self-interference introduced by imperfect self-interference cancelation in the presence of imperfect CSI. Then the resultant instantaneous SNR for the link \(B \rightarrow k \rightarrow A\) can be given as

$$\begin{aligned} \gamma _{ak} = \frac{{P_r P_b |\hat{h}_{ak} |^2 |\hat{h}_{bk} |^2 }}{{\alpha _{1k} |\hat{h}_{ak} |^2 + \alpha _{2k} |\hat{h}_{bk} |^2 + I_{ak} }} \end{aligned}$$
(3)

where \(\alpha _{1k} = 4P_r P_a \Omega _{e,ak} + P_r P_b \Omega _{e,bk} + P_r + P_a,\, \alpha _{2k} = P_r P_b \Omega _{e,ak} + P_b\) and \(I_{ak} = 3P_r P_a \Omega _{e,ak}^2 + P_r P_b \Omega _{e,ak} \Omega _{e,bk} + (P_r + P_a )\Omega _{e,ak} + P_b \Omega _{e,bk} + 1\). The instantaneous SNR for the link \(A \rightarrow k \rightarrow B\) can be obtained in a similar way:

$$\begin{aligned} \gamma _{bk} = \frac{{P_r P_a |\hat{h}_{ak} |^2 |\hat{h}_{bk} |^2 }}{{\beta _{1k} |\hat{h}_{ak} |^2 + \beta _{2k} |\hat{h}_{bk} |^2 + I_{bk} }} \end{aligned}$$
(4)

where \(\beta _{2k} = 4P_r P_b \Omega _{e,bk} + P_r P_a \Omega _{e,ak} + P_r + P_b\), \(\beta _{1k} = P_r P_a \Omega _{e,bk} + P_a\) and \(I_{bk} = 3P_r P_b \Omega _{e,bk}^2 + P_r P_a \Omega _{e,ak} \Omega _{e,bk} + (P_r + P_b )\Omega _{e,bk} + P_a \Omega _{e,ak} + 1\). The corresponding one-sided data-rates via the relay \(k\) are thus given as \(R_{ak} = \frac{1}{2}\log _2 (1 + \gamma _{ak} )\) and \(R_{bk} = \frac{1}{2}\log _2 (1 + \gamma _{bk} )\).

As clearly shown in (3) and (4), the forms of instantaneous SNR are not easily tractable due to the existence of imperfect CSI. For theoretical analysis simplicity, \(I_{ak}\) and \(I_{bk}\) are omitted in the sequel, since they are negligible compared with other terms [7].

3 Outage Probability Analysis

In this paper, we adopt the max-min method for relay selection which has the best performance in minimizing the system outage probability [3]. Since the worse one of the two received SNRs is the bottleneck of the outage probability, the relay selection criterion is given by

$$\begin{aligned} k^* = \arg \mathop {\max }\limits _{k \in \{ 1,2,...,K\} } \min \left( {\gamma _{ak} ,\;\gamma _{bk} } \right) \end{aligned}$$
(5)

where \(k^*\) denotes the best relay. With required data rate \(R_{th}\) at \(A\) and \(B\), the system outage probability can be expressed as

$$\begin{aligned} \mathcal P _{out}&= \mathbf{Pr} \left[ {R_{ak^* } \leqslant R_{th} \;or\;R_{bk^* } \leqslant R_{th} } \right] \nonumber \\&= \mathbf{Pr} \left[ {\mathop {\max }\limits _{k \in \{ 1,2,...,K\} } \min \left( {\gamma _{ak} ,\;\gamma _{bk} } \right) \leqslant \gamma _{th} } \right] \nonumber \\&= \prod \limits _{k = 1}^K {\left\{ {\mathbf{Pr} \left[ {\min \left( {\gamma _{ak} ,\;\gamma _{bk} } \right) \leqslant \gamma _{th} } \right] \triangleq \mathcal P _{out,k} } \right\} } \end{aligned}$$
(6)

where \(\gamma _{th} = 2^{2R_{th} }-1\). According to (3) and (4), \(\gamma _{ak} \) and \(\gamma _{bk} \) are highly correlated, since they are both functions of variables \(|\hat{h}_{ak} |^2\) and \(|\hat{h}_{bk} |^2\). Moreover, the existence of channel estimation error makes (6) mathematically intractable. As a result, it is very difficult to evaluate (6) straightforwardly. In order to make the analysis feasible, numerous well known existing literatures take a bounding approach (e.g., \(\frac{{xy}}{{x + y}} \le \min (x,\;y)\)) (see [10] and the references [7] therein). Unlike the current research activities, in this paper, we first decompose \(\mathcal P _{out,k}\) into following three separated parts and focus on an exact analysis of it.

$$\begin{aligned} \mathcal P _{out,k} = \left\{ \begin{array}{ll} \mathbf{Pr} \left[ {\gamma _{bk} \leqslant \gamma _{th} } \right] ,\qquad \qquad \frac{{P_a }}{{P_b }}\, \leqslant \frac{{\beta _{1k} }}{{\alpha _{1k} }} \\ \mathbf{Pr} \left[ {\min \left( {\gamma _{ak} ,\quad \gamma _{bk} } \right) \leqslant \gamma _{th} } \right] ,\qquad \frac{{\beta _{1k} }}{{\alpha _{1k} }} < \frac{{P_a }}{{P_b }}\, < \frac{{\beta _{2k} }}{{\alpha _{2k} }} \\ \mathbf{Pr} \left[ {\gamma _{ak} \leqslant \gamma _{th} } \right] ,\qquad \qquad \frac{{P_a }}{{P_b }}\, \geqslant \frac{{\beta _{2k} }}{{\alpha _{2k} }} \\ \end{array}\right. \end{aligned}$$
(7)

Proof

see “Appendix A”.\(\square \)

When \(\frac{{P_a }}{{P_b }} \leqslant \frac{{\beta _{1k} }}{{\alpha _{1k} }}\), since \(| {\hat{h}_{ak} } |^2\) and \(| {\hat{h}_{bk} } |^2\) are both exponentially distributed with parameters \(1/\Omega _{\hat{h},ak}\) and \(1/\Omega _{\hat{h},bk}\), \(\mathcal P _{out,k}\) can be evaluated straightforward with the help of [11], which can be given as

$$\begin{aligned} \begin{array}{l} \mathcal P _{out,k} = 1 - 2\frac{{\beta _{1k} \beta _{2k} \gamma _{th} }}{{P_r P_a }}\sqrt{\frac{1}{{\beta _{1k} \beta _{2k} \Omega _{\hat{h},ak} \Omega _{\hat{h},bk} }}} e^{ - \left( {\frac{1}{{\beta _{1k} {\Omega _{\hat{h},ak} }}} + \frac{1}{{\beta _{2k} {\Omega _{\hat{h},bk} }}}} \right) \frac{{\beta _{1k} \beta _{2k} \gamma _{th} }}{{P_r P_a }}} \\ \qquad \qquad \times K_1 \left( {2\frac{{\beta _{1k} \beta _{2k} \gamma _{th} }}{{P_r P_a }}\sqrt{\frac{1}{{\beta _{1k} \beta _{2k} \Omega _{\hat{h},ak} \Omega _{\hat{h},bk} }}} } \right) \\ \end{array} \end{aligned}$$
(8)

Similarly, when \(\frac{{P_a }}{{P_b }} \geqslant \frac{{\beta _{2k} }}{{\alpha _{2k} }},\, \mathcal P _{out}\) can be presented as

$$\begin{aligned} \begin{array}{l} \mathcal P _{out,k} = 1 - 2\frac{{\alpha _{1k} \alpha _{2k} \gamma _{th} }}{{P_r P_b }}\sqrt{\frac{1}{{\alpha _{1k} \alpha _{2k} \Omega _{\hat{h},ak} \Omega _{\hat{h},bk} }}} e^{ - \left( {\frac{1}{{\alpha _{1k} \Omega _{\hat{h},ak} }} + \frac{1}{{\alpha _{2k} \Omega _{\hat{h},bk} }}} \right) \frac{{\alpha _{1k} \alpha _{2k} \gamma _{th} }}{{P_r P_b }}} \\ \qquad \qquad \times K_1 \left( {2\frac{{\alpha _{1k} \alpha _{2k} \gamma _{th} }}{{P_r P_b }}\sqrt{\frac{1}{{\alpha _{1k} \alpha _{2k} \Omega _{\hat{h},ak} \Omega _{\hat{h},bk} }}} } \right) \\ \end{array} \end{aligned}$$
(9)

When \(\frac{{\beta _{1k} }}{{\alpha _{1k} }}< \frac{{P_a }}{{P_b }} < \frac{{\beta _{2k} }}{{\alpha _{2k} }},\, \mathcal P _{out}\) is evaluated based on the corresponding intervals, i.e., \(\frac{{\beta _{1k} }}{{\alpha _{1k} }} < \frac{{P_a }}{{P_b }}\) and \(\frac{{P_a }}{{P_b }}\; < \frac{{\beta _{2k} }}{{\alpha _{2k} }}\), and can be presented as follows (proof: see “Appendix B”)

$$\begin{aligned} \mathcal P _{out,k}&= 1 - 2\frac{{\alpha _{1k} \alpha _{2k} \gamma _{th} }}{{P_r P_b }}\sqrt{\frac{1}{{\alpha _{1k} \alpha _{2k} \Omega _{\hat{h},ak} \Omega _{\hat{h},bk} }}} e^{ - \left( {\frac{1}{{\alpha _{1k} \Omega _{\hat{h},ak} }} + \frac{1}{{\alpha _{2k} \Omega _{\hat{h},bk} }}} \right) \frac{{\alpha _{1k} \alpha _{2k} \gamma _{th} }}{{P_r P_b }}} \nonumber \\&\quad \times K_1 \left( {2\frac{{\alpha _{1k} \alpha _{2k} \gamma _{th} }}{{P_r P_b }}\sqrt{\frac{1}{{\alpha _{1k} \alpha _{2k} \Omega _{\hat{h},ak} \Omega _{\hat{h},bk} }}} } \right) \nonumber \\&\quad - \frac{{P_r P_a w - \beta _{1k} \gamma _{th} }}{{\Omega _{\hat{h},bk} P_r P_a }}e^{ - \left( {\frac{1}{{\beta _{2k} \Omega _{\hat{h},bk} }} + \frac{1}{{\beta _{1k} \Omega _{\hat{h},ak} }}} \right) \frac{{\beta _{1k} \beta _{2k} \gamma _{th} }}{{P_r P_a }}} \nonumber \\&\quad \times \sum \limits _{n = 0}^\infty {\left[ {\frac{1}{{n!}}\left( { - \frac{{\beta _{2k} \beta _{1k} \gamma _{th} \gamma _{th} }}{{\Omega _{\hat{h},ak} P_r P_a (P_r P_a w - \beta _{1k} \gamma _{th} )}}} \right) ^n E_n \left( {\frac{{P_r P_a w - \beta _{1k} \gamma _{th} }}{{\Omega _{\hat{h},bk} P_r P_a }}} \right) } \right] } \nonumber \\&\quad + \frac{{P_r P_b w - \alpha _{1k} \gamma _{th} }}{{\Omega _{\hat{h},bk} P_r P_b }}e^{ - \left( {\frac{1}{{\alpha _{2k} \Omega _{\hat{h},bk} }} + \frac{1}{{\alpha _{1k} \Omega _{\hat{h},ak} }}} \right) \frac{{\alpha _{1k} \alpha _{2k} \gamma _{th} }}{{P_r P_b }}} \nonumber \\&\quad \times \sum \limits _{n = 0}^\infty {\left[ {\frac{1}{{n!}}\left( { - \frac{{\alpha _{1k} \alpha _{2k} \gamma _{th} \gamma _{th} }}{{\Omega _{\hat{h},ak} P_r P_b (P_r P_b w - \alpha _{1k} \gamma _{th} )}}} \right) ^n E_n \left( {\frac{{P_r P_b w - \alpha _{1k} \gamma _{th} }}{{\Omega _{\hat{h},bk} P_r P_b }}} \right) } \right] } \qquad \quad \end{aligned}$$
(10)

where \( w = \frac{{\gamma _{th} }}{{P_r }}\frac{{\alpha _{1k} \beta _{2k} - \alpha _{2k} \beta _{1k} }}{{P_b \beta _{2k} - P_a \alpha _{2k} }}\) and \(E_n(\cdot )\) is the exponential integral function defined in (5.1.4) of [12].

Note that (8)–10) are generalized expressions for system outage probability of ANC protocol, which encompass the outage probability performance with perfect CSI as a special case ( \(\rho _a = \rho _b = 0\) ).

For better insights, we can represent (8) and (9) in simple closed-form by using a high SNR and low channel estimation error approximation. By applying the approximations \(K_1 (x) \approx 1/x\) and \(e^{ - x} \approx 1 - x\) for \(x \rightarrow 0\), (8) and (9) can respectively represented as (11 and (12).

$$\begin{aligned} \mathcal{\tilde{P} }_{out,k} \approx \left( {\frac{{\Omega _{e,ak} }}{{\Omega _{\hat{h},ak} }} + \frac{{\Omega _{e,bk} }}{{\Omega _{\hat{h},bk} }}} \right) \gamma _{th} + \left( {\frac{{4P_2 \Omega _{e,bk} }}{{P_1 \Omega _{\hat{h},ak} }} + \frac{{P_r \mathrm{{ + }}P_2 }}{{P_r P_1 \Omega _{\hat{h},ak} }} + \frac{1}{{P_r \Omega _{\hat{h},bk} }}} \right) \gamma _{th} \end{aligned}$$
(11)

and

$$\begin{aligned} \mathcal{\tilde{P} }_{out,k} \approx \left( {\frac{{\Omega _{e,ak} }}{{\Omega _{\hat{h},ak} }} + \frac{{\Omega _{e,bk} }}{{\Omega _{\hat{h},bk} }}} \right) \gamma _{th} + \left( {\frac{{4P_1 \Omega _{e,ak} }}{{P_2 \Omega _{\hat{h},bk} }} + \frac{1}{{P_r \Omega _{\hat{h},ak} }} + \frac{{P_r + P_1 }}{{P_r P_2 \Omega _{\hat{h},bk} }}} \right) \gamma _{th} \end{aligned}$$
(12)

By adopting additional approximation \(E_n (z) \approx E_0 (z) = e^{ - z} /z\) for \(z \rightarrow 0\), (10) can be approximated as

$$\begin{aligned} \begin{array}{lll} \mathcal{\tilde{P} }_{out,k}&{}&{} \approx \left( {\frac{{4P_2 \Omega _{e,bk} }}{{P_1 \Omega _{\hat{h},ak} }} + \frac{{4P_1 \Omega _{e,ak} }}{{P_2 \Omega _{\hat{h},bk} }} + \frac{{P_r + P_1 }}{{P_r P_2 \Omega _{\hat{h},bk} }} + \frac{{P_r + P_2 }}{{P_r P_1 \Omega _{\hat{h},ak} }}} \right) \gamma _{th} \\ &{}&{}\quad + \left( {\frac{{\Omega _{e,ak} }}{{\Omega _{\hat{h},ak} }} + \frac{{\Omega _{e,bk} }}{{\Omega _{\hat{h},bk} }}} \right) \gamma _{th} \\ \end{array} \end{aligned}$$
(13)

(11)–13) readily reveal that the outage probability will not approach zero even when the value of transmission SNR is infinite. The presence of channel estimation error causes the outage probability maintain a fixed level even noiseless channel is adopted. This fixed level cannot be eliminated totally. However, it can be reduced by adequate power control, which reveals the necessity of power allocation strategies.

4 Power Allocation

To mitigate the negative effect of imperfect CSI, we resort to adaptive power allocation by minimizing the outage probability under the total power consumed constraint. The optimization problem can be formulated under a total power constraint \(P_t\) as

$$\begin{aligned} P_r^* ,P_a^* ,P_b^* = \arg \;\mathop {\min }\limits _{P_r ,P_a ,P_b } \;\mathcal P _{out} \nonumber \\ s.t.\left\{ \begin{array}{l} P_r + P_a + P_b \leqslant P_t \\ P_r ,P_a ,P_b \geqslant 0\\ \end{array} \right. \end{aligned}$$
(14)

From (6), we can observe that optimizing \(\mathcal P _{out}\) is equivalent to optimizing \(\mathcal P _{out,k}\), where \(k \in \{ 1,2, \ldots ,K\}\). Therefore, similar to [10], the optimization problem given in (14) is equivalent to the following one

$$\begin{aligned} P_{r,k}^* ,P_{a,k}^* ,P_{b,k}^* = \arg \;\mathop {\max }\limits _{P_{r,k} ,P_{a,k} ,P_{b,k} } \;\min \left( {\gamma _{ak} ,\;\gamma _{bk} } \right) \nonumber \\ s.t.\left\{ \begin{array}{l} P_{r,k} + P_{a,k} + P_{b,k} \leqslant P_t \\ P_{r,k} ,P_{a,k} ,P_{b,k} \geqslant 0\;and\;k \in \{ 1,2, \ldots ,K\} \\ \end{array} \right. \end{aligned}$$
(15)

As mentioned in [10], the above can be solved by first balancing \(\gamma _{ak} = \gamma _{bk}\). Applying Kuhn-Tucker conditions [13] for Lagrangian optimality, we can obtain the following optimal solution after some involved manipulations:

$$\begin{aligned} \left\{ \begin{array}{l} P_{a,k}^* = \frac{{P_t }}{2}\frac{{\sqrt{|\hat{h}_{ak} |^2 |\hat{h}_{bk} |^2 (1 + \Omega _{e,ak} P_t )(1 + \Omega _{e,bk} P_t )} - |\hat{h}_{bk} |^2 (1 + \Omega _{e,bk} P_t )}}{{|\hat{h}_{ak} |^2 (1 + \Omega _{e,ak} P_t ) - |\hat{h}_{bk} |^2 (1 + \Omega _{e,bk} P_t )}}\\ P_{b,k}^* = \frac{{P_t }}{2}\frac{{|\hat{h}_{ak} |^2 (1 + \Omega _{e,ak} P_t ) - \sqrt{|\hat{h}_{ak} |^2 |\hat{h}_{bk} |^2 (1 + \Omega _{e,ak} P_t )(1 + \Omega _{e,bk} P_t )} }}{{|\hat{h}_{ak} |^2 (1 + \Omega _{e,ak} P_t ) - |\hat{h}_{bk} |^2 (1 + \Omega _{e,bk} P_t )}}\\ P_{r,k}^* = \frac{1}{2}P_t \\ \end{array} \right. \end{aligned}$$
(16)

When \(\rho _a = \rho _b = 0,\, \Omega _{e,ak} = \Omega _{e,bk} = 0\), then (16) reduces to

$$\begin{aligned} \left\{ \begin{array}{l} P_{a,k}^* = \frac{{P_t }}{2}\frac{{|\hat{h}_{bk} |}}{{|\hat{h}_{ak} | + |\hat{h}_{bk} |}} \\ P_{b,k}^* = \frac{{P_t }}{2}\frac{{|\hat{h}_{ak} |}}{{|\hat{h}_{ak} | + |\hat{h}_{bk} |}} \\ P_{r,k}^* = \frac{1}{2}P_t \\ \end{array} \right. \end{aligned}$$
(17)

which corresponds to the optimal power allocation provided in [10], indicating that (16) is the generalized power allocation form for ANC protocol. Substituting (16) into the objective function, we can obtain the optimum SNRs.

$$\begin{aligned} \gamma _{ak}&= \gamma _{bk} \nonumber \\&= \frac{{P_t |\hat{h}_{ak} ||\hat{h}_{bk} |}}{{|\hat{h}_{ak} |(2 + \Omega _{e,bk} P_t ) + |\hat{h}_{bk} |(2 + \Omega _{e,ak} P_t ) + 4|\hat{h}_{ak} |\sqrt{1 + \Omega _{e,bk} P_t } \sqrt{1 + \Omega _{e,ak} P_t } }} \nonumber \\&{\mathop {=}\limits ^\Delta }&\quad \gamma _k^* \end{aligned}$$
(18)

On applying the proposed power allocation algorithm, the max-min relay selection criterion presented in (5) can be reformulated as

$$\begin{aligned} k^*&= \arg \mathop {\max }\limits _{k \in \{ 1,2,...,K\} } \mathop {\max }\limits _{P_{r,k} + P_{a,k} + P_{b,k} \leqslant P_t } \;\min \left( {\gamma _{ak} ,\;\gamma _{bk} } \right) \nonumber \\&= \arg \mathop {\max }\limits _{k \in \{ 1,2,...,K\} } \;\gamma _k^* \end{aligned}$$
(19)

As shown in (19), we skillfully combine the ORS policy with the optimal power allocation. It is well known that opportunistic relay selection and power allocation for relaying protocols are both effective means to enhance system performance. Thereby, the combination of them can bring significant performance improvement. To provide guidelines for practical system design, we summarize the joint relay selection and power allocation scheme as follows

  1. a)

    Select the optimal relay based on the following criterion \(k^* = \arg \mathop {\max }\limits _{k \in \{ 1,2,...,K\} }\,\frac{{P_t |{\hat{h}}_{ak} ||{\hat{h}}_{bk} |}}{{|{\hat{h}}_{ak} |(2 + \Omega _{e,bk} P_t ) + |{\hat{h}}_{bk} |(2 + \Omega _{e,ak} P_t ) + 4|{\hat{h}}_{ak} |\sqrt{1 + \Omega _{e,bk} P_t } \sqrt{1 + \Omega _{e,ak} P_t } }}\)

  2. b)

    Calculate the power levels of both nodes \(A\) and \(B\) according to (16).

  3. c)

    Use the feedback channel to notify the selected relay and the power levels.

5 Numerical and Simulation Results

In this section, Monte Carlo simulations are performed to verify the accuracy of our analytical results and present the performance of the proposed power allocation algorithm. All channels in the cooperation model are described by Rayleigh fading. We consider a 2-D network topology and normalize the distance between \(A\) and \(B\) to unity. We let \(d_i\) denote the normalized distance between nodes \(i\) and relay \(R\). Nodes \(A\) and \(B\) are located at points (0, 0) and (1, 0). We assume that the data rate requirement \(R_{th} = 0.5\) bps/Hz and the path loss exponent \(\alpha =3\). Thus, \(\Omega _{h,ik} = d_i^{ - 3}\) and \(\Omega _{e,ik} = \rho _i d_i^{ - 3}\), where \(i \in \left\{ {a,b} \right\} \).

In Fig. 2, the system outage probability of two-way AF relay system based on opportunistic relay selection is presented by varying SNR with \(\rho _a = \rho _b = 0.005\) and relay numbers \(K=1,2,3,4,5\). We consider uniform power allocation ( \(P_r = P_a = P_b \) ) and the relay locations (0.5, 0), (0.5, 0), (0.5, 0.25), (0.25, 0.25) and (0.25, – 0.25). As shown in Fig. 2, our theoretical curves are in excellent agreement with the Monte Carlo simulation results, which validates the accuracy of our derived expressions. Also, we can observe that the outage probability reaches a fixed level, called error floor, due to the imperfection in the channel estimation.

Fig. 2
figure 2

System outage probability against SNR with \(\rho _a = \rho _b =0.005\) and relay numbers \(K=1,2,3,4,5\)

In Fig. 3, we make the comparisons in terms of the system outage probability between the proposed power allocation algorithm and the conventional uniform power allocation strategy. We assume that the three nodes are located in a straight line with \(d_a + d_b = 1\) and consider \(\rho _a = \rho _b = 0.005\) and relay numbers \(K=1,2,3\). As can be clearly seen from Fig. 3, the proposed power allocation brings significant performance improvement compared with the uniform power allocation, which is more remarkable when the relays are located close to either node.

Fig. 3
figure 3

System outage probability against \(d_a\) with \(\rho _a = \rho _b =0.005\), SNR=20dB and relay numbers \(K=1,2,3\)

To gain more insight into the impact of the imperfect CSI on the performance of ANC protocol for a two-way relaying system based on ORS, in Fig. 4, we present the overall system outage probability against the channel estimation error. We assume that \(d_a = d_b = 0.5\) and vary \(\rho _a=\rho _b=\rho \) from 0.001 to 0.1. From Fig. 4, we can observe that the proposed power allocation outperforms the uniform power allocation, where the performance improvement brought by the proposed algorithm increases with \(\rho \). Therefore, it is necessary to apply the proposed power allocation to ANC protocol with imperfect CSI.

Fig. 4
figure 4

System outage probability against \(\rho \) with \(d_a=d_b=0.5\), SNR=10dB and relay numbers \(K=1,3\)

6 Conclusions

In this paper, we study the performance and instantaneous power allocation for two-way opportunistic AF relaying with imperfect CSI under flat Rayleigh fading channels. We have first derived a generalized closed-form expression of the system outage probability. Then, an optimum power allocation scheme is proposed so as to minimize the system outage probability, forming a joint relay selection and power allocation scheme. Simulation results verify that our derived outage probability expression is accurate and the proposed power allocation algorithm is greatly superior to conventional uniform power allocation, hence mitigating the negative impact of imperfect CSI. As further work, it should be interesting to analyze the ANC protocol for frequency selective channels.