In coding theory, a generator matrix is a matrix whose rows form a basis for a linear code. The codewords are all of the linear combinations of the rows of this matrix, that is, the linear code is the row space of its generator matrix.
If G is a matrix, it generates the codewords of a linear code C by
w=sG
where w is a codeword of the linear code C, and s is any input vector. Both w and s are assumed to be row vectors.[1] A generator matrix for a linear
[n,k,d]q
k x n
r=n-k
The standard form for a generator matrix is,
G=\begin{bmatrix}Ik|P\end{bmatrix}
Ik
k x k
k x (n-k)
A generator matrix can be used to construct the parity check matrix for a code (and vice versa). If the generator matrix G is in standard form,
G=\begin{bmatrix}Ik|P\end{bmatrix}
H=\begin{bmatrix}-P\top|In-k\end{bmatrix}
P\top
P
C
C\perp
G is a
k x n
(n-k) x n
Codes C1 and C2 are equivalent (denoted C1 ~ C2) if one code can be obtained from the other via the following two transformations:
Equivalent codes have the same minimum distance.
The generator matrices of equivalent codes can be obtained from one another via the following elementary operations:
Thus, we can perform Gaussian elimination on G. Indeed, this allows us to assume that the generator matrix is in the standard form. More precisely, for any matrix G we can find an invertible matrix U such that
UG=\begin{bmatrix}Ik|P\end{bmatrix}
\begin{bmatrix}Ik|P\end{bmatrix}
. David J.C. MacKay. Information Theory, Inference, and Learning Algorithms . 2003 . 9. Cambridge University Press. 9780521642989. Because the Hamming code is a linear code, it can be written compactly in terms of matrices as follows. The transmitted codeword
t
s
wheret=G\intercals
G
s
t
... I find it easier to relate to the right-multiplication (...) than the left-multiplication (...). Many coding theory texts use the left-multiplying conventions (...), however. ...The rows of the generator matrix can be viewed as defining the basis vectors..t=sG