Fiveable

🔢Coding Theory Unit 3 Review

QR code for Coding Theory practice questions

3.1 Generator and Parity Check Matrices

3.1 Generator and Parity Check Matrices

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
🔢Coding Theory
Unit & Topic Study Guides

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 GG generates all codewords of a linear code by multiplying it with all possible message vectors
    • Rows of GG form a basis for the code
    • For an (n,k)(n,k) linear code, GG is a k×nk \times n matrix
  • Systematic form of a generator matrix has the form G=[IkA]G = [I_k | A], where IkI_k is the k×kk \times k identity matrix and AA is a k×(nk)k \times (n-k) matrix
    • Systematic form allows for easy encoding and decoding
    • Message bits appear unchanged in the first kk positions of the codeword (information bits)
    • Last nkn-k positions are parity bits, which are linear combinations of the message bits

Parity Check Matrix and Standard Form

  • Parity check matrix HH is used to check if a received vector is a valid codeword
    • For an (n,k)(n,k) linear code, HH is an (nk)×n(n-k) \times n matrix
    • A vector c\mathbf{c} is a codeword if and only if HcT=0H\mathbf{c}^T = \mathbf{0}
  • Standard form of a parity check matrix has the form H=[ATInk]H = [A^T | I_{n-k}], where ATA^T is the transpose of the matrix AA from the systematic form of the generator matrix
    • Rows of HH are orthogonal to the rows of GG, i.e., GHT=0GH^T = \mathbf{0}
    • Columns of HH correspond to the parity bits in the codeword

Encoding and Decoding

Encoding Process

  • Encoding is the process of converting a message vector m\mathbf{m} into a codeword c\mathbf{c}
    • For a linear code with generator matrix GG, the encoding process is c=mG\mathbf{c} = \mathbf{m}G
    • If GG is in systematic form, the message bits appear unchanged in the first kk positions of the codeword
  • Linear independence of the rows of GG ensures that each message vector maps to a unique codeword
    • Rows of GG form a basis for the code, spanning the entire codespace
Generator Matrix and Systematic Form, matrices - parity check matrix and linearly independent - Mathematics Stack Exchange

Decoding Process

  • Decoding is the process of recovering the original message vector m\mathbf{m} from a received vector r\mathbf{r}
    • Compute the syndrome s=HrT\mathbf{s} = H\mathbf{r}^T
      • If s=0\mathbf{s} = \mathbf{0}, then r\mathbf{r} is a valid codeword
      • If s0\mathbf{s} \neq \mathbf{0}, 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 kk positions of the decoded codeword

Matrix Properties

Rank of Generator and Parity Check Matrices

  • Rank of the generator matrix GG is equal to the dimension kk of the code
    • Rows of GG are linearly independent
    • Rank of GG determines the number of information bits in each codeword
  • Rank of the parity check matrix HH is equal to nkn-k, where nn is the length of the codeword
    • Rows of HH are linearly independent
    • Rank of HH determines the number of parity bits in each codeword

Nullspace of Parity Check Matrix

  • Nullspace (kernel) of the parity check matrix HH is the set of all vectors x\mathbf{x} such that HxT=0H\mathbf{x}^T = \mathbf{0}
    • Codewords of the linear code are the elements of the nullspace of HH
    • Dimension of the nullspace is equal to the dimension kk of the code
  • Nullspace of HH is the rowspace of the generator matrix GG
    • Rows of GG form a basis for the nullspace of HH