0% found this document useful (0 votes)
11 views15 pages

Lecture 1 U 2

Cyclic codes are linear codes that possess rich algebraic structure and have concise specifications. They can be efficiently implemented using shift registers and many practically important codes are cyclic. Convolution codes allow encoding of data streams. Cyclic codes are specified by a single codeword rather than many codewords as in general linear codes.

Uploaded by

Noor Alshibani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views15 pages

Lecture 1 U 2

Cyclic codes are linear codes that possess rich algebraic structure and have concise specifications. They can be efficiently implemented using shift registers and many practically important codes are cyclic. Convolution codes allow encoding of data streams. Cyclic codes are specified by a single codeword rather than many codewords as in general linear codes.

Uploaded by

Noor Alshibani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

CHAPTER 3: Cyclic and convolution codes

Cyclic codes are of interest and importance because

• They posses rich algebraic structure that can be utilized in a variety


of ways.
• They have extremely concise specifications.
• They can be efficiently implemented using simple shift registers.
• Many practically important codes are cyclic.

Convolution codes allow to encode streams od data (bits).

Cyclic codes 1
IMPORTANT NOTE

In order to specify a binary code with 2k codewords of length n one may need
to write down
2k
codewords of length n.

In order to specify a linear binary code with 2k codewords of length n it is sufficient


to write down
k
codewords of length n.

In order to specify a binary cyclic code with 2k codewords of length n it is sufficient


to write down
1
codeword of length n.

Cyclic codes 2
BASIC DEFINITION AND EXAMPLES
Definition A code C is cyclic if
(i) C is a linear code;
(ii) any cyclic shift of a codeword is also a codeword, i.e. whenever a0,… an -1  C,
then also an -1 a0 … an –2  C.
Example
(i) Code C = {000, 101, 011, 110} is cyclic.
(ii) Hamming code Ham(3, 2): with the generator matrix
1 0 0 0 0 1 1
 
0 1 0 0 1 0 1
G 
0 0 1 0 1 1 0
 
0 0 0 1 1 1 1 
is equivalent to a cyclic code. 
(iii) The binary linear code {0000, 1001, 0110, 1111} is not a cyclic, but it is
equivalent to a cyclic code.
(iv) Is Hamming code Ham(2, 3) with the generator matrix
1 0 1 1
 
 0 1 1 2 
(a) cyclic?
(b) equivalent to a cyclic code?
Cyclic codes 3
FREQUENCY of CYCLIC CODES

Comparing with linear codes, the cyclic codes are quite scarce. For,
example there are 11 811 linear (7,3) linear binary codes, but only two
of them are cyclic.

Trivial cyclic codes. For any field F and any integer n >= 3 there are
always the following cyclic codes of length n over F:
• No-information code - code consisting of just one all-zero codeword.

• Repetition code - code consisting of codewords (a, a, …,a) for a  F.

• Single-parity-check code - code consisting of all codewords with


parity 0.
• No-parity code - code consisting of all codewords of length n

For some cases, for example for n = 19 and F = GF(2), the above four
trivial cyclic codes are the only cyclic codes.

Cyclic codes 4
EXAMPLE of a CYCLIC CODE

The code with the generator matrix


1 0 1 1 1 0 0
 
G   0 1 0 1 1 1 0
0 0 1 0 1 1 1
 
has codewords
c1 = 1011100 c2 = 0101110 c3 =0010111
c1 + c2 = 1110010 c1 + c3 = 1001011 c2 + c3 = 0111001
c1 + c2 + c3 = 1100101

and it is cyclic because the right shifts have the following impacts
c1  c2, c2  c3, c3  c1 + c3
c1 + c2  c2 + c3, c1 + c3  c1 + c2 + c3, c2 + c3  c1
c1 + c2 + c3  c1 + c2

Cyclic codes 5
POLYNOMIALS over GF(q)

A codeword of a cyclic code is usually denoted


a0 a1…an -1
and to each such a codeword the polynomial
a0 + a1 x + a2 x2 + … + an -1 xn -1
is associated.
Fq[x] denotes the set of all polynomials over GF(q ).
deg (f(x )) = the largest m such that xm has a non-zero coefficient in f(x).
Multiplication of polynomials If f(x), g(x) Fq[x], then
deg (f(x) g(x)) = deg (f(x)) + deg (g(x)).
Division of polynomials For every pair of polynomials a(x), b(x)  0 in Fq[x] there
exists a unique pair of polynomials q(x), r(x) in Fq[x] such that
a(x) = q(x)b(x) + r(x), deg (r(x)) < deg (b(x)).
Example Divide x3 + x + 1 by x2 + x + 1 in F2[x].
Definition Let f(x) be a fixed polynomial in Fq[x]. Two polynomials g(x), h(x) are said
to be congruent modulo f(x), notation
g(x)  h(x) (mod f(x)),
if g(x) - h(x) is divisible by f(x).
Cyclic codes 6
RING of POLYNOMIALS

The set of polynomials in Fq[x] of degree less than deg (f(x)), with addition and
multiplication modulo f(x) forms a ring denoted Fq[x]/f(x).
Example Calculate (x + 1)2 in F2[x] / (x2 + x + 1). It holds
(x + 1)2 = x2 + 2x + 1  x2 + 1  x (mod x2 + x + 1).
How many elements has Fq[x] / f(x)?
Result | Fq[x] / f(x) | = q deg (f(x)).
Example Addition and multiplication in F2[x] / (x2 + x + 1)
+ 0 1 x 1+x  0 1 x 1+x
0 0 1 x 1+x 0 0 0 0 0
1 1 0 1+x x 1 0 1 X 1+x
x x 1+x 0 1 x 0 x 1+x 1
1+x 1+x x 1 0 1+x 0 1+x 1 x

Definition A polynomial f(x) in Fq[x] is said to be reducible if f(x) = a(x)b(x), where


a(x), b(x)  Fq[x] and
deg (a(x)) < deg (f(x)), deg (b(x)) < deg (f(x)).
If f(x) is not reducible, it is irreducible in Fq[x].
Theorem The ring Fq[x] / f(x) is a field if f(x) is irreducible in Fq[x].
Cyclic codes 7
FIELD Rn, Rn = Fq[x] / (xn - 1)

Computation modulo xn – 1
Since xn  1 (mod xn -1) we can compute f(x) mod xn -1 as follow:
In f(x) replace xn by 1, xn +1 by x, xn +2 by x2, xn +3 by x3, …

Identification of words with polynomials


a0 a1… an -1  a0 + a1 x + a2 x2 + … + an -1 xn -1

Multiplication by x in Rn corresponds to a single cyclic shift


x (a0 + a1 x + … an -1 xn -1) = an -1 + a0 x + a1 x2 + … + an -2 xn -1

Cyclic codes 8
Algebraic characterization of cyclic codes

Theorem A code C is cyclic if C satisfies two conditions


(i) a(x), b(x)  C  a(x) + b(x)  C
(ii) a(x)  C, r(x)  Rn  r(x)a(x)  C

Proof
(1) Let C be a cyclic code. C is linear  (i) holds.
(ii) Let a(x)  C, r(x) = r0 + r1x + … + rn -1xn -1
r(x)a(x) = r0a(x) + r1xa(x) + … + rn -1xn -1a(x)
is in C by (i) because summands are cyclic shifts of a(x).

(2) Let (i) and (ii) hold


 Taking r(x) to be a scalar the conditions imply linearity of C.
 Taking r(x) = x the conditions imply cyclicity of C.

Cyclic codes 9
CONSTRUCTION of CYCLIC CODES

Notation If f(x)  Rn, then


f(x) = {r(x)f(x) | r(x)  Rn}
(multiplication is modulo xn -1).

Theorem For any f(x)  Rn, the setf(x) is a cyclic code (generated by f).

Proof We check conditions (i) and (ii) of the previous theorem.


(i) If a(x)f(x)  f(x) and b(x)f(x)  f(x), then
a(x)f(x) + b(x)f(x) = (a(x) + b(x)) f(x) f(x)
(ii) If a(x)f(x)  f(x), r(x)  Rn, then
r(x) (a(x)f(x)) = (r(x)a(x)) f(x)  f(x).

Example C = 1 + x2 , n = 3, q = 2.
We have to compute r(x)(1 + x2) for all r(x)  R3.
R3 = {0, 1, x, 1 + x, x2, 1 + x2, x + x2, 1 + x + x2}.

Result C = {0, 1 + x, 1 + x2, x + x2}


C = {000, 011, 101, 110}
Cyclic codes 10
Characterization theorem for cyclic codes

We show that all cyclic codes C have the form C = f(x) for some f(x)  Rn.
Theorem Let C be a non-zero cyclic code in Rn. Then
• there exists unique monic polynomial g(x) of the smallest degree such that
• C = g(x)
• g(x) is a factor of xn -1.
Proof
(i) Suppose g(x) and h(x) are two monic polynomials in C of the smallest degree.
Then the polynomial g(x) - h(x)  C and it has a smaller degree and a multiplication
by a scalar makes out of it a monic polynomial. If g(x)  h(x) we get a contradiction.
(ii) Suppose a(x)  C.
Then
a(x) = q(x)g(x) + r(x) (deg r(x) < deg g(x))
and
r(x) = a(x) - q(x)g(x)  C.
By minimality
r(x) = 0
and therefore a(x) g(x).
Cyclic codes 11
Characterization theorem for cyclic codes

(iii) Clearly,
xn –1 = q(x)g(x) + r(x) with deg r(x) < deg g(x)
and therefore r(x)  -q(x)g(x) (mod xn -1) and
r(x)  C  r(x) = 0  g(x) is a factor of xn -1.

GENERATOR POLYNOMIALS
Definition If for a cyclic code C it holds
C = g(x),
then g is called the generator polynomial for the code C.

Cyclic codes 12
HOW TO DESIGN CYCLIC CODES?

The last claim of the previous theorem gives a recipe to get all cyclic codes of
given length n.
Indeed, all we need to do is to find all factors of
xn -1.
Problem: Find all binary cyclic codes of length 3.
Solution: Since
x3 – 1 = (x + 1)(x2 + x + 1)
both factors are irreducible in GF(2)

we have the following generator polynomials and codes.

Generator polynomials Code in R3 Code in V(3,2)


1 R3 V(3,2)
x+1 {0, 1 + x, x + x2, 1 + x2} {000, 110, 011, 101}
x2 + x + 1 {0, 1 + x + x2} {000, 111}
x3 – 1 ( = 0) {0} {000}

Cyclic codes 13
Design of generator matrices for cyclic codes

Theorem Suppose C is a cyclic code of codewords of length n with the generator polynomial
g(x) = g0 + g1x + … + grxr.
Then dim (C) = n - r and a generator matrix G1 for C is
 g0 g1 g2 ... gr 0 0 0 ... 0
 
0 g0 g1 g2 ... gr 0 0 ... 0
G1   0 0 g0 g1 g2 ... gr 0 ... 0
 
 .. .. .. 
0 0 ... 0 0 ... 0 g 0 ... g r 
Proof 
(i) All rows of G1 are linearly independent.
(ii) The n - r rows of G represent codewords
g(x), xg(x), x2g(x),…, xn -r -1g(x)
(*)
(iii) It remains to show that every codeword in C can be expressed as a linear combination of
vectors from (*).
Inded, if a(x)  C, then
a(x) = q(x)g(x).
Since deg a(x) < n we have deg q(x) < n - r.
Hence
q(x)g(x) = (q0 + q1x + … + qn -r -1xn -r -1)g(x)
Cyclic codes = q0g(x) + q1xg(x) + … + qn -r -1xn -r -1g(x). 14
EXAMPLE

The task is to determine all ternary codes of length 4 and generators for them.
Factorization of x4 - 1 over GF(3) has the form
x4 - 1 = (x - 1)(x3 + x2 + x + 1) = (x - 1)(x + 1)(x2 + 1)
Therefore there are 23 = 8 divisors of x4 - 1 and each generates a cyclic code.
Generator polynomial Generator matrix
1 I4
 1 1 0 0
0  1 1 0
x 
 0 0  1 1
1 1 0 0
0 1 1 0
x+1 
0 0 1 1
x2 + 1 1 0 1 0 
0 1 0 1 
 
(x - 1)(x + 1) = x2 - 1  1 0 1 0
 0  1 0 1
 
(x - 1)(x2 + 1) = x3 - x2 + x - 1 [ -1 1 -1 1 ]
(x + 1)(x2 + 1) [1111]
x4 - 1 = 0 [0000]
Cyclic codes 15

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy