after that comes the first one
1)
code=gf(coded, 1);
codev = code.x;
reccode=gf(codev, m);
2)
alpha_tb=gf(zeros(1, 2t), m);
for i=1:2t,
alpha_tb(i)=alpha^(2t-i+1);
end;
3)
syndrome=gf(zeros(1, 2t), m)
for i=1:n,
syndrome=syndrome.*alpha_tb+reccode(i);
end;
I found some example for BCH code for Berlekamp-Massey algorithm and i can't understand what some pieces of code do and why are they here
h = comm.BCHEncoder('CodewordLength', 31, 'MessageLength', 21);
msg = [1 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0];
obj = comm.BCHEncoder('CodewordLength', 31, 'MessageLength', 21);
c1 = step(obj, msg(1,:)');
cbch = [c1].';
coded = cbch;
after that comes the first one
1)
code=gf(coded, 1);
codev = code.x;
reccode=gf(codev, m);
2)
alpha_tb=gf(zeros(1, 2t), m);
for i=1:2t,
alpha_tb(i)=alpha^(2t-i+1);
end;
3)
syndrome=gf(zeros(1, 2t), m)
for i=1:n,
syndrome=syndrome.*alpha_tb+reccode(i);
end;
and, lastly, this one
4)
%imba
lambda = gf([1, zeros(1, t)], m);
lambda0= lambda;
b=gf([0, 1, zeros(1, t)], m);
b2 = gf([0, 0, 1, zeros(1, t)], m);
k=0;
gamma = one;
delta = zero;
syndrome_array = gf(zeros(1, t+1), m);
for r=1:t,
r1 = 2t-2r+2;
r2 = min(r1+t, 2t);
num = r2-r1+1;
syndrome_array(1: num) = syndrome(r1:r2);
delta = syndrome_arraylambda';
end