共2条
1/1 1 跳转至页
BCH,31,21 求BCH(31,21)码的编码解码原理!!!急死人了

问
以前只做过有线通讯,现在有个项目要用到无线通讯,BCH码搞得很头痛,资料又很少,希望能得到大家的帮助!!
谢谢大家了!! 答 1: 没有人做这个吗??急寻jw5th大侠和lijieuse,想得到你们的帮助! 答 2: 单字节BCH码算法示例unsigned char cal_BCH(unsigned char *pnt,unsigned char N)//N为参加运算的数据个数
{
unsigned char idata tt[18]; //留足空间
unsigned char i,j,temp;
pnt[N]=0;
for(i=0;i<N+1;i++) tt[i]=pnt[i];//give initial value
for(i=0;i<(8*N+1);i++)
{
if(tt[0]&0x80) tt[0]=tt[0]^0xe5;
for(j=0;j<N;j++)
{
tt[j]=tt[j]<<1;
if(tt[j+1]&0x80) tt[j]++;
}
}
pnt[N]=tt[0]&0xfe;
for(i=0;i<N+1;i++) tt[i]=pnt[i];
temp=0;
for(j=0;j<N+1;j++)
{
for(i=0;i<8;i++)
{
if(tt[j] & 0x80) temp++;
tt[j]=tt[j]<<1;
}
}
if(temp%2)pnt[N]=pnt[N] | 0x01;
else pnt[N]=pnt[N] & 0xfe;//end of get BCH
return pnt[N];
}
//****************************************************************************
答 3: 谢谢支持!! 答 4: 这个算法不能纠错吧?
谢谢大家了!! 答 1: 没有人做这个吗??急寻jw5th大侠和lijieuse,想得到你们的帮助! 答 2: 单字节BCH码算法示例unsigned char cal_BCH(unsigned char *pnt,unsigned char N)//N为参加运算的数据个数
{
unsigned char idata tt[18]; //留足空间
unsigned char i,j,temp;
pnt[N]=0;
for(i=0;i<N+1;i++) tt[i]=pnt[i];//give initial value
for(i=0;i<(8*N+1);i++)
{
if(tt[0]&0x80) tt[0]=tt[0]^0xe5;
for(j=0;j<N;j++)
{
tt[j]=tt[j]<<1;
if(tt[j+1]&0x80) tt[j]++;
}
}
pnt[N]=tt[0]&0xfe;
for(i=0;i<N+1;i++) tt[i]=pnt[i];
temp=0;
for(j=0;j<N+1;j++)
{
for(i=0;i<8;i++)
{
if(tt[j] & 0x80) temp++;
tt[j]=tt[j]<<1;
}
}
if(temp%2)pnt[N]=pnt[N] | 0x01;
else pnt[N]=pnt[N] & 0xfe;//end of get BCH
return pnt[N];
}
//****************************************************************************
答 3: 谢谢支持!! 答 4: 这个算法不能纠错吧?
共2条
1/1 1 跳转至页