Logo der Uni Stuttgart
Encoding

Encoding with H

Encoding for linear block codes can be done using the generator matrix. However, this can be inefficient for some codes. The structure of the 5G LDPC code allows for efficient encoding using the parity check matrix instead. Encoding with a parity check matrix can be done using the equation system $$ \mathbf{c}\cdot\mathbf{H}^T = \mathbf{0}, $$ where the codeword $\mathbf{c}$ consists a message part and a parity part (systematic code). The encoder first generates $\left[p_j\right]_{1\leq j \leq 4Z}$ defined by $\mathbf{u}\cdot\mathbf{M}^T=\left[p_j\right]_{1\leq j \leq 4Z}\cdot\mathbf{D}^T$. The solution of this linear system of equations can be found using elimination. For a more compact notation one can look at the base graph notation to solve the equation system. The double diagonal part $\mathbf{D'}$ has the following structure for both base graphs $$ \mathbf{D'}=\begin{bmatrix} \omega_1 &0 &-1 &-1 \\ \omega_2 &0 &0 &-1 \\ \omega_3 &-1 &0 &0 \\ \omega_1 &-1 &-1 &0 \end{bmatrix}, $$ where either $\omega_2$ or $\omega_3$ equals -1. First, one takes the sum over all 4 rows resulting in I) $\left[-\omega_2\cdot\omega_3,\; -1,\; -1,\; -1\right]$. By reordering the equations of the lifted equation system, I) becomes $\left[0\; -1\;-1\; -1\right]$ which is used to directly calculate $\left[p_j\right]_{1\leq j \leq Z}$. The equations are reordered again such that I) becomes $\left[\omega_1,\; -1,\; -1,\; -1\right]$. I) is then added to the first row, resulting in II) $\left[-1,\quad 0,\; -1,\; -1\right]$. The same procedure is repeated for the next rows, resulting in III) $\left[-1,\; -1,\quad 0,\; -1\right]$ and IV) $\left[-1,\; -1,\; -1,\quad 0\right]$. Now it holds $\left[p_j\right]_{1\leq j \leq 4Z}=\left[p_j\right]_{1\leq j \leq 4Z}\cdot\mathbf{I}=\mathbf{u}\cdot\hat{\mathbf{M}}^T$, where $\hat{\mathbf{M}}$ denotes $\mathbf{M}$ after the above described elimination steps. Encoding the remaining parity bits can be done by using a single matrix operation, which can be implemented efficiently as $$ \left[p_i\right]_{4Z\leq i \leq (N-K)Z} = \left[\mathbf{u}, \;p_j\right]_{1\leq j \leq 4Z} \cdot\mathbf{E}^T. $$ All parity bits defined by $\mathbf{E}$ and $\mathbf{I}$ are solely dependant on $\mathbf{u}$ and $\left[p_j\right]_{1\leq j \leq 4Z}$. Using this procedure, one is able to generate $\mathbf{c}$ from $\mathbf{u}$ by using the codes structure, without the need of a generator matrix.

Encoding with G

It can be convenient to use $\mathbf{G}$ for encoding with small codes. The generator matrix can be retreived from the parity check matrix using the above described elimination and the equation $$ \mathbf{G}=\left[ \mathbf{I},\;\hat{\mathbf{M}}^T,\; \left[ \mathbf{I},\;\hat{\mathbf{M}}^T\right]\cdot \mathbf{E}^T\right]. $$ The codeword is then generated using $$ \mathbf{c}=\mathbf{u}\cdot\mathbf{G}. $$ To avoid high density in $\mathbf{G}$ one can use two generator matrices $\mathbf{G_1}=\left[ \mathbf{I},\;\hat{\mathbf{M}}^T\right]$ and $\mathbf{G_2}=\left[ \mathbf{I},\;\mathbf{E}^T\right]$ instead. The codeword is then generated using $$ \mathbf{c}=\left(\mathbf{u}\cdot\mathbf{G_1}\right)\cdot\mathbf{G_2}. $$