100% found this document useful (2 votes)
385 views6 pages

Experiment No 9 (B) Experimental Study of BCH Encoder and Decoder

The document summarizes an experiment on BCH encoding and decoding. The objectives are to understand BCH codes and their encoding and decoding processes. BCH codes offer efficient error correction and are used widely. The experiment uses a BCH encoder and decoder kit along with MATLAB to encode and decode messages. Observations from the experiment match the theoretical concepts of BCH coding. Through this experiment, the encoding and decoding methods of BCH codes are explored.

Uploaded by

Joysree Nath
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
100% found this document useful (2 votes)
385 views6 pages

Experiment No 9 (B) Experimental Study of BCH Encoder and Decoder

The document summarizes an experiment on BCH encoding and decoding. The objectives are to understand BCH codes and their encoding and decoding processes. BCH codes offer efficient error correction and are used widely. The experiment uses a BCH encoder and decoder kit along with MATLAB to encode and decode messages. Observations from the experiment match the theoretical concepts of BCH coding. Through this experiment, the encoding and decoding methods of BCH codes are explored.

Uploaded by

Joysree Nath
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/ 6

Experiment No 9(b)

Experimental Study of BCH Encoder and Decoder.


Objectives
The main objectives of this experiment are:

• To understand BCH code.


• To learn about BCH coding and decoding.

9.b.1 Theory

BCH Code

BCH codes are a class of powerful error-correcting codes widely used in various
communication systems, data storage devices, and digital broadcasting applications. This
method is named after three people: Bose, Chaudhuri and Hocquenghem. They offer efficient
error correction capabilities and are well-suited for channels with high noise levels. This report
provides an overview of BCH encoders and decoders, their functionalities, and their critical
components.

Error Locator Polynomial Determination: The decoder uses the syndrome to determine the
error locator polynomial, which identifies the locations of errors in the codeword.

Error Correction: Based on the error locator polynomial, the decoder identifies the corrupted
bits and corrects them to restore the original message.

9.b.2 Required Apparatus

• BCH Encoder & Decoder trainer kit


• Function Generator
• Connecting Probs
• MATLAB Simulink Software

1
9.b.3 Experimental Analysis & Results

Experimental Setup:

Figure-9.b.1: Whole system at a glance for BCH Coding.

9.4 Experimental Analysis

Table-9.1: Observation Table for 4-bit BCH Encoder.

D3 D2 D1 C2 D0 C1 C0

Block-length=2m-1 …………………………………………………………………..(9.1)
M= Check-bits ; t= errors
k=2m -m-1…………………………………………………………………………..(9.2)
dmin=2t+1……………………………………………………………………………(9.3)
Given, D=[1001] = [ D3 D2 D1 D0]
Therefore, Codeword=[1001001]
Relations: C0=D0+D1+D3
C1=D0+D2+D3
C2=D1+D2+D3

2
Table-9.2: Observation table.

Address C2 C1 C0 Address C2 C1 C0

0 0 0 0 4 1 0 0

1 0 0 1 5 1 0 1

2 0 1 0 6 1 1 0

3 0 1 1 7 1 1 1

Table-9.3: Decoding Table

D6 D5 D4 D3 D2 D1 D0

Relations: P0=D0+D2+D4+D6
P1=D1+D2+D4+D6
P2=D3+D4+ D5+D6

Table-9.4: Observation table for BCH decoding

Position of P2 P1 P0 Position of P2 P1 P0
errors errors

All correct 0 0 0 4 1 0 0

1 0 0 1 5 1 0 1

2 0 1 0 6 1 1 0

3 0 1 1 7 1 1 1

3
9.3.1 Write code for General (Non-systematic) Cyclic code in MATLAB.
Solution:
Code:
clc;
clear all;
close all;
disp('Enter the message signal:');
m=input('m=');
syms x;
disp(g);
gl=polynomialDegree(g);
c=expand(msg*g);
disp('Code word polynomial, c(x)=');
disp(c);
cl=ml+gl;
cw=zeros(1,cl);
for i=1:cl
[r,q] = polynomialReduce(c,x.^(cl-i));
c=r;
if(q==1)
cw(1,i)=1;
end
end
disp('The codeword for General Cyclic Code is:');
disp(cw);

Output:

Enter the message signal:


m=[1 0 1 0]
Message polynomial, m(x)=
x^3 + x

Enter the generator polynomial,


g(x)=1+x^2+x^3
x^3 + x^2 + 1

Code word polynomial, c(x)=


x^6 + x^5 + x^4 + 2*x^3 + x

The codeword for General Cyclic Code is:


1 1 1 0 0 1 0

4
For Systematic Code:
clc;
clear all;
close all;
disp('Enter the message signal:');
m=input('m=');
syms x;
msg=poly2sym(m);
ml=length(m(1,:));
mx=zeros(1,ml);
for i=1:ml
mx(1,ml-i+1)=m(1,i);
end
disp('Message polynomial, m(x)=');
disp(mx);
disp('Enter the generator polynomial, ');
g=input('g(x)=');
disp(g);
pd=sym2poly(g);
pdl=length(pd(1,:));
gx=zeros(1,pdl);
for j=1:pdl
gx(1,pdl-j+1)=pd(1,j);
end
gl=polynomialDegree(g);
xnk=zeros(1,gl+1);
xn=sym2poly(x.^gl);
for i=1:gl+1
xnk(1,gl-i+2)=xn(1,i);
end
[q,r] = gfdeconv(conv(xnk,mx),gx);
disp('Parity,p(x)=');
gfpretty(r);
c=expand(msg*(x.^gl))+poly2sym(r);
disp('Code word polynomial, c(x)=');
disp(c);
cw=sym2poly(c);
disp('The codeword for Systematic Cyclic Code is:');
disp(cw);
Output:
Enter the 4-bits data:
D=[1 0 1 0]
The codeword for BCH Code is:
1 0 1 0 0 1 0

5
9.4 Discussion & Conclusion
Through this experiment,We had seen the BCH code encoding and decoding method .Using a
BCH encoder and decoder trainer kit, we conducted this experiment. In accordance with the
lab manual's block diagram, we had connected the circuit. According to the theoretical idea,
we had discovered the intended outputs for the encoder and decoder. We had also used the
MATLAB software to watch this experiment. With MATLAB software, we followed the
guidelines and created codes with loops to get the intended results according to theoretical
concepts. We discovered the cyclic code's encoding and decoding output. We had completed
this lab experiment correctly at last.

You might also like