CSE5313 Coding and information theory for data science (Lecture 7)
Continue on Linear codes
Let be a linear code.
There are two equivalent ways to describe a linear code:
- A generator matrix with rows and columns, entry taken from .
- A parity check matrix with rows and columns, entry taken from .
Dual code
Definition of dual code
is the set of all vectors in that are orthogonal to every vector in .
Also, the alternative definition is:
- (only need to check basis of )
By rank-nullity theorem, .
is not always true.
Let . Then since .
Example of binary codes
Trivial code
Let .
Let .
Generator matrix is identity matrix.
Parity check matrix is zero matrix.
Minimum distance is 1.
Parity code
Let .
Let .
The generator matrix is:
The parity check matrix is:
Minimum distance is 2.
is the repetition code.
Lemma for minimum distance
The minimum distance of is the maximum integer such that every columns of are linearly independent.
Proof
Assume minimum distance is . Show that every columns of are independent.
- Fact: In linear codes minimum distance is the minimum weight ().
Indeed, if there exists a columns of that are linearly dependent, then we have for some with .
Reverse are similar.
The Hamming code
Let .
Take all non-zero vectors in .
Put them as columns of a matrix .
Example: for ,
Minimum distance is 3.
Proof for minimum distance
Using the lemma for minimum distance. Since are linearly independent, the minimum distance is 3.
So the maximum number of error correction is 1.
The length of code is .
.
Hadamard code
Define the code by encoding function:
()
Space of codewords is image of .
This is a linear code since each term is a linear combination of and .
If is a basis of , then is a basis of .
So the dimension of is .
Minimum distance is: .
Proof for minimum distance
Since the code is linear, then the minimum distance is the minimum weight of the codewords.
For each , there exists such that .
For all non-zero we have .
There exists a redundant , we remove it from to get a puntured Hadamard codeword.
The length of the code is .
SO is a linear code.
The generator matrix is the parity check matrix of Hamming code.
The dual of Hamming code is the (puntured) Hadamard code.