## 5 Simulation Results  
Simulation results are provided in this section to prove our proposed optimization algorithm. Assume six tap channels taken from COST207 model for all links [27]. We define the average SNR as \(P_{T}/N_{0}\). Furthermore, the transmission signal to noise ratio (SNR) of the primary user is assumed to be \(q_{s,i}/N_{0}=0\) dB, \(\forall i\). In addition, the number of subcarriers are set to be \(K=32\). For simplicity, \(SS\) and \(SR\) share the same peak power \(P_{S}=P_{R}=P_{T}/2\). We consider a common simulation layout, where the source, the relay, and the destination are deployed in a straight line and the relay is deployed at the midpoint unless otherwise specified. The path loss exponent is assumed 3. Figure 1 compares the performance of our proposed algorithm with that of [PERSON]'s method [16] and [PERSON]'s method [17], where normal means that all channel gains are normalized to unit one, while strong means that the channel quality of the direct link is 10 dB higher than that of the relaying link. It can be seen from Figure 1 that, when the channel quality of the direct link is good, the rate of [PERSON]'s exceeds that of [PERSON]'s. Conversely, when the channel quality of direct link deteriorates, the rate of [PERSON]'s method drops sharply and is lower than that of [PERSON]'s. This phenomenon fully shows that [PERSON]'s method focuses on the direct link instead of the relaying link, while [PERSON]'s focuses on the relaying link instead of the direct link. However, our proposed algorithm outperforms the other two approaches in the same environment because we can adaptively access the two links according to the decision criteria:  
Figure 1: A comparison of different algorithms, where normal means \(\mathrm{E}(a_{i})=\mathrm{E}(b_{i})=\mathrm{E}(g_{i})=1\) and strong means \(\mathrm{E}(a_{i})=\mathrm{E}(b_{i})=1\), \(\mathrm{E}(g_{i})=10\). Next, we prepare to compare the performance of the following suboptimal algorithms. (1) Fixed subcarrier: The subcarriers received and forwarded by the relay are the same, i.e., \(\rho_{i,j}=1\) for \(i=j\) and \(\rho_{i,j}=0\) otherwise. This method is equivalent to power allocation without subcarrier pairing in case with the proposed algorithm; (2) Equal power: Equal power is distributed across all subcarriers at secondary users. Specifically, the powers have to be respectively adjusted as \(p_{s,i}=\min\left(P_{T}/\left(2K\right),Q_{1}/\sum_{i}\sum_{j}\rho_{i,j}c_{i}\right)\) and \(p_{r,j}=\min\left(P_{T}/\left(2K\right),Q_{2}/\sum_{i}\sum_{j}\rho_{i,j}d_{j}\right)\) under total power constraint and \(p_{s,i}=\min\left(P_{1}/K,Q_{1}/\sum_{i}\sum_{j}\rho_{i,j}c_{i}\right)\) and \(p_{r,j}=\min\left(P_{2}/K,Q_{2}/\sum_{i}\sum_{j}\rho_{i,j}d_{j}\right)\) under separate power constraints due to the interference condition of the primary user. (4) Fixed subcarrier and equal power (FSEP): The subcarrier pairing is fixed as in case (1) and power is evenly distributed as in case (2). The impact of the average SNR on the sum rate is showed in Figure 2. We observe that the joint algorithm exhibits a substantial increase in promoting the sum rate of the secondary users at all SNR values. For example, at a target rate 1 bps/Hz, the optimal algorithm can save about 2 dB SNR in contrast to a fixed subcarrier case. Even the equal power case and FSEP case can not reach this target rate in this simulation experiment. Moreover, by comparing fixed subcarrier case and equal power case, we find that the power allocation is more efficient than subcarrier pairing in the aspect of sum rate promotion. Part of the fact is that, in the equal power scheme, the subcarrier pairing is not optimal due to the existence of interference constraints. Next, the effect of the interference constraint level \(Q_{1}\) on the sum rate is plotted in Figure 3, where \(Q_{1}=Q_{2}\).