资源简介
好用的用c语言写的图像插值算法,图像处理可参考
代码片段和文件信息
/*******************************************************************************************
MAP decoder Simulation in C
Note :
-------
This program is used to simulate the Maximum A-Posteriori Probability algorithm in C.
Since this program is used only for simulation I have not done much of code optimization (as
well as memory optimization). So this program might run a bit slower. I‘ll try to optimize the
code and memory requirements and update this program as soon as possible.
Parameters :
---------------
Thus MAP algorithm will decode a single convolutional code. The parameters of the convolutional
code can be easily set by modifying the N_STATES POSSIBLE_INPUTS NextStates[] and ActualOutputs[][]
in accordance with the code that you have used.
Documentation :
----------------
Detailed comments are provided throughout this Code. There will not be much problems in reading it.
For some good explanation about this algorithm please visit this page.
http://www.redrival.com/rvc/faq/map.htm
This page is a FAQ on this algorithm that I have prepared. It is better to read that FAQ first before
going thro‘ this code.
For comments and suggestion drop me line at vc@lucent.com.
Important Notes :
------------------
1. I have used Likehood ratios instead of Log-Likehood ratios currently because of some numerical
instability problems. I will correct the code later.
2. The trellis is assumed to be terminated. If this is not the case the funtion InitializeBetas()
has to be modified. (A general purpose function can also be provided.. but unnecessary ‘cause
the trellis is normally terminated in most cases).
********************************************************************************************/
#include
#include
#include “intleave.h“
/* Some global Constants */
/* Defines the possible no of inputs for a given state. It will be 2^(input block length).*/
#define POSSIBLE_INPUTS 2
#define N_STATES 4 /* Total no of states in the state machine */
#define BLOCK_LENGTH 18 /* Length of the block to be decoded */
#define NUM_OUTPUTS 2 /* No of outputs in the Convolutional Encoder. */
/* List of Global Variables and Arrays used */
/* ======================================== */
/* This table holds the values of the next states */
/* This table can also be calculated dynamically using the static variables and bit shifts.*/
int NextStates[N_STATES*POSSIBLE_INPUTS] = {02203113};
/* This array holds the actual outputs of the channel encoder */
int ActualOutputs[N_STATES*POSSIBLE_INPUTS][NUM_OUTPUTS] = {{00}{11}{00}{11}{01}{10}{01}{10}};
/* This array holds tha outputs that were received from the demodulator (Corrupted Outputs) */
//int NoisyOutputs[NUM_OUTPUTS][BLOCK_LENGTH] = {{00}{11}{01}{10}{01}{11}{00}{11}{01}{10}{01}{11}{00}{11}{01}{10}{01}{11}};
int NormalOutputs[BLOCK_LENGTH][NUM_OUTPUTS] = {{00}{11}{01}{10}{01}{11}{00}{11}{01}{10}{01}{11}{0
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1526 2000-01-05 14:24 intleave.cc
文件 321 2000-01-03 18:48 intleave.h
文件 19325 2000-04-03 02:52 MapDecoder.cpp
- 上一篇:校园导航系统c++数据结构
- 下一篇:mfc 用对话框打开并读取txt文件的小程序
评论
共有 条评论