Code covered by the BSD License  

Highlights from
reed solomon code

reed solomon code

by

 

24 Dec 2010 (Updated )

everything about RS generation and generation polynomial and encoding and syndrome

[M]=mult(a,b,Y)
function [M]=mult(a,b,Y)
% Multiply two elements over Galois field.
I=ISMEMBER(Y,Y(a,1:size(Y,2)),'rows');
J=ISMEMBER(Y,Y(b,1:size(Y,2)),'rows');

if a==1 || b==1;
    M=1;
end
if a>1 && b>1;
sum=1;
for i=1:size(Y,1)
      if I(i,1)==0;
            sum=sum+1;
      else I(i,1)==1;
          F=sum;
        end
end
F=F-2;
summ=1;
for j=1:size(Y,1)
      if J(j,1)==0
            summ=summ+1;
      else J(j,1)==1;
          G=summ;
      
        end
end
G=G-2;
Z=G+F;
if Z>=size(Y,1)-1
    L=mod(Z,size(Y,1)-1);
M=[L+2];
else
M=[Z+2];
end
end

Contact us