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


G=[1 1 1 1 0 0 1;1 0 1 1 0 1 1];  
k = 1; 
msg = 1:223; 
rs_code = rs_encode(msg); 
for i = 1:255 
 r_x(i*8-7:i*8) = de2bi(rs_code(i),8); 
end 
cnv_code = cnv_encd(r_x); 
right_channel_output = cnv_code; 
code=viterbi(G,k,right_channel_output); 
for i = 1:255 
r_x(i) = bi2de(code(i*8-7:i*8)); 
end 
m_x=rs_decoder(r_x); 
disp('输入信息序列:') 
pause 
msg 
disp('输出信息序列:') 
pause 
m_x