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

Matlab Programs - Linear Block Code Itc Mini Project

This document describes a Matlab program that implements a linear block code. The program takes a generator matrix as input and calculates the order, possible codewords, minimum Hamming distance, and performs error detection on a received codeword. It demonstrates encoding data using the generator matrix and decoding a received word by calculating the syndrome and correcting any errors.

Uploaded by

shivaranjani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views3 pages

Matlab Programs - Linear Block Code Itc Mini Project

This document describes a Matlab program that implements a linear block code. The program takes a generator matrix as input and calculates the order, possible codewords, minimum Hamming distance, and performs error detection on a received codeword. It demonstrates encoding data using the generator matrix and decoding a received word by calculating the syndrome and correcting any errors.

Uploaded by

shivaranjani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

11/17/2016

MatlabPrograms:LinearBlockCode
2

More NextBlog

CreateBlog SignIn

Visit

Sunday, June 8, 2008

Linear Block Code

MiraRoad.com

About Me
Lionel

%Aim:ImplementationOflinearBlockCode

iAmanEngineeringStudentFromIndiaWhoJust
LovesProgrammingandSingingandlisteningto
Gospelmusic

clc
clearall
%InputGeneratorMatrix
g=input('EnterTheGeneratorMatrix:')
disp('G=')
disp('TheOrderofLinearblockCodeforgivenGeneratorMatrixis:')
[n,k]=size(transpose(g))
fori=1:2^k
forj=k:1:1
ifrem(i1,2^(j+k+1))>=2^(j+k)
u(i,j)=1
else
u(i,j)=0
end
end
end
u
disp('ThePossibleCodewordsare:')
c=rem(u*g,2)
disp('TheMinimumHammingDistancedminforgivenBlockCodeis=')
d_min=min(sum((c(2:2^k,:))'))

Viewmycompleteprofile

Blog Archive
2008(3)
June(3)
InformationonCyclicCode
InformationonConvolutional
Code
LinearBlockCode

%CodeWord
r=input('EntertheReceivedCodeWord:')
p=[g(:,nk+2:n)]
h=[transpose(p),eye(nk)]
disp('HammimgCode')
ht=transpose(h)
disp('SyndromeofaGivenCodewordis:')
s=rem(r*ht,2)
fori=1:1:size(ht)
if(ht(i,1:3)==s)
r(i)=1r(i)
break
end
end
disp('TheErrorisinbit:')
i
disp('TheCorrectedCodewordis:')
r
%********************OUTPUT*******************
EnterTheGeneratorMatrix:[1000101010011100101100001011]
g=
1000101
0100111
0010110
0001011
G=

http://matlabpgm.blogspot.in/2008/06/linearblockcode.html

1/3

11/17/2016

MatlabPrograms:LinearBlockCode

TheOrderofLinearblockCodeforgivenGeneratorMatrixis:
n=
7
k=
4
ThePossibleCodewordsare:
c=
0000000
0001011
0010110
0011101
0100111
0101100
0110001
0111010
1000101
1001110
1010011
1011000
1100010
1101001
1110100
1111111
TheMinimumHammingDistancedminforgivenBlockCodeis=
d_min=
3
EntertheReceivedCodeWord:[1000100]
r=
1000100
HammimgCode
ht=
101
111
110
011
100
010
001
SyndromeofaGivenCodewordis:
s=
001
TheErrorisinbit:
i=
7
TheCorrectedCodewordis:
r=
1000101
PostedbyLionelat3:51AM

5comments:
SitiHasunahMohammadsaid...
thanks,ithelpsalot.
April9,2009at8:55AM

farshadsaid...
can you help me to know how generator matrix for linear codes for given n and k such as
n=19andk=8canbeproduced?(usingmatlab)
November14,2009at9:32AM

PratikshyaParidasaid...
DoyouknowaboutSingletonboundbyanychance?
November1,2011at12:28AM

ayiesaid...

http://matlabpgm.blogspot.in/2008/06/linearblockcode.html

2/3

11/17/2016

MatlabPrograms:LinearBlockCode

Whoknowhowtoencodedocumentfile.doctothislinearblockcode?...anyone??..please
helpme
May17,2012at10:40AM

GauravAgarwalsaid...
???Errorusing==>horzcat
CATargumentsdimensionsarenotconsistent.
Errorin==>ITCat29
h=[transpose(p),eye(nk)]

gettingthiserrorwhenimplementing(6,3)LBCwidthiscode.plzadvice
April21,2014at11:39AM

PostaComment
NewerPost

Home

Subscribeto:PostComments(Atom)

http://matlabpgm.blogspot.in/2008/06/linearblockcode.html

3/3

You might also like