pcm2gm#
- sionna.phy.fec.utils.pcm2gm(pcm: numpy.ndarray, verify_results: bool = True) numpy.ndarray[source]#
Generates the generator matrix for a given parity-check matrix.
This function converts the parity-check matrix
pcm(denoted as \(\mathbf{H}\)) to systematic form and uses the following relationship to compute the generator matrix \(\mathbf{G}\) over GF(2):\[\mathbf{G} = [\mathbf{I} | \mathbf{M}] \Rightarrow \mathbf{H} = [\mathbf{M}^T | \mathbf{I}]. \tag{1}\]This derivation is based on the requirement for an all-zero syndrome:
\[\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 shown 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:
pcm (numpy.ndarray) – Binary parity-check matrix of shape [n - k, n].
verify_results (bool) – If True, verifies that the generated generator matrix is orthogonal to the parity-check matrix in GF(2).
- Outputs:
gm – Binary generator matrix of shape [k, n].
Notes
This function requires
pcmto have full rank. An error is raised ifpcmdoes not meet this requirement.