# Design and Analysis of Joint Source-Channel Code System with Fixed-Length Code
## 2 Joint Source-Channel Code System
After channel decoding, the extrinsic LLRs, \(L_{CD}^{e}(\mathbf{d})\), are deinterleaved to obtain a priori LLRs \(L_{SD}^{a}(\mathbf{b})\) of the source coded bits, \(\mathbf{b}\), which are then input to the SBSD. The SBSD is realized by calculating the a posteriori probabilities of each bit of the codewords. In the  
Figure 2: Irregular channel encoder. a discrete source. Our goal is to perfectly reconstruct the discrete source symbols, i.e., minimize the symbol error rate (SER) [31],  
\[D\triangleq\frac{1}{K}\sum_{k\ =\ 1}^{K}E\{\mathrm{I}\{\widetilde{u}_{k}\
eq u_{k}\}\} \tag{4}\]  
where \(E\{.\}\) is the expectation of variables and \(\mathrm{I}\{.\}\) is the indicator function, i.e., \(\mathrm{I}\{a\}\) equals \(1\) if \(a\) is true, and \(0\) otherwise. For the memoryless source, the SER can be determined as  
\[ \begin{split}& D\triangleq P(\widetilde{u}_{k}\
eq u_{k})\\ &=\sum_{i\ =\ 1}^{N_{S}}p_{i}\sum_{j\ =\ 1,j\
eq i}^{N_{S}} \mathrm{Pr}(\widetilde{u}_{k}\ =\ S_{j}\big{|}u_{k}\ =\ S_{i})\end{split}  \tag{5}\]  
where \(p_{i}\) is the occurrence probability of the source symbol \(S_{i}\) and \(\mathrm{Pr}(\widetilde{u}_{k}\ =\ S_{j}\big{|}u_{k}\ =\ S_{i})\) is the pairwise error probability (PEP) of erroneously detecting \(S_{i}\) instead of \(S_{j}\). According to the estimate of the source symbol in (3). the symbol decision is determined by the input LLRs \(L^{a}_{SD}(b_{k,n})\) of each coded bit. Because the LLRs are permuted by a long random bit-interleaver during decoding, their statistic can be simplified and assumed to be the same and independent [32]. Hence, \(L^{a}_{SD}(\mathbf{b})\) can be characterized by the crossover probability, \(p_{c}\), of coded bits. Then, the sum of PEPs can be formulated as:  
\[ \begin{split}\mathrm{Pr}(\widetilde{u}_{k}&\
eq S_ {i}\big{|}u_{k}\ =\ S_{i})\ =\ \sum_{j\ =\ 1,j\
eq i}^{N_{S}}\mathrm{Pr}(\mathbf{c}^{(j)}|\mathbf{c}^{(j)})\\ &=\sum_{\mathbf{c}\in\mathbb{C}_{i}}p(\mathbf{c}|\mathbf{c}^{(i) })\\ &=\sum_{\mathbf{c}\in\mathbb{C}_{i}}(1-p_{c})^{L-d_{H}(\mathbf{c} ^{(i)},\mathbf{c})}p_{c}{}^{d_{H}(\mathbf{c}^{(i)},\mathbf{c})}\end{split}  \tag{6}\]  
where \(d_{H}(\mathbf{c}^{(i)},\mathbf{c})\) is the Hamming distance between the codewords \(\mathbf{c}^{(i)}\) and \(\mathbf{c}\). By substituting Equation (6) into Equation (5), the SER can be computed as follows:  
\[D\ =\ \sum_{i\ =\ 1}^{N_{S}}p_{i}\sum_{\mathbf{c}\in\mathbb{C}_{i}}\ (1-p_{c})^{L-d_{H}(\mathbf{c}^{(i)},\mathbf{c})}p_{c}{}^{d_{H}(\mathbf{c}^{( i)},\mathbf{c})} \tag{7}\]  
It is difficult to calculate the value of crossover probability, \(p_{c}\), theoretically. However, since this paper focuses on the estimate of source symbols after a good convergent iterative decoding, the error analysis is under the assumption of perfect LLRs. It is reasonable to set a small value for the crossover probability \(p_{c}\). In addition, to avoid the symbol decision error, the mapping from codewords back to the source symbols should be unique and unambiguous. This means different source symbols must be mapped to different codewords, i.e., \(\mathbf{c}_{i}\
eq\mathbf{c}_{j}\), if \(i\
eq j\). Hence, the design of source codewords, \(\mathbf{C}\ =\ \left\{\mathbf{c}^{(1)},\mathbf{c}^{(2)},\ldots\mathbf{c}^{(N_{S})}\right\}\), can be formulated as the following optimization problem:  
\[ \begin{array}{ll}\text{Minimize}&D\\ \text{Subject to}&d_{H,\min}\geq 2,\\ &\mathbf{c}_{i}\
eq\mathbf{c}_{j},\text{if}\ i\
eq j.\end{array}  \tag{8}\]  
The cost function, \(D\), can be further simplified by eliminating the irrelevant terms:  
\[D\ =\ \sum_{i\ =\ 1}^{N_{S}}p_{i}\sum_{\mathbf{c}\in\mathbb{C}_{i}}\ (p_{c}/(1-p_{c}))^{d_{H}(\mathbf{c}^{(i)},\mathbf{c})} \tag{9}\]This paper proposes a simple solution to this optimization problem by using the binary switch algorithm (BSA) [33]. The BSA is the best-known method for searching bit mapping, and it attempts to minimize the cost function by switching every pair of bit-labels. Here, a set of binary codewords with fixed-length, \(L\), is generated.