Week 9 Cyclic codes
Version 2023-11-12. To PDF of this week only Open the whole set of notes in PDF
Synopsis. Cyclic codes form a subclass of linear codes. Cyclic codes are easy to define, but to reveal their advantages, one needs to study them using polynomials. We identify
Definition: cyclic shift, cyclic code
For a vector
A cyclic code in
Equivalently, a cyclic code is a linear code
Remark: We can iterate the cyclic shift, so if a cyclic code
Vectors as polynomials
To study cyclic codes, we will identify vectors of length
Here
Notation: the polynomial
If
Example:
Show that the binary even weight code
Solution. We know that
Codevector | Code polynomial | Remark | ||
We will soon explain the notable fact that all code polynomials of
The Division Theorem for polynomials
In general we cannot divide
Theorem 9.1: Division Theorem for polynomials
For all
(possibly
We will not prove the Division Theorem but we will note and use the practical algorithm for finding the quotient and the remainder, known as long division of polynomials.
Example: long division of polynomials
Divide
Solution.
Hence
This example shows long division of polynomials over
The generator polynomial of a cyclic code
In what follows,
Definition: generator polynomial
A generator polynomial of a cyclic code
By convention, the generator polynomial of the null code
Recall that a polynomial
Lemma 9.2: existence and uniqueness of a generator polynomial
Every cyclic code
-
Proof. If
by definition is the unique generator polynomial. AssumeExistence: take
to be a non-zero polynomial of lowest degree in Make monic by dividing it by its leading coefficient. This does not change the degree, so we now have a monic polynomial of least degree in Existence is proved.Uniqueness: let
be another generator polynomial, then by definition is monic and has the same degree as So has degree less than (because the leading term cancels due to subtraction). Note that because is linear. If divide by its leading coefficient and obtain a monic polynomial, again in of degree less than This contradicts the choice of Hence must be and Uniqueness is proved. □
Theorem 9.3: properties of the generator polynomial
Let
-
1.
i.e., the code polynomials of are all possible multiples of of degree less than -
2.
is a monic factor of the polynomial in
-
Proof. Both claims are trivially true when
and so assume1. Observe that, writing elements of
as vectors, we haveand, as long as
That is,
is obtained from by applying the cyclic shift times. Since is cyclic, this means thatNow, every polynomial
— that is, a polynomial of degree less than — is written as for some Hence is a linear combination of the polynomials which are in and, as is linear, We proved thatLet us show that
Take and apply the Division Theorem for polynomials to write where We will get and so, by what has already been proved, Then by linearity We have seen already that there cannot be a non-zero polynomial in of degree strictly less than so and is a multiple of as claimed. Part 1 of the Theorem is proved.2. Continuing from the above, observe that
where
is the cyclic shift. Hence the vector corresponds to the polynomialwhich can be written as
as
given that is monic. Since is cyclic, and so Then by Part 1, for some polynomial and so which shows that is indeed a factor of □
Example: the generator polynomial of
The code
As we have already noted, all the code polynomials of
Error detection by a cyclic code
Theorem 9.3 means that if
This is how error detection is implemented in practice for binary cyclic codes (e.g., in Ethernet networks). Long division by
Nevertheless, for theoretical purposes we would like to have generator and check matrices for a cyclic code with a given generator polynomial.
The check polynomial
Definition: check polynomial
Let
Note that if
Theorem 9.4: a generator matrix and a check matrix for a cyclic code
Let
The vector
The vector of the polynomial
obtained from
-
Proof. The rows of
are linearly independent and the rows of are linearly independent. Indeed, is a matrix in a row echelon form with no zero rows, and so is up to scaling of rows by a non-zero scalar note thatThe linearly independent rows of
correspond to the polynomials and so they span which by Theorem 9.3 is Thus, is a generator matrix forSince the number of rows of
is and the rows are linearly independent, to show that is a check matrix it is enough to show that same as in the proof of Theorem 7.1.We express the inner product of vectors in terms of polynomials: if
thenIndeed, with
and one has which is exactly the coefficient of in the product of the polynomials andNumber the rows of
from to the rows of from to The rows of are and the rows of are the vectors of written backwards. So an entry of which as we know is an inner product of a row of and a row of is the coefficient of in But since and this coefficient is zero, proving □
Remark: this is not the only generator matrix (resp., check matrix) for
Corollary 9.5: generator polynomial of
Example: cyclic binary codes of length
Solution. Generator polynomials are monic factors of
Note that the polynomial
We work over the field
The polynomial
Can we factorise the polynomial
So the possible monic factors of
We now list every cyclic code in
-
•
which corresponds to the trivial binary code of length with The dual code of is the null code (see below). -
•
This is the binary even weight code of length which has The dual of is (see below). -
•
This is the binary repetition code of length with This code is -
•
Theorem 9.4 returns matrix with rows, And indeed, by definition is the generator polynomial of the null code which has empty generator matrix. It is a useless code but formally it is a linear and cyclic code, so we have to allow it for reasons of consistency. The minimum distance of the zero code is undefined. This code is