Ex - No:3C Convolutional Codes Date AIM
Ex - No:3C Convolutional Codes Date AIM
NO:3c
CONVOLUTIONAL CODES
DATE:
AIM
To design an error detection and correction codes using convolutional codes.
THEORY
CONVOLUTIONAL CODE
Convolutional code is a type of error-correcting code in which m-bit information symbol
to be encoded is transformed into n-bit symbol. Convolutional codes are used extensively in
numerous applications in order to achieve reliable data transfer, including digital video, radio,
mobile communication, and satellite communication.
A convolutional encoder is a finite state machine. An encoder with n registers will
have 2n states.
Convolutional codes have memory that uses previous bits to encode or decode
following bits
The most commonly known graphical representation of a code is the trellis
representation. A code trellis diagram is simply an edge labeled directed graph in
which every path represents a code sequence.
This representation has resulted in a wide range of applications of convolutional
codes for error control in digital communications.
Viterbi algorithm is used for decoding a bit stream that has been encoded using
forward error correction based on a convolutional code.
Viterbi decoding compares the hamming distance between the branch code and the
received code.
Path producing larger hamming distance is eliminated.
In information theory, the Hamming distance between two strings of equal length is
the number of positions at which the corresponding symbols are different.
Fig: Encoder
CODING
%General Format
clc
close all
clear all
i=input('Enter the input data:');
trellis = struct('numInputSymbols',2,'numOutputSymbols',8,...
'numStates',4,'nextStates',[0 2;0 2;1 3;1 3],...
'outputs',[0 7;3 4;1 6;2 5]);
t=convenc(i,trellis)
tblen=3;
decoded1 = vitdec(t,trellis,tblen,'trunc','hard')
% 1/3 Conventional Encoder
clc;
clear all;
close all;
m=[0 1 0 1 0 1 0 1];
m1=[0 0 1 1 0 0 1 1];
m2=[0 0 0 0 1 1 1 1];
for i=1:8
x1=m(i);
x2=xor(m(i),m2(i));
x3=xor(x2,m1(i));
x=[x1;x2;x3]'
i=i+1;
end
OUTPUT
Enter the input data: [1 0 1]
t=1
decoded1 = 1
x=
1
x=
0
x=
1
x=
0
x=
1
x=
0
x=
1
RESULT:
Thus error detection and correction using convolutional codes was designed and the
output was also displayed successfully.