C114门户论坛百科APPEN| 举报 切换到宽版

亚星游戏官网

 找回密码
 注册

只需一步,快速开始

短信验证,便捷登录

搜索
查看: 2893|回复: 1

[技术求助] 看不懂编写RS编码的程序 [复制链接]

军衔等级:

亚星游戏官网-yaxin222  新兵

注册:2012-3-26
发表于 2014-8-14 09:58:48 |显示全部楼层
%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 是干嘛的

举报本楼

本帖有 1 个回帖,您需要登录后才能浏览 登录 | 注册
您需要登录后才可以回帖 登录 | 注册 |

手机版|C114 ( 沪ICP备12002291号-1 )|联系大家 |网站地图  

GMT+8, 2024-11-16 16:29 , Processed in 0.097627 second(s), 15 queries , Gzip On.

Copyright © 1999-2023 C114 All Rights Reserved

Discuz Licensed

回顶部
XML 地图 | Sitemap 地图