hammgen
Parity-check and generator matrices for Hamming code
Description
returns an
h
= hammgen(m
)m
-by-n parity-check matrix,
h
, for a Hamming code of codeword length n
= 2m–1
. The message length of the Hamming code is
n – m
. The binary primitive polynomial that the
function uses to create the Hamming code is the default primitive polynomial in
GF(2^
). For more details of this default
polynomial, see the m
gfprimdf
function.
Examples
Input Arguments
Output Arguments
Algorithms
hammgen
uses the function gftuple
to create the parity-check matrix by converting each element in the
Galois field (GF) to its polynomial representation. Unlike gftuple
, which
performs computations in GF(2m
) and processes
one m
-tuple at a time, the hammgen
function
generates the entire sequence from 0 to 2m–1
.
The computation algorithm uses all previously computed values to generate the computation
result. If the value of m
is less than 25 and the primitive polynomial is
the default primitive polynomial for GF(2m
), the
syntax hammgen(
might be faster than the syntax
m
)hammgen(
.m
,poly
)
Version History
Introduced before R2006a