## 3 Design of Source Codes
### Source PEXIT Chart Analysis  
As is shown in [18], the source PEXIT analysis can be exploited to evaluate the source decoding threshold. In contrast to the channel decoding threshold, the source decoding threshold represents the maximum compressible entropy as the source code length approaches infinity. Equivalently, the source decoding threshold can also be interpreted as the minimum source distribution \(p^{th}\) acceptable for the source code when \(p>0.5\).  
Let \(c_{i}\) and \(v_{j}\) represent the \(i\)th CN and the \(j\)th VN in \(\mathbf{B}_{s}\) (size \(m_{s}\times n_{s}\)), respectively. Five types of mutual information (MI) are first defined, including a priori mutual information (AMI), extrinsic mutual information (EMI), and a posteriori mutual information (APM), as follows:  
1. \(I_{s}^{\text{av}}(i,j)\) denotes the AMI from \(c_{i}\) to \(v_{j}\);
2. \(I_{s}^{\text{ev}}(i,j)\) denotes the EMI from \(v_{j}\) to \(c_{i}\);
3. \(I_{s}^{\text{ac}}(i,j)\) denotes the AMI from \(v_{j}\) to \(c_{i}\);
4. \(I_{s}^{\text{ec}}(i,j)\) denotes the EMI from \(c_{i}\) to \(v_{j}\);
5. \(I_{s,\text{APM}}(j)\) denotes the APM for \(v_{j}\).  
In [22], the function \(J(\sigma)\) calculating the MI between a binary bit and the corresponding LLR value following the Gaussian distribution \(\mathcal{N}(\sigma^{2}/2,\sigma^{2})\) is given as  
\[J(\sigma) =1-\frac{1}{\sqrt{2\pi\sigma^{2}}}\int_{-\infty}^{\infty}e^{- \frac{(z-\sigma^{2}/2)^{2}}{2\sigma^{2}}}\log_{2}\big{[}1-e^{-\xi}\big{]}d\xi. \tag{12}\]  
The function \(J_{\text{BSC}}(\mu,p)\) is defined as follows:  
\[J_{\text{BSC}}(\mu,p)= (1-p)\times\Big{(}1-\mathbb{E}\Big{[}\log_{2}\Big{(}1+e^{- sign(V)\chi^{(1-p)}}\Big{)}\Big{]}\Big{)}\] \[+p\times\Big{(}1-\mathbb{E}\Big{[}\log_{2}\Big{(}1+e^{-sign(V)\chi ^{(p)}}\Big{)}\Big{]}\Big{)},\]  
where \(V\) represents the source VN in \(\mathbf{B}_{s}\), \(\mu\) represents the average LLR value, and \(\chi^{(1-p)}\sim\mathcal{N}(\mu+\ln((1-p)/p),2\mu),\chi^{(p)}\sim\mathcal{N}( \mu-\ln((1-p)/p),2\mu)\).  
In addition, an indicator function is defined as  
\[\Phi(x)=\left\{\begin{array}{ll}0,&\text{if }x=0\\ 1,&\text{otherwise}.\end{array}\right. \tag{13}\]  
The algorithm for calculating the source decoding threshold is specified in Algorithm 2. We use \(n_{max}=100\) as the maximum iteration number and \(\delta=0.02\) as the step size. The source decoding threshold \(p_{th}\) is the lowest value that makes \(I_{\text{APM}}(j)=1\) hold for all \(j\in[1,n_{s}]\).  
```
0:\(\mathbf{B}_{s}\), \(p=0.5,\delta,n_{max}\)
1:for\(j\in[1,n_{s}]\)do
2:\(I_{\text{APM}}(j)=0.0\);
3:endfor
4:while\(\sum_{j=1}^{n_{s}}I_{\text{APM}}(j)\
eq n_{s}\)do
5:\(p\gets p+\delta\);
6:\(n_{itr}=0\);
7:while\(n_{itr}<n_{max}\)do
8:for\((i,j)\in[1,m_{s}]\times[1,n_{s}]\)do
9: Compute \(I_{s}^{\text{ev}}(i,j)\) using (9);
10: Set \(I_{s}^{\text{ac}}(i,j)=I_{s}^{\text{ev}}(i,j)\);
11:endfor
12:for\((i,j)\in[1,m_{s}]\times[1,n_{s}]\)do
13: Compute \(I_{s}^{\text{ec}}(i,j)\) using (10);
14: Set \(I_{s}^{\text{av}}(i,j)=I_{s}^{\text{ec}}(i,j)\);
15:endfor
16:for\(j\in[1,n_{s}]\)do
17: Compute \(I_{\text{APM}}(j)\) using (11);
18:endfor
19:\(n_{itr}=n_{itr}+1\);
20:endwhile
21:endwhile
22:\(p^{th}=p\);
23:return\(p^{th}\).
```  
**Algorithm 2** Source decoding threshold