gm2pcm#

sionna.phy.fec.utils.gm2pcm(gm: numpy.ndarray, verify_results: bool = True) numpy.ndarray[source]#

Generates the parity-check matrix for a given generator matrix.

This function converts the generator matrix gm (denoted as \(\mathbf{G}\)) to systematic form and uses the following relationship to compute the parity-check matrix \(\mathbf{H}\) over GF(2):

\[\mathbf{G} = [\mathbf{I} | \mathbf{M}] \Rightarrow \mathbf{H} = [\mathbf{M}^T | \mathbf{I}]. \tag{1}\]

This is derived from the requirement for an all-zero syndrome, such that:

\[\mathbf{H} \mathbf{c}^T = \mathbf{H} * (\mathbf{u} * \mathbf{G})^T = \mathbf{H} * \mathbf{G}^T * \mathbf{u}^T = \mathbf{0},\]

where \(\mathbf{c}\) represents an arbitrary codeword and \(\mathbf{u}\) the corresponding information bits.

This leads to:

\[\mathbf{G} * \mathbf{H}^T = \mathbf{0}. \tag{2}\]

It can be seen that (1) satisfies (2), as in GF(2):

\[[\mathbf{I} | \mathbf{M}] * [\mathbf{M}^T | \mathbf{I}]^T = \mathbf{M} + \mathbf{M} = \mathbf{0}.\]
Parameters:
  • gm (numpy.ndarray) – Binary generator matrix of shape [k, n].

  • verify_results (bool) – If True, verifies that the generated parity-check matrix is orthogonal to the generator matrix in GF(2).

Outputs:

pcm – Binary parity-check matrix of shape [n - k, n].

Notes

This function requires gm to have full rank. An error is raised if gm does not meet this requirement.