Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168733
Image: ubuntu2004

Bose, Ray-Chaudhuri, Hocquenghem (BCH) Codes

We study in this worksheet a familiar and large family of cyclic codes. These codes are constructed with a specific minimal distance and error-correction ability in mind. They were developed independently by C. Bose and Ray-Chaudhuri (1960), and Hocquenghem (1959). There are primitive and non-primitive codes depending on the polynomial generator, and also there are binary and non-binary codes depending on the alphabet used to construct the generator polynomial.

 1. Constructing a generator polynomial

      Assume we want to construct a tt-error correcting qq-ary code of length nn.

     Choose mm such that t<qm1t<q^{m-1} and nn divides qm1q^{m-1}.

     Construct Fqm\mathbb{F}_{q^m} using an irreducible polynomila fFq[x]f \in\mathbb{F}_q[x] of degree mm.

     Let β0Fqm\beta\neq 0 \in \mathbb{F}_{q^m} with order nn (meaning nn is the smallest integer such that βn=1\beta^n=1) and mi=mβim_i=m_{\beta^i}

     be  the minimal polynomials of βi\beta^i  over Fq\mathbb{F}_q. Let δ=2t+1\delta=2t+1,  and aa be an integer.

                        g= lcm (ma,ma+1,...,ma+δ2)g=\text{ lcm }(m_a,m_{a+1}, ... , m_{a+\delta-2}) is the generator polynomial.

     The number δ\delta is called the designed distance, and δd\delta \leq d.

2. Creating the Code

    The polynomial above is the generator polynomial for a code of lenth nn equal to the order of β\beta. Since nn must divide qm1q^m-1 (the order of an element of a field must divide the size of the field)

     we can always choose the smallest posiive integer mm such that nn divides qm1q^m-1 in the above construction.

 

   Since nn is the order of β\beta, then βi\beta^i is a root of the polynomial 1xn1-x^n for each ii.

   Hence gg divides 1xn1-x^n and thus gg is the generator polynomial for a cyclic code of length nn. Codes created in this manner are called BCH codes.

   If we choose β\beta to be a primitive element of Fqm\mathbb{F}_q^m we will have necessarily n=qm1n=q^m-1.

  In this case the code is called primitive.

  The code is called narrow sense if a=1a=1.

  β\beta is called the seed.

3. Primitive Single Error Correcting, Narrow Sense Binary BCH Codes

 For single error correcting codes, t=1t=1, designed distance δ=3\delta=3, n=2m1n=2^m-1, a=1a=1.

Choose primitive polynomial fF2[x]f\in \mathbb{F}_2[x] of degree mm.

Let β\beta be a primitive element of F2m\mathbb{F}_{2^m}. Thus order (β)=2m1=n(\beta)=2^m-1=n.

g=lcm{m1(x),m2(x)}=m1(x)=fg=\text{lcm}\{m_1(x),m_2(x)\}=m_1(x)=f.

Thus n=2m1n=2^m-1, k=ndeg(f)=nm=2m1mk=n-\text{deg}(f)=n-m=2^m-1-m.

Using the Hamming Bound, we can show d=3d=3.

Thus the primitive single error correcting narrow-sense, binary BCH codes are the binary Hamming Codes.

 

 

Example 1

To construct a single error correcting binary code of length 7,

δ=3\delta=3, n=7n=7,  7 divides 2312^3-1 so m=3m=3.

 We will use f=1+x+x3f=1+x+x^3, a primitive polynomial,  to construct F8\mathbb{F}_8.

 Let β\beta be a root of ff. Then β\beta is a primitive element and so order (β)=231=7(\beta)=2^3-1=7.

 g=lcm(m1,m2)g=\text{lcm}(m_1,m_2). Since m1=m2=mβ=fm_1=m_2=m_\beta=f, g=1+x+x3g=1+x+x^3.

 We recognize the code generated by gg to be H3\mathcal{H}_3.

 

Example 2

Let's use SAGE to consturct a double error correcting BCH code of length 1515.

δ=5\delta=5, n=15n=15.

15 divides 241=152^4-1=15 So we need to construct F16\mathbb{F}_{16}. In the Cyclic Codes worksheet, we learned how to construct polynomial rings over finite fields.

Recall we learned how to find minimal polynomials in the Finite Fields and Minimum Polynomials worksheet. There is actually a command that will find them for you.

If we construct the field using zz, then zz is a primitive element of the field.

 


F.<z> = GF(2^4, "z") P.<x> = PolynomialRing(F,"x")

Since zz is a primitive element of F16\mathbb{F}_{16}, so order(z)=241=15=n(z)=2^4-1=15=n.

To contruct the genenerator polynomial for a narrow sense code, taking aa to be 1,  g=lcm{m1,m2,m3,m4}g=\text{lcm}\{m_1,m_2,m_3,m_4\}.

 

z.minimal_polynomial()
x^4 + x + 1
b=z^2 b.minimal_polynomial()
x^4 + x + 1
b=z^3 b.minimal_polynomial()
x^4 + x^3 + x^2 + x + 1
b=z^4 b.minimal_polynomial()
x^4 + x + 1
g=(1+x+x^4)*(1+x+x^2+x^3+x^4);g
x^8 + x^7 + x^6 + x^4 + 1
F.<u>=PolynomialRing(GF(2),"u"); C=CyclicCode(15,1+u^4+u^6+u^7+u^8) C
Linear code of length 15, dimension 7 over Finite Field of size 2
C.minimum_distance()
5

Since m1=m2=m4m_1=m_2=m_4,

g=m1m3=(1+x+x4)(1+x+x2+x3+x4)=1+x4+x6+x7+x8g=m_1m_3=(1+x+x^4)(1+x+x^2+x^3+x^4)=1+x^4+x^6+x^7+x^8

C=gC=\langle g \rangle is a [15,7,5] binary 5.

 

If we let a=3a=3 and follow the same procedure, we will construct a different BCH code of the same length  ability which is not narrow sense.

So then g=lcm{m3,m4,m5,m6}g=\text{lcm}\{m_3,m_4,m_5,m_6\}.

b=z^3 m3=b.minimal_polynomial();m3
x^4 + x^3 + x^2 + x + 1
b=z^4 m4=b.minimal_polynomial();m4
x^4 + x + 1
b=z^5 m5=b.minimal_polynomial();m5
x^2 + x + 1
b=z^6 m6=b.minimal_polynomial();m6
x^4 + x^3 + x^2 + x + 1
g=m3*m4*m5;g
x^10 + x^8 + x^5 + x^4 + x^2 + x + 1
F.<u>=PolynomialRing(GF(2),"u"); C=CyclicCode(15,1+u+u^2+u^4+u^5+u^8+u^10);C
Linear code of length 15, dimension 5 over Finite Field of size 2
C.minimum_distance()
7

4. Parameters for BCH codes

   For primitive codes, n=qm1n=q^m-1

   For non-primitive codes, nn divides qm1q^m-1 (choose the least mm such integer, i.e. oerder of qq modulo nn).

   The  dimension   k=ndeg(g)k=n-\text{deg}(g).

   mi=mβi=jCi((βi)qjx).m_i=m_{\beta^i}=\prod_{j \in C_i} ((\beta^i)^{q^j}-x).  where CiC_i is the qq-cyclotomic coset of ii.

   deg(mi)=Ci,deg(g)i=1a+δ2Ci(m_i)=|C_i|, \Rightarrow \text{deg}(g)\leq \sum_{i=1}^{a+\delta-2}|C_i|.

   Theorem

    kni=aa+δ2Cik\geq n-\sum_{i=a}^{a+\delta-2}|C_i|.

    For narrow-sense, primitive codes, kqm1m(δ1)k\geq q^m-1-m(\delta-1).

   For narrow-sense, primitive binary codes, k2m1m(δ1)2k\geq 2^m-1-\frac{m(\delta-1)}{2}.

5. Characterization of Codewords

    c=gc=\langle g \rangle be an [n,k][n,k] BCH code, with designed distance δ\delta and seed βFqm\beta \in \mathbb{F}_{q^m}.

     βa,βa+1,...,βa+δ2\beta^a,\beta^a+1, ..., \beta^{a+\delta-2} are roots of gg in Fqm\mathbb{F}_{q^m}

     wCw=hg,βa,...,βa+δ2w\in C \Rightarrow w=hg, \Rightarrow \beta^a, ...,\beta^{a+\delta-2} are also roots of ww in Fqm\mathbb{F}_{q^m}.

     Conversely, if fFq[x]f\in \mathbb{F}_q[x] has roots βa,βa+1,...,βa+δ2\beta^a, \beta^{a+1}, ... , \beta^{a+\delta-2} in Fqm\mathbb{F}_{q^m} ,

     then mim_i divides ff for each ii and so gg divides ff. Thus fCf\in C.

     Theorem

     A polynomial fCf\in C if and only if βa,βa+1,...,βa+δ2\beta^a, \beta^{a+1}, ... , \beta^{a+\delta-2} are roots of ff in Fqm\mathbb{F}_{q^m}.


6. Parity Check Matrices For BCH Codes

Let C=gC=\langle g \rangle be an [n,k][n,k] BCH code with designed distance δ\delta and seed βF\beta \in \mathbb{F} of order nn.

 

Let b1,b2,,brb_1, b_2, \cdots, b_r be the distinct generating roots (powers of β\beta) of gg in Fqm\mathbb{F}_{q^m}. Thus r(a+δ2)r\leq (a+\delta-2).

H= 1   b1b_1   b12b_1^2   \cdots   b1n1b_1^{n-1}

      1   b2b_2   b22b_2^2   \cdots   b2n1b_2^{n-1}

      .      .            .          \cdots   .

      .      .            .                            .

      .      .            .                            .

      1     brb_r   br2b_r^2   \cdots   brn1b_r^{n-1}

     

 

 

By the theorem above, wCw \in C if and only if  w(bi)=0w(b_i)=0 for all ii.

  wHT=(w(b1),w(b2),,w(br))=0wH^T=(w(b_1),w(b_2),\cdots, w(b_r))=0

 

Example

t=1δ=3t=1\Rightarrow \delta=3, n=7n=7, β\beta a root of 1+x+x31+x+x^3 over F2\mathbb{F}_2.

g=m1 g=m_1      H=(1ββ2β6)  H=(1 \: \beta \: \beta^2 \cdots \beta^6) expressing powers of β\beta as vectors over F2\mathbb{F}_2.

1+β+β3=01+\beta+\beta^3=0

11001 \rightarrow 100

β010\beta \rightarrow 010

β2001\beta^2 \rightarrow 001

β3=1+β110\beta^3=1+\beta \rightarrow 110

β4=β+β2011\beta^4=\beta+\beta^2 \rightarrow 011

β5=β2+β3=1+β+β2111\beta^5=\beta2+\beta^3=1+\beta+\beta^2 \rightarrow 111

β6=β+β2+β3=1+β2 101\beta^6=\beta+\beta^2+\beta^3=1+\beta^2  \rightarrow 101

β7=1\beta^7=1

So

H=  1  0  0  1  0  1  1

       0  1  0  1  1  1  0

       0  0  1  0  1  1  1

 

Example

for t=2δ=5t=2 \Rightarrow \delta=5, n=7n=7, β\beta as above

g=m1m3g=m_1m_3

H= 1    β\beta   β2\beta^2   β3 \beta^3   β4 \beta^4   β5\beta^5   β6 \beta^6

      1   β3 \beta^3   β6 \beta^6   β2 \beta^2   β5 \beta^5   β \beta      β4 \beta^4

HH is a 6 X 7 matrix over F2\mathbb{F}_2.

 

Just to check the dimensions using SAGE...

F.<z> = GF(2^3, "z") P.<x> = PolynomialRing(F,"x")
m1=z.minimal_polynomial(); m1
x^3 + x + 1
b=z^2 m2=b.minimal_polynomial(); m2
x^3 + x + 1
b=z^3 m3=b.minimal_polynomial(); m3
x^3 + x^2 + 1
b=z^4 m4=b.minimal_polynomial(); m4;
x^3 + x + 1
g=m1*m3;g
x^6 + x^5 + x^4 + x^3 + x^2 + x + 1
F.<u>=PolynomialRing(GF(2),"u") C=CyclicCode(7,1+u+u^2+u^3+u^4+u^5+u^6);C
Linear code of length 7, dimension 1 over Finite Field of size 2
C.check_mat()
[1 0 0 0 0 0 1] [0 1 0 0 0 0 1] [0 0 1 0 0 0 1] [0 0 0 1 0 0 1] [0 0 0 0 1 0 1] [0 0 0 0 0 1 1]

Homework #8

Problem 1.

a) Construct a ternary double error correcting BCH code of length 13.

b) Using a different seed, construct another ternary double error correcting BCHBCH code of length 13.

Problem 2.

Construct a binary narrow-sense double error correcting BCH code with seed βF211\beta \in \mathbb{F}_{2^{11}} of order 23.

What is the redundancy of the code?

Problem 3.

Construct a generator polynomial and a parity-check matrix for a binary double-error correcting BCH code of length 15.

Problem 4.

Exercise 8.5 from the text

Problem 5.

Exercise 8.15 from the text

Problem 6.

Exercise 8.7 from the text

Problem 7.

Exercise 8.8 from the text