📄 chcoding.h
字号:
/* | | Copyright disclaimer: | This software was developed at the National Institute of Standards | and Technology by employees of the Federal Government in the course | of their official duties. Pursuant to title 17 Section 105 of the | United States Code this software is not subject to copyright | protection and is in the public domain. | | We would appreciate acknowledgement if the software is used. |*//* | Project: WCDMA simulation environment | Module: Channel coding combinary block. | Author: Tommi Makelainen, Nokia/NIST | Date: February 11, 1999 | | History: | February 11, 1999 Tommi Makelainen | Initial version. | March 18, 1999 Tommi Makelainen | Added possibility to use more than one encoder | at the same time. | May 23, 1999 Tommi Makelainen | Extracted interleaver. | Added possibility to have many types | of channel coding methods (conv. or Turbo). | */#include <stdio.h>#include <math.h>#include "conversions.h"#include "bitroutines.h"#include "config_wcdma.h"#include "mealy.h"#include "metrics.h"#include "convenc.h"#include "interleaver.h"/* * generator polynomials for 3GPP FDD mode convolutional coder * gen_poly_1 = 0x16f; 557 octal * gen_poly_2 = 0x1b3; 663 octal * gen_poly_3 = 0x1c9; 711 octal *//* -------------------------------------------------------------------- *//* * Function: wcdma_convcoding_init * Desc.: Convolutional coding and interleaving initialization * * Note: * Generator polynomials are given as bit masks, * i.e. 0x5 = 101 in binary = x^2 + 1 in polynomial form. */int wcdma_convcoding_init(int coding_ratio, /* IN: 2 = 1/2, 3 = 1/3 */ int metric_type, /* IN: 0=hard, 1=soft */ int gen_poly_1, /* IN: 1st generator polynomial */ int gen_poly_2, /* IN: 2nd generator polynomial */ int gen_poly_3, /* IN: 3rd generator polynomial */ int input_size); /* IN: size of input vector *//* -------------------------------------------------------------------- *//* * Function: wcdma_chcoding_init * Desc.: Channel coding initialization * * Note: * The input parameters must fulfill the equation: * nInputs = 3 * rows * cols * Tail vector is 8 bits long. */int wcdma_chcoding_init(int coder_type, /* IN: 1=conv., 2=turbo */ int metric_type, /* IN: 0=hard, 1=soft */ int coding_ratio, /* IN: 2 = 1/2 or 3 = 1/3 */ int gen_polys[], /* IN: generator polynomials */ int input_size); /* IN: size of input vector *//* -------------------------------------------------------------------- *//* * Function: wcdma_chcoding_enc * Desc.: Convolutional coding and interleaving block * * Note: * Tail vector is 8 bits long. */int wcdma_chcoding_enc(int coder_type, /* IN: 1=conv., 2=turbo */ int coding_ratio, /* IN: 2 = 1/2 or 3 = 1/3 */ int inputs[], /* IN: input bit vector */ int nInputs, /* IN: input vector size */ int outputs[], /* OUT: output bit vector */ int tail[], /* OUT: tail bits */ int instance); /* IN: instance number *//* -------------------------------------------------------------------- *//* * Function: wcdma_chcoding_free * Desc.: Convolutional coding and interleaving clear function. * * Note: */int wcdma_chcoding_free(int instance);/* -------------------------------------------------------------------- */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -