2014
这篇文章主要介绍了利用c语言实现卷积码编码器示例,需要的朋友可以参考下
实现(2, 1, 7)卷积码编码
信息序列1001 1010 1111 1100
生成序列g1 = 1011011;g2 = 1111001
初始状态全0.
以上参数可自行在main中修改。
/***This is an simple example program of convolutional encoder.
*The information sequence, the register initial states and the generation sequence
* can all be modified in the main function.
*/
#include
#define LEN(array, len){len=sizeof(array)/sizeof(array[0]);}//Size of array
int encoder(int **gen, int n, int L, int reg[], int m, int inf[], int inf_len, int output[])
/*encoder(int **gen, int n, int L, int reg[], int m, int inf[], int inf_len, int output[])
*This function is a convolutional encoder.
*gen is the generation sequence, which is a two-dimension array,
and it is a two-dimension pointer,
*n is the number of bits out the en