## 5 Simulation Results and Analysis  
In this section, simulation results are illustrated to evaluate the performance of the proposed algorithm. We consider the Rayleigh fading channel with the central frequency given at 1.9 GHz. We set the distance from the source to each relay and the distance from each relay to the destination both as 2 m. The number of subcarriers is 32, and the noise variance is fixed to \(-80\) dbm. In order to demonstrate the superiority of our proposed algorithm, Figure 3 exhibits the performance comparison of the proposed algorithm with the following three algorithms as shown in Algorithms 2-4, where there are five relays and the energy conversion efficiency at each relay is set as \(\xi=1\). Algorithm 2: The power allocation for relay to forward the \(S\) signal in the second timeslot is equally allocated. The subcarrier allocation is performed according to \(k_{n,t}^{*}=\arg\max_{k}\left\{SNR_{n,k,t}\right\}\), where \(SNR_{n,k,t}=\frac{h_{n,k,t}p_{n,k,t}}{\rho^{2}}\), which means in the hop \(t\), the subcarrier \(n\) will be allocated to relay \(k\) which has the maximum value of \(SNR_{n,k,t}\). Figure 3: The transmission rate versus the source transmit power \(P_{s}\). Figure 2: Flowchart of the proposed algorithm. ```
1:Given \(P_{S}\). 2:Compute \(SNR_{n,k,t}\). 3:Obtain the optimal subcarrier allocations \(\left\{{S_{1,k}^{I}}^{*},{S_{1,k}^{E}}^{*},{S_{2,k}}^{*}\right\}\) according to \(k_{n,t}^{*}=\arg\max_{k}\left\{SNR_{n,k,t}\right\}\). 4:Compute the power allocation \(p_{n,k,2}=\sum\limits_{n\in S_{1,k}^{E}}\xi\left({{{\left({{h_{n,k,1}}{p_{n,k,1} +\sigma^{2}}\right)}}\right/\left|{{\mathcal{G}}_{{S_{2,k}}^{*}}}\right|}}\). ```  
**Algorithm 3** The power allocation for relay to forward the \(S\) signal in the second timeslot is equally allocated. In the first timeslot, subcarriers are equally allocated to \(K\) relays. And in the second timeslot, relays utilized the same subcarriers to forward the \(S\) signal. ```
1:Initialize \(S_{1,k}^{I}=\varnothing\) and given \(P_{S}\). 2:For\(i=1\) to \(\frac{N}{K}\)
3:\(S_{1,k}^{I}=\left\{S_{1,k}^{I},n+\frac{N(k-1)}{K}\right\}\). 4:end
5:\(S_{2,k}=S_{1,k}^{I}\) and \(S_{1,k}^{E}=\mathcal{N}-S_{1,k}^{I}\). 6:Compute the power allocation \(p_{n,k,2}=\sum\limits_{n\in S_{1,k}^{E}}\xi\left({{{\left({{h_{n,k,1}}{p_{n,k,1 }+\sigma^{2}}\right)}}\right/\left|{{\mathcal{G}}_{{S_{2,k}}}}\right|}}\). ```  
**Algorithm 4** The power allocation for a relay to forward the \(S\) signal in the second timeslot is equally allocated. The number of subcarriers for each relay used to decode information in the first timeslot is consistent with the number of subcarriers utilized for forwarding re-encoded information in the second timeslot. The Hungary method is used to perform the subcarrier allocation according to \(u_{n,n^{\prime},k}=\frac{{{SNR_{n,k,1}}+{{SNR_{n^{\prime},k,2}}}}}{{{{SNR_{n,k,1}}}\cdot{{SNR_{n^{\prime},k,2}}}}}\), where \(SNR_{n,k,1}=\frac{{{h_{n,k,1}}{p_{n,k,1}}}}{{{\sigma^{2}}}}\) and \(SNR  
Figure 4 depicts the transmission rate versus \(P_{s}\) with different number of relays. In Figure 4, we find that when the number of relays increase, the achieved rates also increase. For example, when \(P_{S}=2.5\) W, the transmission rate achieved by six relays and 10 relays is increased by about 1.1 bit/s/Hz and 1.6 bit/s/Hz, respectively, compared to the case of two relays. The reason is that with the increase of relays, it can have more and better channels, then each relay will assign more subcarriers for energy harvesting. Moreover, it is shown that the transmission rate decreases as the transmission power decreases with the same number of relays. In particular, at six relays, the transmission rate dropped by 10% as the source's power dropped from 2.5 W to 0.5 W.  
In Figure 5, we exhibit the transmission rate versus the number of relays with different \(P_{s}\). It is obvious that the increase of the source's transmitted power results in the increase of the transmission rate.