error tracking in networks...
by barkkathulla[ Edit ] 2012-09-22 12:42:08
disp('the possible code words are:');disp(u);
c=rem(u*g,2)
disp('the min hamming distance dmin for given block code is=');disp(c);
d_min=min(sum((c(2:2^k,
)'));
r=input('enter the received code word:');
p=[g(:,n-k+2:n)];
h=[transpose(p),eye(n-k)];
disp('hamming code');
ht=transpose(h);
disp('syndrome of a given code word is :');
s=rem(r*ht,2)
for i=1:1:size(ht)
if(ht(i,1:3)==s)
r(i)=1-r(i);
break;