0% found this document useful (0 votes)
108 views4 pages

Simulation of Error Control Codes Using Matlab: EX - NO: Date

The document describes simulations of different types of error control codes using MATLAB: 1) Linear block codes - defines block length n and message length k, generates generator and parity check matrices, encodes and decodes messages, calculates syndromes to identify error patterns. 2) (7,4) cyclic code - uses a (7,4) cyclic code with generator polynomials. 3) Rate 1/2 convolutional encoder - specifies a convolutional code with parameters (m, k, n) = (2, 1, 2) and generator sequences to encode messages.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views4 pages

Simulation of Error Control Codes Using Matlab: EX - NO: Date

The document describes simulations of different types of error control codes using MATLAB: 1) Linear block codes - defines block length n and message length k, generates generator and parity check matrices, encodes and decodes messages, calculates syndromes to identify error patterns. 2) (7,4) cyclic code - uses a (7,4) cyclic code with generator polynomials. 3) Rate 1/2 convolutional encoder - specifies a convolutional code with parameters (m, k, n) = (2, 1, 2) and generator sequences to encode messages.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

EX.

NO:

DATE:

SIMULATION OF ERROR CONTROL CODES USING MATLAB


AIM To perform the simulation of Linear block codes, Cyclic codes and convolution encoder using MATLAB. BLOCK DIAGRAM a.Linear Block code

b.(7,4) Cyclic code

X3

X2

X1

Y3

Y2

Y1

c.Convolutional Encoder Rate 1/2= R convolutional codes with (m, k, n) = (2,1,2) and two generator Sequences are: g1 = (1 0 1) g2 = (1 1 1)

a.LINEAR BLOCK CODES Algorithm Define the block length n and message length k. Define coefficient matrix(P). Generate the generator matrix G=[Ik ; P] Generate codeword C=m.G. From G matrix calculate the H matrix. Calculate syndrome S=r.HT. Identify the error pattern(e). Corrected code word=r + e. Program %%%%%%%%%%% (n,k) linear block code %%%%%%%%%%%% clc; close all;

clear all; n=input('Enter n value'); k=input('Enter K value');

%p=[1 1 0;0 1 1;1 1 1;1 0 1] p=input('Enter Coefficient matrix'); disp('Generator matrix'); g=[eye(k),[p]]

%For (7,4) Hamming code

%Generator matrix

%m=[0 0 0 0;0 0 1 1; 0 1 0 1;1 0 1 1; 1 0 0 1; 1 1 1 1] m=input('Enter the message sequence') disp('Code words'); c=rem(m*g,2) disp('Parity check matrix'); par_che = gen2par(g) trt = syndtable(par_che); %r=[1 1 1 1 0 0 0 ]; r=input('Enter the received sequence'); disp('syndrome'); syn=rem(r*par_che',2) syn_de = bi2de(syn,'left-msb'); disp('Error pattern'); error = trt(1+syn_de,:) disp('Corrected code word'); code1=rem(r+error,2) % Corrected codeword % Error pattern % Convert to decimal %Parity check matrix %Decoding table

Linear Block codes Input Enter n value7 Enter K value4 Enter Coefficient matrix[1 0 1;1 1 1;1 0 0;0 0 1] Enter the message sequence[0 0 0 1; 0 0 1 1;0 1 0 0;1 0 0 0;1 0 1 0; 1 1 1 0; 1 1 1 1]

You might also like