**LDPC-CC
Matlab files: **

makeBaseLdpccc.m encodeLdpccc.m parityCheckMatrixHT.m minSum.m decodeLdpccc.m ldpcccBER.m

**1. makeBaseLdpccc.m**

This function creates LDPC-CC base matrix
construction described in [1]. The function constructs *N *by *N*
matrix with *numOfOne* ones per column or row. The next step is to add all
ones column in the left, and all zeros column in the right. Figure 1. shows base
matrix for *N* = 4 and *numOfOne* = 2.

**Figure 1**.
Example of (4, 2, 2) base LDPC-CC matrix.

**2. encodeLdpccc.m **

This function encodes bits sequence *u*
into time-varying LDPC convolutional codes with code rate R = 1/2. Encoder
structure is shown in Figure 2.

**Figure
2**. Convolutional codes encoder structure.

Weight coefficients *h1* is chosen from base LDPC-CC
matrix derived from function 1. Weight coefficients *h2* is chosen from
another base matrix as shown in Figure 3.

**Figure 3**. Weight coefficients *h1* (red and gray) and *h2*
(blue and gray).

From
example of Figure 3. we will have *h1* (start from red) = [1 1 1 0 0 0; 1
1 1 0 0 0 ; 1 1 0 0 1 0 ; 1 0 1 1 0 0] and *h2* (start from blue) = [1 0 0
0 0; 1 0 0 0 0; 1 0 0 0 0; 1 0 0 0 0]. Note that *h2* is smaller than *h1*.

Head
and tail of zero bits are added to the bits sequence. (*Ms* + 1) head bits
are used to mitigate first 'frame' error caused by nonexistent previous-period
statistics, where *Ms* is convolutional code memory. Half of 2*(*Ms*
+ 1) tail bits are used to mitigate last 'frame' error caused by nonexistent of
next-period (future) statistics. Another half of 2*(*Ms* + 1) are used as
zero padding so that the last 'frame' is within processing (decoding) period.
Lastly, *T* tail bits are added to flush all data from convolutional code
registers, where *T* = convolutional code period.

The output of the function is encoded vector *v* which
contains systematic bit information and parity bit information.

**3.
parityCheckMatrixHT.m **

This
function produces M by N of rate 1/2 *H* transpose parity check matrix for
one decoding period based on matrix created by section 1. Figure 4. shows the
example of one decoding period *H* transpose. All blank spaces are filled
with zero.

**Figure 4**. *H* transpose matrix for decoding.

The
red highlight of *H* transpose corresponding previous statistics, while
the blue highlight corresponding to the next (future) statistics.

The input *offsetV* of the function determines the
starting point for matrix generation. The function will then pass the new
starting point (*nextOffsetV*) for the next decoding period.

**4.
minSum.m **

Message
passing LDPC codes decoding bases on min-sum algorithms. The corresponding *H*
transpose in section 3. is used for decoding. The decoder will only update
statistics corresponding to the non-highlighted section of *H* transpose.

**5.
decodeLdpccc.m **

This function manages data flow between sub-decoder (min-sum
decoder) period and between iterations. The final result is the estimate *v*
(*vHat*) vector.

Within one iteration, sub-decoder hops from one decoding
period of 2*(*Ms* + 1) to the next decoding period until all 'frame' is
decoded.

**6.
ldpcccBER.m **

This function constructs encoder, modulation, channel and decoder of LDPC-CC. The final result is bit error rate of the corresponding Eb/N0.

**Simulation results**

**Figure 5**. Simulation results

**Reference **

[1] A. Jimenez Feltstrom and K. Sh.
Zigangirov, “Periodic Time-Varying Convolutional Codes with Low-Density
Parity-Check Matrix,” *IEEE Trans. Inform. Theory*, 45(5):2181-2190, Sep
1999.