Code covered by the BSD License  

Highlights from
MATLAB for Digital Communication

image thumbnail

MATLAB for Digital Communication

by

 

The MATLAB programs in "MATLAB/Simulink for Digital Communication" authored by Won Y. Yang et. al

x=cyclic_decoder0(r,N,K,g)
function x=cyclic_decoder0(r,N,K,g)
% Cyclic (N,K) decoding of an N-bit code r with generator polynomial g
for i=1:N-K, x(i)=r(i+K); end
for n=1:K
   tmp=x(N-K);
   for i=N-K:-1:2,  x(i)=rem(x(i-1)+g(i)*tmp,2);   end
   x(1)=rem(g(1)*tmp+r(K+1-n),2);
end

Contact us