Linear codes use generator and parity check matrices to encode messages and detect errors. The generator matrix creates codewords by multiplying with message vectors, while the parity check matrix verifies if a received vector is valid.
These matrices have special forms that make encoding and decoding easier. The generator matrix in systematic form shows message bits unchanged, while the parity check matrix in standard form helps quickly spot errors in received vectors.
Generator and Parity Check Matrices
Generator Matrix and Systematic Form
- Generator matrix generates all codewords of a linear code by multiplying it with all possible message vectors
- Rows of form a basis for the code
- For an linear code, is a matrix
- Systematic form of a generator matrix has the form , where is the identity matrix and is a matrix
- Systematic form allows for easy encoding and decoding
- Message bits appear unchanged in the first positions of the codeword (information bits)
- Last positions are parity bits, which are linear combinations of the message bits
Parity Check Matrix and Standard Form
- Parity check matrix is used to check if a received vector is a valid codeword
- For an linear code, is an matrix
- A vector is a codeword if and only if
- Standard form of a parity check matrix has the form , where is the transpose of the matrix from the systematic form of the generator matrix
- Rows of are orthogonal to the rows of , i.e.,
- Columns of correspond to the parity bits in the codeword
Encoding and Decoding
Encoding Process
- Encoding is the process of converting a message vector into a codeword
- For a linear code with generator matrix , the encoding process is
- If is in systematic form, the message bits appear unchanged in the first positions of the codeword
- Linear independence of the rows of ensures that each message vector maps to a unique codeword
- Rows of form a basis for the code, spanning the entire codespace

Decoding Process
- Decoding is the process of recovering the original message vector from a received vector
- Compute the syndrome
- If , then is a valid codeword
- If , use the syndrome to determine the error pattern and correct the errors
- For systematic codes, the message bits can be directly read from the first positions of the decoded codeword
- Compute the syndrome
Matrix Properties
Rank of Generator and Parity Check Matrices
- Rank of the generator matrix is equal to the dimension of the code
- Rows of are linearly independent
- Rank of determines the number of information bits in each codeword
- Rank of the parity check matrix is equal to , where is the length of the codeword
- Rows of are linearly independent
- Rank of determines the number of parity bits in each codeword
Nullspace of Parity Check Matrix
- Nullspace (kernel) of the parity check matrix is the set of all vectors such that
- Codewords of the linear code are the elements of the nullspace of
- Dimension of the nullspace is equal to the dimension of the code
- Nullspace of is the rowspace of the generator matrix
- Rows of form a basis for the nullspace of