# Hybrid Window Decoding for Joint Source Channel Anytime Coding System
## 3 Hybrid Window Decoding for JSCAC System
### Hybrid Window Decoding Structure
The parameters \(\mathbf{H}^{sc}\) and \(\mathbf{H}^{cc}\) indicate the source and channel parity-check matrix. \(I_{\max 1}\) and \(I_{\max 2}\) denote the maximum iterations of different decoding stages; and \(I_{\max 2}\) is far smaller than \(I_{\max 1}\). \(p\) is the source probability, \(\sigma_{ch}\) is the variance of channel noise, and \(T\) is the maximum observed decoding delay. There are two main steps in Algorithm 1. First, in the initial expanding window decoding phase of Step 1, the traditional JEWD in [17] is implemented within the time slots range of \(t\in[1,3\gamma-2]\). Second, when \(t>3\gamma-2\), the window is slid forward one block and the sliding window decoding is implemented at each time slot in Step 2. Especially, in the sliding window decoding phase of Step 2, it also includes two sub-steps. (a) Step 2-1: In the normal sliding window decoding stage, the initial source LLR, i.e., \(z^{sc}=log\frac{1-p}{p}\), is used for decoding with \(I_{\max 1}\), and the decoding range is the whole window length, i.e., \(3\gamma-2\). (b) Step 2-2: In the adaptive local expanding window decoding stage, the source updated _a posteriori_ LLRs \(\mathbf{L}_{t}^{sc}\) is used for decoding with \(I_{\max 2}\). The decoding range expands with the window size region of \([2\gamma-1,3\gamma-3]\), including the first \(2\gamma+k-2\) blocks (\(1\leq k<\gamma\)) of the sliding window. The syndrome-check-based detection is carried out before the local expanding window decoding. As shown in line 16 to line 24 of Algorithm 1, if \(S_{check}=0\), the local expanding window decoding is carried out within the sliding window region. If \(S_{check0}=1\), the adaptive local expanding window decoding is terminated, and the _a posterior_ source LLRs are updated for the involved blocks with (5). After each local expanding window decoding, we update \(\mathbf{L}_{t}^{sc}\) only for blocks in the first coupling interval. The motivation is that in any decoding window range, the LLRs of message blocks in the first coupling interval can converge earlier than the blocks in the other two coupling intervals. ```
Input:\(\mathbf{H}^{sc}\), \(\mathbf{H}^{cc}\), \(I_{\max 1},I_{\max 2},T,z^{sc},\sigma_{ch}\); Output: the hard decision result \(\mathbf{\hat{S}}_{[1,T]}\);
1 Step 1: Initial expanding window decoding phase for\(t=j,1\leq j\leq 3\gamma-2\)do
2\(\mathbf{\hat{H}}_{t}^{sc}=\mathbf{H}^{sc}[1:j,1:j]\), \(\mathbf{\hat{H}}_{t}^{sc}=\mathbf{H}^{cc}[1:j,1:j]\);
3 implement joint BP with \(\mathbf{\hat{H}}_{t}^{sc},\mathbf{\hat{H}}_{t}^{sc}\), \(I_{\max 1},Z^{sc}\);
4 Update \(\mathbf{L}_{t}^{sc}\) of Block[1; 2] with (5);
5 Step 2: Sliding window decoding phase: for\(t=j,3\gamma-2<j\leq T\)do
6 Step 2-1: Normal sliding window decoding stage \(\mathbf{\hat{H}}_{t}^{sc}=\mathbf{H}^{sc}[j-2\gamma+2:j,j-3\gamma+3:j]\), \(\mathbf{\hat{H}}_{t}^{sc}=\mathbf{H}^{cc}[j-2\gamma+2:j,j-3\gamma+3:j]\);
7 Implement joint BP with \(\mathbf{\hat{H}}_{t}^{sc}\), \(\mathbf{\hat{H}}_{t}^{sc}\), \(I_{\max 1}\), \(Z^{sc}\);
8 Update \(\mathbf{L}_{t}^{sc}\) of Block \([j-3\gamma+3:j]\) with (5);
9 Step 2-2: Adaptive local expanding window decoding stage
10 Initiate \(S_{check0}=0\); for\(1\leq k<\gamma\)do
11 if\(S_{check0}==0\)then
12\(\mathbf{\hat{H}}_{k}^{sc}=\mathbf{H}^{sc}[j-2\gamma+2:j-\gamma+k,j-3\gamma+3:j- \gamma+k]\);
13\(\mathbf{\hat{H}}_{t}^{sc}=\mathbf{H}^{cc}[j-2\gamma+2:j-\gamma+k,j-3\gamma+3:j- \gamma+k]\);
14\(\mathbf{Z}_{k}^{sc}=\mathbf{L}_{t}^{sc}[j-3\gamma+3:j-\gamma+k]\) ;
15 Do joint BP with \(\mathbf{\hat{H}}_{k}^{sc}\), \(\mathbf{\hat{H}}_{k}^{cc}\), \(I_{\max 2}\) and \(\mathbf{Z}_{k}^{sc}\);
16 Syndrome-check based detection\(\to S_{check0}\); if\(S_{check0}==1\)then
17 Update \(\mathbf{L}_{t}^{sc}\) with (5) for Block \([j-3\gamma+3:j-\gamma+k]\) ;
18 break ;
19
20 Output: \(\mathbf{\hat{S}}_{[1,T]}=-(\mathbf{sign}(\mathbf{L}_{T}^{sc})+1)/2\) ;
21 end
```  
**Algorithm 1**Joint hybrid window decoding (JHWD) algorithm