Review of Block Codes
Theory
Linear Block Codes
Linear Block Codes are arguably the most popular class of forward error correcting codes used in communication systems.
A linear block code has three important parameters of interest, the blocklength , the rate of the code given by the ratio of its dimension to its length , and its minimum distance, which is the least Hamming distance between any pair of distinct codewords. In the case of linear block codes, the minimum distance of the code is exactly equal to the minimum weight of any non-zero codeword in the code. We denote the minimum distance of the code as .
Binary Linear Block Codes, Codewords, Dimension of a Code, Number of Codewords, and Rate
Our focus is on binary linear block codes. A binary linear block code is a subspace of the -dimensional vector space over the finite field with two elements , with the operations addition and multiplication modulo .
The dimension of a linear code is typically denoted by . Observe that . We call such a binary linear code as binary linear code, where refers to the blocklength of the code, and refers to its dimension. Since the dimension of the code subspace is , the code itself contains codewords, corresponding to all possible linear combinations. The rate of a linear block code is defined as the ratio , which signifies the fraction of the message bits to the number of bits in the codeword.
Generator Matrix and the code as its Rowspace
A generator matrix of an binary linear code is a matrix over , containing a basis of the code space as its rows. In other words, the code is the rowspace of the matrix . Let us see an example.
The rowspace of is the code is the set of all the linear combinations of all rows of . Since the three rows of are linearly independent, we will obtain unique codewords, as follows. Note that the dimension of this code is , its blocklength is , and its rate is . Observe that the all-zero vector is a codeword of this code. Indeed, the all-zero vector is a member of every codeword. We also observe that the minimum weight of any non-zero codeword in is . Thus, the minimum distance of the code is .
Parity Check Matrix of a Code
A parity check matrix of an binary linear code is matrix , with entries from such that contains exactly linearly independent rows and . Thus, the codewords of are orthogonal to the rows of . If the generator matrix of the code is of the form (a column-wise concatenation of a identity matrix , and a matrix ), then a parity check matrix for the code can be written as , where denotes the transpose of the matrix . For the example code with generator matrix described before, we see that such parity check matrix is given by Observe that in this case, and thus we see the identity submatrix in . However, this is not the only parity check matrix for . The following matrix is also a valid parity check matrix for the code. How do we verify that both and are valid parity check matrices for ? We do this by observing that both have rank (they contain linearly independent rows over ) and also that , for all the codewords shown above.
Observe that the property that signifies that the codeword (which is a -tuple ) satisfies linearly independent equations. These are as follows. Further, we also observe that, since has rank exactly equal to , the code is precisely the set of all -length vectors taken from which satisfy the equations given by . That is, we can write For the example discussed in this page, you can observe that, out of the set of all binary vectors of length , it is exactly the set of vectors , which are the codewords of which satisfy the equation .
Encoding
The way an code is used in communication is as follows. The message vector of length is multiplied with the generator matrix to obtain a codeword of length . This codeword is then transmitted through the communication channel. For example, consider the message vector for the code . The corresponding codeword is given as This codeword is transmitted through the channel, when we want to communicate the -bit message vector . Indeed, each codeword in is the codeword obtained by encoding a particular -length message vector. Similarly, for any linear code , every codeword is obtained by encoding specific -length message vector. Corresponding to the message vectors in , there are codewords of length in .
We will discuss decoding aspects of these codes in the subsequent experiments.