## 3 Performance Analysis
### Ber
#### 3.1.1 Derivation of \(\mathrm{P_{ci}}\) and \(\mathrm{P_{cm}}\)  
\(P_{ci}\) and \(P_{cm}\) are related to the error probability of the Walsh code detection \(P_{ed}\). The probability of detecting any of the Walsh-encoded \(2^{m_{ci}}-1\) error row vectors is the same, and it equals \(\frac{1}{2^{m_{ci}}-1}\). The expectation of the number of wrong code index bits is [16,34]  
\[D=\sum_{i=1}^{m_{ci}}i\frac{\binom{m_{ci}}{i}}{2^{m_{ci}}-1} \tag{18}\]  
where \(\binom{m_{ci}}{i}=\frac{m_{ci}!}{i!(m_{ci}-i)!}\). Thus, the BER of the code index bits can be calculated as [16,33]  
\[P_{ci}=\frac{D}{m_{ci}}P_{ed} \tag{19}\]  
For the BER of the code-modulated bits, the error could be caused by two separate mechanisms. On the one hand, the code index detection is correct, but the code-modulated bits are recovered incorrectly. On the other hand, there is an error in the code index detection. Therefore, the BER of the code-modulated bits can be given as [16, 17, 18, 34]  
\[P_{cm}=P_{e}(1-P_{ed})+\frac{1}{2}P_{ed} \tag{20}\]  
where \(P_{e}\) is the BER of the MDCSK modulation. To calculate \(P_{el}\), the mean of \(Z_{nq}\) is obtained as  
\[E[Z_{nq}]=\left\{ \begin{array}{ll}c_{n}\sum\limits_{l=1}^{L_{rd}} \alpha_{rd,l}^{2}\frac{E_{s}}{(N+1)U},&q=x_{n}\\ d_{n}\sum\limits_{l=1}^{L_{rd}}\alpha_{rd,l}^{2}\frac{E_{s}}{(N+1)U},&q=y_{n} \\ 0,&q\
eq x_{n}\;and\;\;q\
eq y_{n}\\ b_{n}\sum\limits_{l=1}^{L_{rd}}\alpha_{rd,l}^{2}\frac{E_{s}}{(N+1)U},&W_{nq}=W_ {k}\end{array} \right. \tag{21}\]  
\(c_{n}\) and \(d_{n}\) are the in-phase and quadrature components of the \(n^{th}\) M-ary constellation symbol \(M_{n}=c_{n}+jd_{n}\). \(c_{n}\) and \(d_{n}\) satisfy \(c_{n}^{2}+d_{n}^{2}=1\). There are M different combinations of values for \(c_{n}\) and \(d_{n}\). The system performance indicators obtained in the case of different combinations of values are the same. To simplify the analysis, we choose one of them to analyze the system performance. Therefore, we assume \(c_{n}=d_{n}=\frac{\sqrt{2}}{2}\). \(b_{n}\) is the polarity-modulated symbol. There are two values for \(b_{n}\): \(+1\) and \(-1\). We assume \(b_{n}=+1\) for the convenience of the theoretical derivation. Thus, \(E[Z_{nq}]\) can be simplified as  
\[E[Z_{nq}]=\left\{ \begin{array}{ll}\frac{\sqrt{2}}{2}\sum\limits_{l=1}^{L_{rd }}\alpha_{rd,l}^{2}\frac{E_{s}}{(N+1)U}=\mu_{1},&q=x_{n}\;or\;\;q=y_{n}\\ 0,&q\
eq x_{n}\;and\;\;q\
eq y_{n}\\ \sum\limits_{l=1}^{L_{rd}}\alpha_{rd,l}^{2}\frac{E_{s}}{(N+1)U},&W_{nq}=W_{k} \end{array} \right. \tag{22}\]  
Then, the variance of \(Z_{nq}\) is obtained as  
\[Var[Z_{nq}]=\left\{ \begin{array}{ll}\frac{3}{4}\sum\limits_{l=1}^{L_{rd}} \alpha_{rd,l}^{2}\frac{E_{s}N_{0,rd}}{(N+1)U}+\frac{N_{0,rd}^{2}}{4}U=\sigma _{1}^{2},&q=x_{n}\;or\;q=y_{n}\\ \frac{1}{2}\sum\limits_{l=1}^{L_{rd}}\alpha_{rd,l}^{2}\frac{E_{s}N_{0,rd}}{(N +1)U}+\frac{N_{0,rd}^{2}}{4}U=\sigma_{2}^{2},&q\
eq x_{n}\;and\;q\
eq y_{n}\\ \sum\limits_{l=1}^{L_{rd}}\alpha_{rd,l}^{2}\frac{E_{s}N_{0,rd}}{(N+1)U}+\frac {N_{0,rd}^{2}}{4}U=\sigma_{3}^{2},&W_{nq}=W_{k}\end{array} \right. \tag{23}\]  
where \(E_{s}=(1+N)UE[x_{n}^{2}]\) is defined as the average symbol energy of the proposed system. We set \(\gamma_{rd}=\sum\limits_{l=1}^{L_{rd}}\alpha_{rd,l}^{2}\frac{E_{s}}{N_{0,rd}}\), \(Var[Z_{nq}]\) can be simplified as  
\[Var[Z_{nq}]=\left\{ \begin{array}{ll}\sum\limits_{l=1}^{L_{rd}} \alpha_{rd,l}^{2}E_{s}N_{0,rd}\left(\frac{3}{4(N+1)U}+\frac{U}{4\gamma_{rd}} \right)=\sigma_{1}^{2},&q=x_{n}\;\;or\;\;q=y_{n}\\ \sum\limits_{l=1}^{L_{rd}}\alpha_{rd,l}^{2}E_{s}N_{0,rd}\left(\frac{1}{2(N+1) U}+\frac{U}{4\gamma_{rd}}\right)=\sigma_{2}^{2},&q\
eq x_{n}\;and\;\;q\
eq y_{n}\\ \sum\limits_{l=1}^{L_{rd}}\alpha_{rd,l}^{2}E_{s}N_{0,rd}\left(\frac{1}{(N+1) U}+\frac{U}{4\gamma_{rd}}\right)=\sigma_{3}^{2},&W_{nq}=W_{k}\end{array} \right. \tag{24}\]  
where \(\gamma_{rd}\) is the instantaneous signal-to-noise ratio (SNR) of the \(R\to D\) link. We assume that the recovered code index symbol of the \(n^{th}\) path is \(\xi_{n}=\dot{q},q=x_{n}\;or\;q=y_{n}\).