通信人家园

标题: 看不懂编写RS编码的程序  [查看完整版帖子] [打印本页]

时间:  2014-8-14 09:58
作者: 豆豆258     标题: 看不懂编写RS编码的程序

%This is the main program to realize a (244,212) RS encoding in GF(2^8)
%primitive polynomial in GF(2^8): x^8+x^7+x^2+x+1,
%generator polynomial g(x)=П (x-α^11j)=ПG(i)x^i,j=112:143,i=0:33


N=244;%codeword length 244
K=212;%information sequence length 212
shorten=11;%the number of '0' shortened
range=11*(112:143);%the range of the exponential of α in polynomial
prim_poly=391;%the decimal presentation of primitive polynomial

CN=N-K;%Checkcode's number

n=N+shorten;%the length of original signal
msg=randint(1,K,[0,n]);%generate random information sequence
genpoly=rs_genpoly(N,K,prim_poly,range);%Call the function to generate the coefficients of the polynomial
cc=rs_encode(K,CN,msg,genpoly);%Call the function to get the check code
mcode=[msg,cc]%Combine  the information code and test code to get the encoded results
这是主程序,里面程序的第三行shorten 是干嘛的


时间:  2014-8-14 10:15
作者: 豆豆258

大婶们帮帮忙啦




通信人家园 (https://www.txrjy.com/) Powered by C114