## 2 System and Channel Models
### Phase-2 (\(P_{2}\)): \(D_{1}\to\) (\(D_{2}\), FU) Data Transmission  
During \(P_{2}\), [PERSON]\({}_{1}\) invokes SM as well to transmit data bits to FU and D\({}_{2}\), only after decoding FU data bits from BS successfully. If the decoding of data bits is unsuccessful then D\({}_{1}\) remains idle during \(P_{2}\). Similar to \(P_{1}\), the information bits to be transmitted by D\({}_{1}\) is mapped into two data carrying units: the \(M_{2}\)-PSK/QAM modulation order bits and the antenna index. Here, the modulation order bits are the data bits received from BS that need to be forwarded to FU and the antenna index is associated with [PERSON]\({}_{1}\)'s own information for transmitting to D\({}_{2}\) as part of D2D communication. It should be mentioned that D\({}_{1}\) must exploit \(M_{2}=2^{N_{1}}\)-PSK/QAM modulation, in order to retransmit the decoded data bits of FU as the number of bits in a symbol of FU is \(N_{1}\). According to the concept of SM, only one antenna is allowed to be activated at D\({}_{1}\) at a particular time instant. [PERSON]\({}_{1}\) selects the transmit antenna to be activated based on its own message symbol. Again, single antenna transmission avoids ICI along with synchronization among the antennas, as D\({}_{1}\) exploits SM-MIMO to retransmit FU data and and its own data to D\({}_{2}\). As a result, an interference free data reception is possible by both FU and D\({}_{2}\). Now, the number of data bits that can be transmitted by D\({}_{1}\) in S\({}_{1}\) and S\({}_{2}\) are respectively given by  
\[ \begin{array}{ll}X_{2,S_{1}}&=N_{1}+N_{2}\\ &=\log_{2}(M_{1})+\log_{2}(A_{\rm D_{1}}),\end{array}  \tag{3}\]  
\[ \begin{array}{ll}X_{2,S_{2}}&=N_{1}+N_{2}\\ &=\log_{2}(A_{\rm BS})+\log_{2}(A_{\rm D_{1}}).\end{array}  \tag{4}\]  
where \(N_{2}\) is the number of bits in each symbol of D\({}_{2}\). Then \(i\)-MRC is used by both D\({}_{2}\) and FU, in order to de-map the data blocks from the received signal, where D\({}_{2}\) recovers the antenna index and the FU extracts desired modulation symbol. The proposed D2D aided CRS with the transmit antenna selection technique used by BS and D\({}_{1}\) is summarized in Algorithm 1. Moreover, the examples provided in Tables 1 and 2 explain Algorithm 1 in a much simpler way. In Table 1, an example of SM mapping table at BS to transmit information to NU and FU is presented, whereas an example of SM mapping table at D\({}_{1}\) is demonstrated in Table 2. Here, error free transmission is assumed for the examples provided in the tables to make the explanation of the algorithms simple. ```
1:begin
2:\(\text{U}_{\text{sm}}\leftarrow\text{block of data with length $Q_{1}$ corresponds to NU's data}\)
3:\(\text{F}_{\text{sm}}\leftarrow\text{block of data with length $N_{1}$ corresponds to FU's data}\)
4:\(\text{B}_{\text{sm}}\leftarrow\text{decoded block of data with length $N_{1}$ at D_{1}$ during $P_{1}$}\)
5:\(\text{D}_{\text{sm}}\leftarrow\text{D}_{1}\text{'}\)'s own data divided into block of length \(N_{2}\) \(\rhd\) Phase-I
6:SM-based mapping table (e.g., Table 1) is constructed at BS. 7:for\(i\) = 0 to A\({}_{\text{BS}}\) - 1 do
8:\(\text{A}_{index}=i_{b}\); equivalent binary bits of \(i\)
9:if\(\text{U}_{\text{sm}}=\text{A}_{index}\) [S\({}_{1}\)] or, \(\text{F}_{\text{sm}}=\text{A}_{index}\) [S\({}_{2}\)] then
10: BS transmits \(\text{F}_{\text{sm}}\) in S\({}_{1}\) and \(\text{U}_{\text{sm}}\) in S\({}_{2}\) by \(i_{th}\) antenna
11:endif
12:endfor
13:NU and D\({}_{1}\) attempts to decode their corresponding information using \(i\)-MRC. \(\rhd\) Phase-II
14:if decoding is successful then
15:for\(i\) = 0 to \(A_{\text{D}_{1}}\) - 1 do
16:\(\text{A}_{index}=i_{b}\); equivalent binary bits of \(i\)
17:if\(\text{D}_{\text{sm}}=\text{A}_{index}\)then
18:\(\text{D}_{1}\) transmits B\({}_{\text{sm}}\) by \(i\)th antenna
19:endif
20:endfor
21:else
22:\(\text{D}_{1}\) remains idle during \(P_{2}\). 23:endif
24:end
```  
**Algorithm 1** D2D-CRS-SM (A\({}_{\text{BS}}\), \(N_{1}\), \(Q_{1}\) A\({}_{\text{D}_{1}}\), \(N_{2}\))