# Joint Power Allocation and Link Selection for Multi-Carrier Buffer Aided Relay Network
## 2 System Model and Problem Formulation  
### System Model  
We consider an OFDM-based network that consists of one source node i.e., a base station (BS), one destination node i.e., the mobile user (MU) and a buffer-aided DF relay (\(R_{b}\)) node. The BS is communicating with the MU on the downlink, as shown in Figure 1. The direct communication link is missing between source and destination nodes due to the large distance between them. Thus, \(R_{b}\) is mandatory for successful communication. Further, we assume a single antenna on each transmitting node under half-duplex mode. For the total \(T\) time slots of equal lengths, in any \(t\)-th time, \(R_{b}\) receives data packets from the BS and stores in the buffer. In the next \(t+\Delta\) time slot, where \(\Delta\) is any positive integer, relay forwards the packets to the MU.  
Let the gain on the links from BS to \(R_{b}\), from \(R_{b}\) to MU and the additive white Gaussian noise (AWGN) at BS and \(R_{b}\) in any \(t\)-th time slot on \(i\)-th subcarrier are denoted by \(g_{i,t}\), \(h_{i,t}\), \(\sigma^{2}_{BS_{i},t}\), and \(\sigma^{2}_{R_{bij},t}\)  
\begin{table}
\begin{tabular}{c c} \hline \hline OFDM & Orthogonal Frequency division multiplexing \\ DF & Decode and forward \\ AF & Amplify and forward \\ BAR & Buffer aided relaying \\ FD & Full duplex \\ SOP & Secrecy outage probability \\ SOC & Secrecy outage capacity \\ EST & Exact secrecy throughput \\ EH & Energy harvesting \\ BS & Base station \\ MU & Mobile user \\ SIC & Self interference cancellation \\ AWGN & Additive white Gaussian noise \\ SNR & Signal to noise ratio \\ FIFO & First in first Out \\ Km & Kilometer \\ P.L. & Path loss \\ \hline \hline \end{tabular}
\end{table}
Table 1: List of acronyms.  
respectively. Thus, the signal to noise ratio (SNR) at first hop on the \(i\)-th sub-carrier during \(t\)-th time can be expressed as;  
\[\text{SNR}^{1}_{i,t}=\frac{P^{BS}_{i,t}|g_{i,t}|^{2}}{\sigma^{2}_{BS_{i,t}}}, \tag{1}\]  
and, \(\text{SNR}^{2}_{i,t}\) i.e., the SNR at second hop on the \(i\)-th sub-carrier during \(t\)-th time, is represented as;  
\[\text{SNR}^{2}_{i,t}=\frac{P^{R_{b}}_{i,t}|h_{i,t}|^{2}}{\sigma^{2}_{R_{b,t}}}, \tag{2}\]  
where, \(P^{BS}_{i,t}\) and \(P^{R_{b}}_{i,t}\) in the above equations are the transmit powers at BS and \(R_{b}\) over the \(i\)-th carrier during \(t\)-th time slot, respectively.  
Under the half duplex relaying protocol, the transmission is allowed only at a single hop in any given time slot. Thus, to incorporate the link selection in problem formulation, we define a binary decision variable \(\alpha_{t}\in\{0,1\}\) such that;  
\[\alpha_{t}=\left\{\begin{array}{ll}\mathbf{1},&\text{if the data flow is on first link at time $t$,}\\ \\ \mathbf{0},&\text{if the data flow is on second link at time $t$.}\end{array}\right.\]  
For \(\alpha_{t}=1\), data rates on both the hops during \(t\)-th time slot over the \(i\)-th sub-carrier (i.e., \(R^{1}_{i,t}\) and \(R^{2}_{i,t}\), respectively) can be expressed, mathematically, as;  
\[R^{1}_{i,t}=\log_{2}(1+\text{SNR}^{1}_{i,t}),\qquad R^{2}_{i,t}=0.\]  
Similarly, for \(\alpha_{t}=0\), we have;  
\[R^{1}_{i,t}=0,\qquad R^{2}_{i,t}=\log_{2}(1+\text{SNR}^{2}_{i,t}).\]  
With this, the end to end average throughput under DF transmission can be written as;  
\[R_{avg}=\text{min}\left(\lim_{T\to\infty}\frac{1}{T}\sum_{t=1}^{ T}\log_{2}(1+\alpha_{t}\text{SNR}^{1}_{i,t}),\right.\] \[\left.\lim_{T\to\infty}\frac{1}{T}\sum_{t=1}^{T}\log_{2}(1+(1- \alpha_{t})\text{SNR}^{2}_{i,t})\right). \tag{3}\]  
Figure 1: System model.