Sunday, June 8, 2008
Information on Cyclic Code
Posted by Lionel at 4:01 AM 1 comments
Information on Convolutional Code
Satellite communications systems commonly use a convolutional code to protect all data carried on the link.
Posted by Lionel at 4:00 AM 3 comments
Linear Block Code
% Aim: Implementation Of linear Block Code
clc;
clear all;
% Input Generator Matrix
g=input('Enter The Generator Matrix: ')
disp ('G = ')
disp ('The Order of Linear block Code for given Generator Matrix is:')
[n,k] = size(transpose(g))
for i = 1:2^k
for j = k:-1:1
if rem(i-1,2^(-j+k+1))>=2^(-j+k)
u(i,j)=1;
else
u(i,j)=0;
end
end
end
u;
disp('The Possible Codewords are :')
c = rem(u*g,2)
disp('The Minimum Hamming Distance dmin for given Block Code is= ')
d_min = min(sum((c(2:2^k,:))'))
% Code Word
r = input('Enter the Received Code Word:')
p = [g(:,n-k+2:n)];
h = [transpose(p),eye(n-k)];
disp('Hammimg Code')
ht = transpose(h)
disp('Syndrome of a Given Codeword is :')
s = rem(r*ht,2)
for i = 1:1:size(ht)
if(ht(i,1:3)==s)
r(i) = 1-r(i);
break;
end
end
disp('The Error is in bit:')
i
disp('The Corrected Codeword is :')
r
%******************** OUTPUT *******************
Enter The Generator Matrix: [1 0 0 0 1 0 1;0 1 0 0 1 1 1;0 0 1 0 1 1 0;0 0 0 1 0 1 1]
g =
1 0 0 0 1 0 1
0 1 0 0 1 1 1
0 0 1 0 1 1 0
0 0 0 1 0 1 1
G =
The Order of Linear block Code for given Generator Matrix is:
n =
7
k =
4
The Possible Codewords are :
c =
0 0 0 0 0 0 0
0 0 0 1 0 1 1
0 0 1 0 1 1 0
0 0 1 1 1 0 1
0 1 0 0 1 1 1
0 1 0 1 1 0 0
0 1 1 0 0 0 1
0 1 1 1 0 1 0
1 0 0 0 1 0 1
1 0 0 1 1 1 0
1 0 1 0 0 1 1
1 0 1 1 0 0 0
1 1 0 0 0 1 0
1 1 0 1 0 0 1
1 1 1 0 1 0 0
1 1 1 1 1 1 1
The Minimum Hamming Distance dmin for given Block Code is=
d_min =
3
Enter the Received Code Word:[1 0 0 0 1 0 0]
r =
1 0 0 0 1 0 0
Hammimg Code
ht =
1 0 1
1 1 1
1 1 0
0 1 1
1 0 0
0 1 0
0 0 1
Syndrome of a Given Codeword is :
s =
0 0 1
The Error is in bit:
i =
7
The Corrected Codeword is :
r =
1 0 0 0 1 0 1
Posted by Lionel at 3:51 AM 8 comments