资源简介
GOLAY.c
代码片段和文件信息
#include
void golay_enc(u16* golay_enc_in u16* golay_enc_out);
int golay_dec(u16* golay_dec_in u16* golay_dec_out);
/**************************************************************************
* Function: Golay(24128) Encoder and Decoder for DMR standard. *
* Reference: *
* 1: DMR standard ts_10236101v010405p.pdf page 128. *
* 2: Error Control Coding/Second Edition/Lin Shu/Ch04.pdf/page 27. *
* 3: Generator polynomial: g(X)=X^11+X^10+X^6+X^5+X^4+X^2+1=6165_oct *
* 4: There are two different generator polynomials. *
* *
*************************************************************************/
//===== Bit Struct ====
//|<- Info ->|<- Parity ->|
//________________________________
//|23|22| ...|13|12|11|10|...|1|0|
//----------------------------
//===== golay table ======
// G = [I_12 P]
// H = [Q I_12]
static const u16 P[] =
{
0xc75 // 1100_0111_0101
0x63b // 0110_0011_1011
0xf68 // 1111_0110_1000
0x7b4 // 0111_1011_0100
0x3da // 0011_1101_1010
0xd99 // 1101_1001_1001
0x6cd // 0110_1100_1101
0x367 // 0011_0110_0111
0xdc6 // 1101_1100_0110
0xa97 // 1010_1001_0111
0x93e // 1001_0011_1110
0x8eb // 1000_1110_1011
};
static const u16 Q[] = // Q = P‘ = inv(P)
{
0xa4f // 1010_0100_1111
0xf68 // 1111_0110_1000
0x7b4 // 0111_1011_0100
0x3da // 0011_1101_1010
0x1ed // 0001_1110_1101
0xab9 // 1010_1011_1001
0xf13 // 1111_0001_0011
0xdc6 // 1101_1100_0110
0x6e3 // 0110_1110_0011
0x93e // 1001_0011_1110
0x49f // 0100_1001_1111
0xc75 // 1100_0111_0101
};
//===== golay_enc() ======
// function: Golay(24128) encoder.
// input: u16 golay_enc_in;
// output: u16 golay_enc_out[2];
// golay_enc_out[0] is info golay_enc_out[1] is parity.
// Both use low 12 bits. [golay_enc_out[0] golay_enc_out[1]] = golay_enc_in * G.
// No return value.
//#pragma CODE_SECTION (golay_enc “.text1“)
void golay_enc(u16* golay_enc_in u16* golay_enc_out)
{
u16 i j;
golay_enc_out[0] = *golay_enc_in;
golay_enc_out[1] = 0;
for(i = 0; i < 12; i++)
{
j = golay_enc_out[0] & Q[i];
j = (j & 0xff) ^ (j >> 8);
j = (j & 0x0f) ^ (j >> 4);
j = (j & 0x03) ^ (j >> 2);
j = (j & 0x01) ^ (j >> 1);
golay_enc_out[1] = (golay_enc_out[1] << 1) ^ j;
}
}
//===== golay_dec() ======
// function: Golay(24128) decoder.
// input: u16 golay_dec_in[2];
// output: u16 golay_dec_out;
// golay_dec_in[0]
- 上一篇:WCD9335.pdf
- 下一篇:PatentDocuments.rar
相关资源
- PatentDocuments.rar
- WCD9335.pdf
- PDLED8Test.exe
- 91605.pdf
- c6viqw.doc
- AD库百度云.txt
- 64位.zip
- jm电子琴.doc
- sharedmatting.rar
- SPH算法k文件.rar
- .C.rar
- music.zip
- qt_multicast.tar.gz
- 计算机网络基础期末考试试题.docx
- 材料力学公式.pdf
- 侠客正则工具.rar
- MyScheduler.rar
- jjlt1989_9131403.zip
- jjk_serial_Win.rar
- 微机原理与接口电子琴课程设计报告
- 毕业生管理系统.zip
- jilekai_4099125.zip
- dangdang.zip
- 网盘地址.txt
- BOOST10-20.psimsch
- DifferentialDriveOpenLoopController.zip
- 上学吧查答案.exe
- 实验一小波变换-副本.pdf
- ezcad.txt
- 60cc621e15ca356c974c47ee895f0181.zip
评论
共有 条评论