0% found this document useful (0 votes)
307 views3 pages

Experiment No 5 Aim: To Study and Implement Convolution Codes. Requirement: GCC C Compiler. Theory

The document describes an experiment to study and implement convolutional codes. Convolutional codes encode redundant information into transmitted signals to improve channel capacity and are well-suited for channels with additive white Gaussian noise. The experiment implements a convolutional encoder using a generator polynomial to encode a message bit and register contents from the previous cycle into code bits. The program defines generator and received code vectors, calculates the encoded bits, and recovers the original message using majority logic decoding.

Uploaded by

prajakti
Copyright
© © All Rights Reserved
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)
307 views3 pages

Experiment No 5 Aim: To Study and Implement Convolution Codes. Requirement: GCC C Compiler. Theory

The document describes an experiment to study and implement convolutional codes. Convolutional codes encode redundant information into transmitted signals to improve channel capacity and are well-suited for channels with additive white Gaussian noise. The experiment implements a convolutional encoder using a generator polynomial to encode a message bit and register contents from the previous cycle into code bits. The program defines generator and received code vectors, calculates the encoded bits, and recovers the original message using majority logic decoding.

Uploaded by

prajakti
Copyright
© © All Rights Reserved
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/ 3

EXPERIMENT NO 5

Aim: To study and implement convolution codes.

Requirement: GCC C compiler.

Theory:

Convolutional codes are commonly described using two parameters: the code rate
and the constraint length. The code rate, k/n, is expressed as a ratio of the number
of bits into the convolutional encoder (k) to the number of channel symbols output
by the convolutional encoder (n) in a given encoder cycle. The constraint length
parameter, K, denotes the "length" of the convolutional encoder, i.e. how many
k-bit stages are available to feed the combinatorial logic that produces the output
symbols. Closely related to K is the parameter m, which indicates how many
encoder cycles an input bit is retained and used for encoding after it first appears
at the input to the convolutional encoder. The m parameter can be thought of as
the memory length of the encoder.

Advantages:

1. Convolution coding is popular error-correcting method used in digital


communication.
2. The convolution operation encodes some redundant information into the
transmitted signal, and thereby improving the data capacity of the channel.
3. Convolution encoding with Viterbi decoding is a powerful FEC technique
that is particularly suited to a channel in which the transmitted signal is
corrupted mainly by AWGN.

Disadvantages:

1. Even though the convolutional encoder has the simplest procedure,


decoding of it is very complex task.
2. Convolutional codes cannot provide more protection against noise.

Applications:

Convolutional codes are used in the number of the applications which aims
to achieve reliable data transfer, including radio, mobile communications, digital
video communications, and satellite communications.
By using hard decision code, these codes are implemented in concatenation
(example: reed Solomon).
Algorithm:
1. Initialization:
a. Take 2 polynomials as generator polynomial
b. Initialize register equal to degree of polynomial to zero
2. Loop: for each value of bit in message
a. Compute 2 code bits using 2 polynomials, message bit and content
of register from last cycle
b. Send code bit from first polynomial followed by second polynomial.

Program:
#include <iostream>
#include <time.h>
#include <vector>
using namespace std;

int start(){
vector<vector<int>> H =
{{1,1,0,1,0,0},{0,1,1,0,1,0},{1,0,0,0,1,1},{0,0,1,1,0
,1}};
vector<int> rCode = {1,0,1,0,1,1};
vector<vector<int>> E;
for (int i = 0;i < 4;i++){
vector<int> temp;
for(int j = 0;j < 6;j++){
if (H[i][j] == 1){
int k = 0;
for (int l = 0;l<6;l++){
if(l==j)continue;
k ^= (H[i][l]*rCode[l]);
}
temp.push_back(k);
}else{
temp.push_back(-1);
}
}
E.push_back(temp);
}

for (int i = 0 ; i<6;i++){


vector<int> temp =
{E[0][i],E[1][i],E[2][i],E[3][i]};
int c0 = 0,c1 = 0;
if(rCode[i])c1 = 1;
else c0 = 1;
for (auto j : temp){
if(j==-1)continue;
if(j)c1++;
else c0++;
}
rCode[i] = (c1>c0)?1:0;
}

cout<<endl<<"corrected code word is :: ";


for(auto i:rCode){
cout << i << "\t";
}
return 0;
}

int main(int argc, char const *argv[])


{
clock_t begin = clock();

start();

clock_t end = clock();

double time_spent = (double)(end - begin) /


CLOCKS_PER_SEC;
cout << "\nexecution time is " << time_spent <<
endl;
return 0;
}
Output:

1 1 0 1 0 0 1 0 0 0 1 0 1 1 1 1
execution tire is 0.015
process returned 0
Press any key to continue . . .

Result: Thus Convolution Code was studied and implemented.

You might also like