# Performance Analysis of DF Relay-Assisted D2D Communication in a 5G mmWave Network
## 3 Problem Formulation and Analysis
### Zone 2
#### 3.2.2 Secondary Phase  
In this phase, D2D users are able to communicate with each other through the two-way DF relay node bidirectionally. The operation happens in two time slots, \(T1\) and \(T2\), as shown in Figure 2. In time slot \(T1\), the D2D users \(D1\) and \(D2\) transmit messages \(x_{1}\) and \(x_{2}\) respectively to the relay node simultaneously. The relay node is also affected by the interference from the cellular users. The received signal at the DF relay node is expressed as follows,  
\[\gamma_{R}^{2}=\sqrt{P_{AR}}h_{AR}d_{AR}^{-\alpha/2}x_{1}+\sqrt{P_{BR}}h_{BR}d_ {BR}^{-\alpha/2}x_{2}+\sqrt{P_{CR}}h_{CR}d_{CR}^{-\alpha/2}x_{3}+n_{R} \tag{15}\]  
In time slot \(T2\), the relay node then recovers the received messages \(x_{1}\) and \(x_{2}\) through maximum likelihood detection. After recovering the messages, it  
Figure 2: Line diagram representing the bidirectional exchange of information between \(D1\) and \(D2\) through the DF relay in the presence of interference and noise in different time slots. (**a**) time slot \(T1\) and (**b**) time slot \(T2\).  
\((x_{1}\bigoplus x_{2})\) through the bitwise binary XOR operation. After this operation, the relay node transmits the encoded signal to the respective D2D users.  
\[x_{R}=\sqrt{\eta}x_{1}+\sqrt{1-\eta}x_{2} \tag{16}\]  
Here, the relay uses an average transmit power of \(\eta P_{RA}\) in the forward direction and \((1-\eta)P_{RB}\) for the backward direction, where \(\eta\) is the power dividing factor. The BS also sends messages to the cellular link, which interfere with the received message at users \(D1\) and \(D2\), respectively. After applying the self-cancellation technique, the received signal at the respective D2D users can be expressed as follows,  
\[Y_{A}^{2}=\sqrt{P_{RA}(1-\eta)}d_{RA}^{-\alpha/2}h_{RA}(x_{1}\bigoplus x_{2})+ \sqrt{P_{SA}}h_{SA}d_{SA}^{-\alpha/2}x_{4}+n_{A} \tag{17}\]  
and:  
\[Y_{B}^{2}=\sqrt{P_{RB}\eta}d_{RB}^{-\alpha/2}h_{RB}(x_{1}\bigoplus x_{2})+ \sqrt{P_{SB}}h_{SB}d_{SB}^{-\alpha/2}x_{4}+n_{B} \tag{18}\]  
Now, in time slot T1, the SINR at the respective \(D1-R\) and \(D2-R\) links can be expressed as follows,  
\[\gamma_{AR}^{2}=\frac{P_{AR}|h_{AR}|^{2}d_{AR}^{-\alpha}}{P_{CR}|h_{CR}|^{2}d_ {CR}^{-\alpha}+N_{0}}=\frac{\gamma_{1}}{I_{R}+1} \tag{19}\]  
and:  
\[\gamma_{BR}^{2}=\frac{P_{BR}|h_{BR}|^{2}d_{BR}^{-\alpha}}{P_{CR}|h_{CR}|^{2}d_ {CR}^{-\alpha}+N_{0}}=\frac{\gamma_{2}}{I_{R}+1} \tag{20}\]  
where,  
\[\gamma_{1}=\frac{P_{AR}|h_{AR}|^{2}d_{AR}^{-\alpha}}{N_{0}} \tag{21}\]  
\[\gamma_{2}=\frac{P_{BR}|h_{BR}|^{2}d_{BR}^{-\alpha}}{N_{0}} \tag{22}\]  
and:  
\[I_{R}=\frac{P_{CR}|h_{CR}|^{2}d_{CR}^{-\alpha}}{N_{0}} \tag{23}\]  
Therefore, the sum SINR at the relay node can be given by,  
\[\gamma_{XR}^{2}=\frac{P_{AR}|h_{AR}|^{2}d_{AR}^{-\alpha}+P_{BR}|h_{BR}|^{2}d_ {BR}^{-\alpha}}{P_{CR}|h_{CR}|^{2}d_{CR}^{-\alpha}+N_{0}} \tag{24}\]  
For time slot T2, the SINR at the respective \(R-D1\) and \(R-D2\) links can be expressed as follows,  
\[\gamma_{RA}^{2}=\frac{P_{RA}(1-\eta)|h_{RA}|^{2}d_{RA}^{-\alpha}}{P_{SA}|h_{ SA}|^{2}d_{SA}^{-\alpha}+N_{0}}=\frac{\gamma_{3}}{I_{RA}+1} \tag{25}\]  
and:  
\[\gamma_{RB}^{2}=\frac{P_{RB}\eta|h_{RB}|^{2}d_{RB}^{-\alpha}}{P_{SB}|h_{SB}|^{ 2}d_{SB}^{-\alpha}+N_{0}}=\frac{\gamma_{4}}{I_{RB}+1} \tag{26}\]  
The notations \(\gamma_{3}\), \(\gamma_{4}\), \(I_{RA}\), and \(I_{RB}\) in the above Equations (25) and (26) can be represented as follows,  
\[\gamma_{3}=\frac{P_{RA}(1-\eta)|h_{RA}|^{2}d_{RA}^{-\alpha}}{N_{0}} \tag{27}\]  
\[\gamma_{4}=\frac{P_{RB}\eta|h_{RB}|^{2}d_{RB}^{-\alpha}}{N_{0}} \tag{28}\]\[I_{RA}=\frac{P_{SA}|h_{SA}|^{2}d_{SA}^{-\alpha}}{N_{0}} \tag{29}\]  
and:  
\[I_{RB}=\frac{P_{SB}|h_{SB}|^{2}d_{SB}^{-\alpha}}{N_{0}} \tag{30}\]