## 3 Optimal Power Allocation for FD Mode  
To find the optimal power allocation for the FD relay, we first calculate the SEP of the considered system using the definition given in Reference [26] as follows  
\[\text{SEP}=a\mathbb{E}\{Q(\sqrt{b\gamma_{\text{e2e}}})\}=\frac{a}{\sqrt{2\pi} }\int\limits_{0}^{\infty}F_{\gamma_{\text{e2e}}}\Big{(}\frac{t^{2}}{b}\Big{)}e ^{-\frac{t^{2}}{2}}dt, \tag{7}\]  
where \(a\) and \(b\) are constants whose values depend on the modulation types, for example, \(a=1,b=2\) for the binary phase-shift keying (BPSK) modulation [26]. The values of \(a\) and \(b\) are determined using Table 6.1 of Reference [26]; \(Q(x)\) is the Gaussian function; \(\gamma_{\text{e2e}}\) is the instantaneous end-to-end SINR of the considered system which is determined in (6); \(F_{\gamma_{\rm e2e}}(. )\) is cumulative distribution function (CDF) of \(\gamma_{\rm e2e}\)[21; 27]. After some mathematical manipulations, (7) becomes  
\[\mathrm{SEP}=\frac{a\sqrt{b}}{2\sqrt{2\pi}}\int\limits_{0}^{\infty}\frac{e^{-bx /2}}{\sqrt{x}}F_{\gamma_{\rm e2e}}(x)dx. \tag{8}\]  
To obtain the closed-form expression of (8), we calculate the CDF, \(F_{\gamma_{\rm e2e}}(x)\), of the probability that the instantaneous end-to-end SINR falls below a defined threshold. Mathematically, \(F_{\gamma_{\rm e2e}}(x)\) is expressed as  
\[F_{\gamma_{\rm e2e}}(x) =\Pr\left\{\log_{2}(N_{t})+\log_{2}(1+\gamma_{\rm e2e})<\mathcal{ R}\right\}\] \[=\Pr\left\{\gamma_{\rm e2e}<2^{\mathcal{R}-\log_{2}(N_{t})}-1 \right\}, \tag{9}\]  
where \(\mathcal{R}\) is the minimum data transmission rate of the considered system; the term \(\log_{2}(N_{t})\) denotes the number of bits which is used for activating the transmit antenna at the transmitters of (S or R). Using the probability law of two independent variables \(\mathcal{A}\) and \(\mathcal{B}\)[28], that is \(\Pr\{\mathcal{A}\cup\mathcal{B}\}=\Pr\{\mathcal{A}\}+\Pr\{\mathcal{B}\}- \Pr\{\mathcal{A}\}\Pr\{\mathcal{B}\}\), we have  
\[F_{\gamma_{\rm e2e}}(x)= \Pr\left\{\gamma_{\rm e2e}<2^{\mathcal{R}-\log_{2}(N_{t})}-1 \right\}=\Pr\{\gamma_{\rm e2e}<x\}\] \[= \Pr\{\gamma_{\rm R}<x\}+\Pr\{\gamma_{\rm D}<x\}\] \[-\Pr\{\gamma_{\rm R}<x\}\Pr\{\gamma_{\rm D}<x\}, \tag{10}\]  
where \(x=2^{\mathcal{R}-\log_{2}(N_{t})}-1\). To calculate \(F_{\gamma_{\rm e2e}}(x)\) in (10), we first start with the CDF and probability distribution function (PDF) of the channel gain which follows Rayleigh fading distribution, that is,  
\[F_{|h|^{2}}(x) =\Pr\{|h|^{2}<x\}=1-\exp\left(-\frac{x}{\Omega}\right),x\geqslant 0, \tag{11}\] \[f_{|h|^{2}}(x) =\frac{1}{\Omega}\mathrm{exp}\left(-\frac{x}{\Omega}\right),x \geqslant 0, \tag{12}\]  
where \(\Omega=\mathbb{E}\{|h|^{2}\}\) is the average channel gain; \(\mathbb{E}\) denotes the expectation operator. In this paper, for the ease of presentation, we choose \(\Omega=1\) for all channel gains. Then, we apply (11) and (12) to compute the probability in (10) as  
Table 6.0 Table 6.1  
Based on the CDF of the summation of channel gains [20], this probability is calculated as  
Table 6.2  
Using similar calculations, we can obtain \(\Pr\{\gamma_{\rm D}<x\}\) as  
Table 6.3Finally, \(F_{\gamma_{\rm e2}}(x)\) in (10) can be given by  
Table 6.4  
Remark: As shown in (16), the active antenna at the transmitter is hidden in the variable \(x\) because \(x=2^{\mathcal{R}-\log_{2}(N_{l})}-1\). Moreover, under the assumption that the receiver can estimate the index of the transmitter's activated antenna, it can successfully decode the transmitted bits used to modulate the active antenna. Substituting \(F_{\gamma_{\rm e2}}(x)\) in (16) into (8), we obtain the closed-form expression of SEP as follows:  
\[