Function Hamming (1)
Function Hamming (1)
G={1000110;
0100101;
0010011;
0001111];
if length (data) ~= 4
end
Encoded_data = mod(data * G, 2) ;
disp(encoded_data) ;
no=0) : ‘ ) ;
if introduce_error == 1
disp( encoded_data) ;
else
end
H = [1101000;
1010100;
0110010;
1 1 1 0 0 0 1] ;
% syndrome calculation
Disp(‘syndrome: ‘ ) ;
Disp(syndrome ‘ )
if error-position == 0
else
Disp (encoded_data ) ;
end
Decoded_data = encoded_data(1:4) ;
Disp ( decoded_data)
end