卷积码编码和BCJR译码

本文探讨了卷积码的编码过程,并详细介绍了BCJR译码算法的实现,通过提供的代码展示了如何在实际应用中进行这两种操作。
摘要由CSDN通过智能技术生成

实现卷积码编码和BCJR译码。



以下是实现该算法的代码:

convolution.h

#define EDGE_NUM 8
#define INF 0x3fffff
#define CONV_CODE_RATE 0.5
#define LL 1000
#include <iostream>
struct edge {
	int left;
	int right;
	int input;
	int output;
};
static int next_state[8][2] = { { 0, 2 },
{ 2, 0 },
{ 4, 6 },
{ 6, 4 },
{ 5, 7 },
{ 7, 5 },
{ 1, 3 },
{ 3, 1 } };
static int output[8][2] = { { 0, 11 },
{ 0, 11 },
{ 0, 11 },
{ 0, 11 },
{ 1, 10 },
{ 1, 10 },
{ 1, 10 },
{ 1, 10 } };
static edge trans_M[16];
static int cost_matrix[LL + 2][EDGE_NUM];
static int prestate[LL + 2][EDGE_NUM];
static int decoding_seq[LL + 2];
static int encode_con[2 * LL + 2];
void ini_edge();
int* encode_convolution(int* source, int len);
int *convolution_decoing(int* received_seq, int seq_length);

convolution.cpp

#include"convolution.h"
#include<iostream>
using namespace std;
void ini_edge() {
	for (int i = 0; i < 16; i++) {
		trans_M[i].left = i / 2;
		trans_M[i].r
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值