 Cyclic code

In coding theory, cyclic codes are linear block errorcorrecting codes that have convenient algebraic structures for efficient error detection and correction.
Contents
Definition
Let be a linear code over a finite field GF(q) of block length n. is called a cyclic code, if for every codeword c=(c_{1},...,c_{n}) from C, the word (c_{n},c_{1},...,c_{n1}) in GF(q^{n}) obtained by a cyclic right shift of components is again a codeword. Same goes for left shifts. One right shift is equal to n − 1 left shifts and vice versa. Therefore the linear code is cyclic precisely when it is invariant under all cyclic shifts.
Cyclic Codes have some additional structural constraint on the codes. They are based on Galois fields and because of their structural properties they are very useful for error controls. Their structure is strongly related to Galois fields because of which the encoding and decoding algorithms for cyclic codes are computationally efficient.
Algebraic structure
Cyclic codes can be linked to ideals in certain rings. Let R = A[x] / (x^{n} − 1) be a polynomial ring over the finite field A = GF(q). Identify the elements of the cyclic code C with polynomials in R such that maps to the polynomial : thus multiplication by x corresponds to a cyclic shift. Then C is an ideal in R, and hence principal, since R is a principal ideal ring. The ideal is generated by the unique monic element in C of minimum degree, the generator polynomial g.^{[1]} This must be a divisor of x^{n} − 1. It follows that every cyclic code is a polynomial code. If the generator polynomial g has degree d then the rank of the code C is n − d.
The idempotent of C is a codeword e such that e^{2} = e (that is, e is an idempotent element of C) and e is an identity for the code, that is e c = c for every codeword c. Such a word always exists and is unique;^{[2]} it is a generator of the code.
An irreducible code is a cyclic code in which the code, as an ideal, is maximal in R, so that its generator is an irreducible polynomial.
Examples
For example, if A= and n=3, the set of codewords contained in the (1,1,0)cyclic code is precisely
 .
It corresponds to the ideal in generated by (1 + x).
Note that (1 + x) is an irreducible polynomial in the polynomial ring, and hence the code is an irreducible code.
The idempotent of this code is the polynomial x + x^{2}, corresponding to the codeword (0,1,1).
Trivial examples
Trivial examples of cyclic codes are A^{n} itself and the code containing only the zero codeword. These correspond to generators 1 and x^{n} − 1 respectively: these two polynomials must always be factors of x^{n} − 1.
Over GF(2) the parity bit code, consisting of all words of even weight, corresponds to generator x + 1. Again over GF(2) this must always be a factor of x^{n} − 1.
Quasicyclic codes and shortened codes
Before delving into the details of cyclic codes first we will discuss quasicyclic and shortened codes which are closely related to the cyclic codes and they all can be converted into each other.
Definition
Quasicyclic codes: An (n,k) quasicyclic code is a linear block code such that, for some b coprime with n, the polynomial is a codeword polynomial whenever c(x) is a codeword polynomial.
Here codeword polynomial is a linear code whose code words are polynomials that are divisible by a polynomial of shorter length called generator polynomial. Note that every codeword polynomial can be expressed in the form c(x) = a(x)g(x). For any codeword (c_{0},..,c_{n − 1}) codeword polynomial corresponds to the .
Definition
Shortened codes: An [n,k] linear code is called a proper shortened cyclic code if it can be obtained by deleting b positions from an (n + b,k + b) cyclic code.
In shortened codes information symbols are deleted to obtain a desired blocklength smaller than the design blocklength. The missing information symbols are usually imagined to be at the beginning of the codeword and are considered to be 0. Therefore, n−k is fixed, and then k is decreased which eventually decreases n. Note that it is not necessary to delete the starting symbols. Depending on the application sometimes consecutive positions are considered as 0 and are deleted.
All the symbols which are dropped need not be transmitted and at the receiving end can be reinserted. To convert (n,k) cyclic code to (n − b,k − b) shortened code, set b symbols to zero and drop them from each codeword. Any cyclic code can be converted to quasicyclic codes by dropping every bth symbol where b is a factor of n. If the dropped symbols are not check symbols then this cyclic code is also a shortened code.
Cyclic codes for correcting errors
Now, we will begin the discussion of cyclic codes explicitly with error corrections and detections. Cyclic codes can be used to correct errors, like Hamming codes as a cyclic codes can be used for correcting single error. Likewise, they are also used to correct double errors and burst errors. All types of error corrections are covered briefly in the further subsections.
The (7,4) Hamming code has a generator polynomial g(x) = x^{3} + x + 1. This polynomial has a zero in Galois extension field GF(8) at the primitive element α, and all codewords satisfy . Cyclic codes can also be used to correct double errors over the field GF(2). Blocklength will be n equal to 2^{m} − 1 and primitive elements α and α^{3} as zeros in the GF(2^{m}) because we are considering the case of two errors here, so each will represent one error.
The received word is a polynomial of degree n − 1 given as v(x) = a(x)g(x) + e(x)
where e(x) can have at most two nonzero coefficients corresponding to 2 errors.
We define the Syndrome Polynomial, S(x) as the remainder of polynomial v(x) when divided by the generator polynomial g(x) i.e.
S(x) = as is zero.
For correcting two errors
Let the field elements X_{1} and X_{2} be the two error location numbers. If only one error occurs then X_{2} is equal to zero and if none occurs both are zero.
Let S_{1} = v(α) and S_{3} = v(α^{3}).
These field elements are called "syndromes". Now because g(x) is zero at primitive elements α and α^{3}, so we can write S_{1} = e(α) and S_{3} = e(α^{3}). If say two errors occur, then
S_{1} = α^{i} + α^{i'} and S_{3} = α^{3i} + α^{3i'}.
And these two can be considered as two pair of equations in GF(2^{m}) with two unknowns and hence we can write
S_{1} = X_{1} + X_{2} and S_{3} = (X_{1})^{3} + (X_{2})^{3}.
Hence if the two pair of nonlinear equations can be solved cyclic codes can used to correct two errors.
Hamming code
The Hamming(7,4) code may be written as a cyclic code over GF(2) with generator 1 + x + x^{3}. In fact, any binary Hamming code of the form Ham(2,q) is equivalent to a cyclic code when q is even.^{[3]} Hamming codes of the form Ham(r,2) are also cyclic when  they are [2^{r} − 1,2^{r} − r − 2,4]codes.^{[4]}
Hamming code for correcting single error
A code whose minimum distance is at least 3, have a check matrix all of whose columns are distinct and non zero. If a check matrix for a binary code has m rows, then each column is an mbit binary number. There are 2^{m} − 1 possible columns. Therefore if a check matrix of a binary code with d_{m}in at least 3 has m rows, then it can only have 2^{m} − 1 columns, not more than that. This defines a (2^{m} − 1,2^{m} − 1 − m) codes, called Hamming codes.
It is easy to define Hamming codes for large alphabets of size q. We need to define one H matrix with linearly independent columns. For any word of size q there will be columns who are multiples of each other. So, to get linear independence all non zero mtuples with one as a top most non zero element will be chosen as columns. Then two columns will never be linearly dependent because three columns could be linearly dependent with the minimum distance of the code as 3.
So, there are (q^{m} − 1) / (q − 1) nonzero columns with one as top most non zero element. Therefore, Hamming code is a [(q^{m} − 1) / (q − 1),(q^{m} − 1) / (q − 1) − m] code.
Now, for cyclic codes, Let α be primitive element in GF(q^{m}), and let β = α^{q − 1}. Then and thus β is a zero of the polynomial and is a generator polynomial for the cyclic code of block length n = (q^{m} − 1) / (q − 1).
But for q = 2, α = β. And the received word is a polynomial of degree n − 1 given as
v(x) = a(x)g(x) + e(x)
where, e(x) = 0 or x^{i} where i represents the error locations.
But we can also use α^{i} as an element of GF(2^{m}) to index error location. Because g(α) = 0, we have v(α) = α^{i} and all powers of α from 0 to 2^{m} − 2 are distinct. Therefore we can easily determine error location i from α^{i} unless v(α) = 0 which represents no error. So, hamming code is a single error correcting code over GF(2) with n = 2^{m} − 1 and k = n − m.
Cyclic codes for correcting burst errors
From Hamming distance concept, a code with minimum distance 2t + 1 can correct any t errors. But in many channels error pattern is not very arbitrary, it occurs within very short segment of the message. Such kind of errors are called burst errors. So, for correcting such errors we will get a more efficient code of higher rate because of the less constraints. Cyclic codes are used for correcting burst error. In fact, cyclic codes can also correct cyclic burst errors along with burst errors. Cyclic burst errors are defined as
A cyclic burst of length t is a vector whose nonzero components are among t (cyclically) consecutive components, the first and the last of which are nonzero.
In polynomial form cyclic burst of length t can be described as with b(x) as a polynomial of degree t − 1 with nonzero coefficient b_{0}. Here b(x) defines the pattern and x^{i} defines the starting point of error. Length of the pattern is given by degb(x) + 1. Syndrome poynomial is unique for each pattern and is given by
Note that A linear block code that corrects all burst errors of length t or less must have at least 2t check symbols. Because any linear code that can correct burst pattern of length t or less cannot have a burst of length 2t or less as a codeword because if it did then a burst of length t could change the codeword to burst pattern of length t, which also could be obtained by making a burst error of length t in all zero codeword. Now, any two vectors that are non zero in the first 2t components must be from different cosets of an array to avoid their difference being a codeword of bursts of length 2t. Therefore number of such cosets are equal to number of such vectors which are q^{2t}. Hence at least q^{2t} cosets and hence at least 2t check symbol.
This property is also known as Rieger bound and it is similar to the singleton bound for random error correcting.
Fire codes as cyclic bounds
Fire code is a cyclic burst error correcting code over GF(q) with the generator polynomial
g(x) = (x^{2t − 1} − 1)p(x)
where p(x) is a prime polynomial with degree m not smaller than t and p(x) does not divide x^{2t − 1} − 1. Block length of the fire code is the smallest integer n such that g(x) divides x^{n} − 1.
A fire code can correct all burst errors of length t or less if no two bursts b(x) and x^{j}b'(x) appear in the same coset. This can be proved by contradiction. Suppose there are two distinct nonzero bursts b(x) and x^{j}b'(x) of length t or less and are in the same coset of the code. So, their difference is a codeword. As the difference is a multiple of g(x) it is also a multiple of x^{2t − 1} − 1. Therefore,
.
This shows that j is a multiple of 2t − 1, So
b(x) = x^{l(2t − 1)}b'(x)
for some l. Now, as l(2t − 1) is less than t and l is less than q^{m} − 1 so (x^{l(2t − 1)} − 1)b(x) is a codeword. Therefore,
(x^{l(2t − 1)} − 1)b(x) = a(x)(x^{2t − 1} − 1)p(x).
Since b(x) degree is less than degree of p(x),p(x) cannot divide b(x). If l is not zero, then p(x) also cannot divide x^{l(2t − 1)} − 1 as l is less than q^{m} − 1 and by definition of m, p(x) divides x^{l(2t − 1)} − 1 for no l smaller than q^{m} − 1. Therefore l and j equals to zero. That means both that both the bursts are same, contrary to assumption.
Fire codes are the best single burst correcting codes with high rate and they are constructed analytically. They are of very high rate and when m and t are equal, redundancy is least and is equal to 3t − 1. By using multiple fire codes longer burst errors can also be corrected.
For error detection cyclic codes are widely used and are called t − 1 cyclic redundancy codes.
Cyclic codes on Fourier transform
Applications of Fourier transform are wide spread in signal processing. But their applications are not limited to the complex fields only, fourier transform also exist in the Galois field GF(q). Cyclic codes using fourier transform can be described in a setting closer to the signal processing.
Fourier transform over finite fields
The discrete Fourier transform of vector v = v_{0},v_{1},....,v_{n − 1} is given by a vector V = V_{0},V_{1},.....,V_{n − 1} where,
V_{k} = where,
k = 0,.....,n − 1
where exp( − j2π / n) is an nth root of unity. Similarly in the finite field nth root of unity is element ω of order n. Therefore
If v = (v_{0},v_{1},....,v_{n − 1}) is a vector over GF(q), and ω be an element of GF(q) of order n, then Fourier transform of the vector v is the vector V = (V_{0},V_{1},.....,V_{n − 1}) and components are given by
V_{j} = where,
k = 0,.....,n − 1
Here i is time index, j is frequency and V is the spectrum. One important difference between Fourier transform in complex field and Galois field is that complex field ω exists for every value of n while in Galois field ω exists only if n divides q − 1. In case of extension fields, there will be a Fourier transform in the extension field GF(q^{m}) if n divides q^{m} − 1 for some m. In Galois field time domain vector v is over the field GF(q) but the spectrum V may be over the extension field GF(q^{m}).
Spectral description of cyclic codes
Any codeword of cyclic code of blocklength n can be represented by a polynomial c(x) of degree at most n − 1. Its encoder can be written as c(x) = a(x)g(x). Therefore in frequency domain encoder can be written as C_{j} = A_{j}G_{j}. Here codeword spectrum C_{j} has a value in GF(q^{m}) but all the components in the time domain are from GF(q). As the data spectrum A_{j} is arbitrary, the role of G_{j} is to specify those j where C_{j} will be zero.
Thus, cyclic codes can also be defined as
Given a set of spectral indices, A = (j_{1},....,j_{n − k}), whose elements are called check frequencies, the cyclic code C is the set of words over GF(q) whose spectrum is zero in the components indexed by j_{1},...,j_{n − k}. Any such spectrum C will have components of the form A_{j}G_{j}.
So, cyclic codes are vectors in the field GF(q) and the spectrum given by its inverse fourier transform is over the field GF(q^{m}) and are constrained to be zero at certain components. But note that every spectrum in the field GF(q^{m}) and zero at certain components may not have inverse transforms with components in the field GF(q). Such spectrum can not be used as cyclic codes.
Following are the few bounds on the spectrum of cyclic codes.
BCH bound
If n be a factor of (q^{m} − 1) for some m. The only vector in GF(q)^{n} of weight d − 1 or less that has d − 1 consecutive components of its spectrum equal to zero is allzero vector.
HartmannTzeng bound
If n be a factor of (q^{m} − 1) for some m, and b an integer that is coprime with n. The only vector v in GF(q)^{n} of weight d − 1 or less whose spectral components V_{j} equal zero for , where and , is the all zero vector.
Roos bound
If n be a factor of q^{m} − 1 for some m and GCD(n,b) = 1. The only vector in GF(q)^{n} of weight d − 1 or less whose spectral components V_{j} equal to zero for , where l_{1} = 0,...,d − s − 2 and l_{2} takes at least s + 1 values in the range 0,....,d − 2, is the allzero vector.
Quadratic residue codes
When the prime l is a quadratic residue modulo the prime p there is a quadratic residue code which is a cyclic code of length p, dimension (p + 1) / 2 and minimum weight at least over GF(l).
Generalizations
A constacyclic code is a linear code with the property that for some constant λ if (c_{1},c_{2},...,c_{n}) is a codeword then so is (λc_{n},c_{1},...,c_{n1}). A negacyclic code is a constacyclic code with λ=1.^{[5]} A quasicyclic code has the property that for some s, any cyclic shift of a codeword by s places is again a codeword.^{[6]} A double circulant code is a quasicyclic code of even length with s=2.^{[6]}
See also
 Cyclic redundancy check
 Polynomial code
 BCH code
 Reed–Muller code
 Fourier Transform
 Binary Golay code
 Ternary Golay code
Notes
References
 J.H. Van Lint, Introduction to Coding Theory (3rd ed), Graduate Texts in Mathematics 86, Springer Verlag, 1998. ISBN 3540641335. Chapter 6.
 Hill, Raymond. A First Course In Coding Theory, Oxford University Press, 1988, ISBN 0198538030. Chapter 12.
 F. J. MacWilliams and N. J. A. Sloane, The Theory of ErrorCorrecting Codes, New York: NorthHolland Publishing, 1977, ISBN 0444850112.
 Irving S. Reed and Xuemin Chen, ErrorControl Coding for Data Networks, Boston: Kluwer Academic Publishers, 1999, ISBN 0792385284.
 Richard E. Blahut, Algebraic Codes for Data Transmission (2nd ed), Cambridge University Press 2003, ISBN 0521553741
 Ranjan Bose, Information theory, coding and cryptography , ISBN 0070482977
 Scott A. Vanstone, Paul C. Van Oorschot, An introduction to error correcting codes with applications, ISBN 0792390172
 Chapter 8. Cyclic codes  pages 100  123, ?
 Notes #3, October 8, Handout #9, EE 387, John Gill, Stanford University
External links
 David Terr, "Cyclic Code" from MathWorld.
This article incorporates material from cyclic code on PlanetMath, which is licensed under the Creative Commons Attribution/ShareAlike License.
Categories: Coding theory
 Finite fields
Wikimedia Foundation. 2010.