1 function [ m ] = calc_syndrome( code, x )
\r
2 %CALC_SYNDROME calculates syndrome of code from word x.
\r
4 % Tomas Filler (tomas.filler@binghamton.edu)
\r
5 % http://dde.binghamton.edu/filler
\r
7 m = zeros(sum(code.shift),1);
\r
11 hi = uint32(code.h(i));
\r
13 tmp = bitxor(hi, tmp);
\r
15 for j = 1:code.shift(i)
\r
16 m(m_id) = mod(tmp,2);
\r
17 tmp = bitshift(tmp,-1); % bit shift
\r