# Efficient Modulation Scheme for Intermediate Relay-Aided IoT Networks
## 3 Proposed Solution
### Proposed BER Minimization Solution  
Assume that the information-bearing index \(p\) follows a uniform distribution; then, the BER using pairwise error probability (PEP) [46] can be written as  
\[P_{BER}=\sum_{p=0}^{Q-1}\sum_{q=0}^{Q-1}P_{PEP}(q|p)\frac{B[p,q]}{Q}, \tag{3}\]  
where \(P_{PEP}(q|p)\) denotes the probability for the ML decoder to prefer \(q\) over \(p\) when \(p\) is actually transmitted; \(B[p,q]\) represents the Hamming distance normalized by \(\log_{2}Q\). According to (2), we have  
\[P_{PEP}(q|p)=P_{h_{0},h_{1},h_{2},v_{1},v_{2}}\{\theta(p,q,\lambda_{1},\lambda _{2})<0\}. \tag{4}\]  
Figure 1: Intermediate relay-aided HARQ network. in which, given random channels and random noise variables \(h_{0},h_{1},h_{2},v_{1},v_{2}\), \(\vartheta\) is defined as  
\[\vartheta =|h_{0}(\lambda_{0}[p]-\lambda_{0}[q])+v_{1}|^{2}-|v_{1}|^{2}+\] \[|h_{1}(\lambda_{1}[p]-\lambda_{1}[q])+h_{2}(\lambda_{2}[p]- \lambda_{2}[q])+v_{2}|^{2}-|v_{2}|^{2}. \tag{5}\]  
In other words, given indices \(p,q\) and the remapping scheme \(\lambda_{1}\), \(\lambda_{2}\), the pairwise error event, is equivalent to \(\vartheta<0\). In order to formulate the quadratic assignment problem, we introduce binary variables  
\[x_{pij}=\left\{ \begin{array}{ll}1,&\text{if }\lambda_{1}[p]=\lambda_{0}[i] \text{ and }\lambda_{2}[p]=\lambda_{0}[j]\\ 0,&\text{otherwise.}\end{array} \right.\]  
Let us denote \(\mathbf{x}=\{x_{pij}|\ p,i,j=0,\ldots,Q-1\}\) and the constraint set as  
\[\mathcal{P}=\left\{\mathbf{x}:\ \sum_{p=0}^{Q-1}x_{pij}=1,x_{pij}\in\{0,1\} \right\}. \tag{6}\]  
We further denote \(\mathcal{I}\) and \(\mathcal{J}\) as in (6) by replacing the summation index \(p\) with \(i\) and \(j\), respectively. Then from (3)-(5), the BER minimization modulation diversity scheme \(\min_{\lambda_{1},\lambda_{2}}P_{BER}\) becomes  
\[\min_{\mathbf{x}}\sum_{p=0}^{Q-1}\sum_{i=0}^{Q-1}\sum_{j=0}^{Q-1} x_{pij}\sum_{l=0}^{Q-1}\sum_{q=0}^{Q-1}\sum_{k=0}^{Q-1}c_{p,i,j,q,k,l}\times x_{qkl}, \tag{7}\] \[\text{s.t.}\mathbf{x}\in\mathcal{P}\cap\mathcal{I}\cap\mathcal{J}.\]  
in which  
\[c_{p,i,j,q,k,l} =\frac{B[p,q]}{Q}P_{h_{0},h_{1},h_{2},v_{1},v_{2}}\{\theta(p,i,j,q,k,l)<0\}, \tag{8}\] \[\vartheta =|h_{1}(\lambda_{0}[i]-\lambda_{0}[k])+h_{2}(\lambda_{0}[j]- \lambda_{0}[l])+v_{2}|^{2}\] \[+|h_{0}(\lambda_{0}[p]-\lambda_{0}[q])+v_{1}|^{2}-|v_{1}|^{2}-|v_ {2}|^{2}. \tag{9}\]  
It can be noted from the expression in (8) that the key to finding \(c_{p,i,j,q,k,l}\) lies in the evaluation of \(P_{h_{0},h_{1},h_{2},v_{1},v_{2}}\{\theta(p,i,j,q,k,l)\). In simple terms, this is the cumulative distribution function (CDF) of the random variable \(\vartheta(p,i,j,q,k,l)\) of (5). Let us define the moment generating function (MGF) as  
\[\Phi_{\vartheta}(\rho)=\mathbb{E}_{\vartheta}[\exp(-\rho\vartheta)]. \tag{10}\]  
Under the well known Rician channel model, \(h_{m}\sim\mathcal{CN}(\mu_{h_{m}},\sigma_{h_{m}}^{2}),m=0,1,2\), we can extend the method proposed in [46; 47] to compute \(P_{h_{0},h_{1},h_{2},v_{1},v_{2}}\{\theta(p,i,j,q,k,l)<0\}\):  
\[P_{h_{0},h_{1},h_{2},v_{1},v_{2}}\{\theta(p,i,j,q,k,l)<0\}\approx\frac{1}{2v} \sum_{t=1}^{v}\Re\left\{\Phi_{\vartheta}(\xi+j\xi\tau_{t})\right\}+\tau_{t} \Im\left\{\Phi_{\vartheta}(\xi+j\xi\tau_{t})\right\}, \tag{11}\]  
where  
\[\tau_{t}=\tan((t-1/2)\pi/v), \tag{12}\]  
and \(\Re\{\cdot\}\) and \(\Im\{\cdot\}\) denote the real and imaginary parts, respectively. The parameter \(\xi\) is selected to ensure convergence of the integration, and \(\xi=1/4\) was suggested in [47]. The size \(v\) of the expansion (11) needs to be large when \(P_{h_{0},h_{1},h_{2},v_{1},v_{2}}\{\theta(p,i,j,q,k,l)<0\}\) is small in order to maintain an acceptable numerical accuracy.