Experiment No 5 Aim: To Study and Implement Convolution Codes. Requirement: GCC C Compiler. Theory
Experiment No 5 Aim: To Study and Implement Convolution Codes. Requirement: GCC C Compiler. Theory
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:
Disadvantages:
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);
}
start();
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 . . .