www.pudn.com > matlab.rar > rs_encode1.m, change:2015-04-19,size:482b


function t_x=rs_encode1(m_x) 
r=zeros(1,33); 
m_x = 1:223; 
gx = [1  232  29   189   50   142   246   232   15  43   82   164  238  1 158  13   119   158   224   134   227   210   163   50   107   40   27   104   253   24   239  216  45]; 
for i = 1:223 
   r(33)=rs_add(r(32),m_x(224-i)); 
   for j = 32:-1:2 
       r(j)=rs_add(r(j-1),rs_mul(r(33),gx(34-j))); 
   end 
  r(1)=rs_mul(r(33),gx(33)); 
end 
t_x=[r(1:32),m_x]; 
for i = 1:223 
 r_x(i*8-7:i*8) = de2bi(t_x(i),8); 
end