⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 codec.h

📁 这个程序主要是基于空时编码的编解码实现过程。
💻 H
字号:
#include "input.h"

class Conv
{
private:
	int NodeOrder;
	int NodeNum;
	int TrellisLen;
	float *tmp;
	float **Rcd;
	void SysCodeTable( int _Npoly, int _Dpoly );
	void BranchCode( int i, int n, int _Npoly );
	void BwSearch( float *_StartProb, float *_EndProb );
	void FwSearch( int i );
	void StateNorm( float *rcd );
	void AppDecode( float *_StartProb, float *_EndProb );


public:
	int **TermTable;
	int **Flnk;
	int **Bcode;
	float **aPP;
	float ***CodeInf;
	void Init( int _NodeOrder, int _TrellisLen, int _Npoly, int _Dpoly );
	void Encoder( int *_DataIn, int *_ParityOut, int *_EndS );
	void BCJR( float *_StartProb, float *_EndProb );
	void TailGen( );
	void End( );

	float	LlrAdd( float a, float b );
};

class SpcCoDec
{
	private:
		int NUser;
		int DataLen, CodewordLen;
		int EfoldNum, FfoldNum, FoldNum;
		int TrellisLen;
		int NestDim;
		int NodeOrder, NodeNum, Npoly, Dpoly;
		int SpcInterNum;
		
		int *DataIn;
		int *ParityOut;
		int **ShaffleRule;
		float *Zin;
		float *tmpbf;
		float ***Border;
		float ***ExInf;
		float *Eparity;
		float *Fparity;
		float **EparityBf;
		float **FparityBf;
		
		Conv ConvSpc;
		void BorderReSet( int Nuser );
		void Check( );
		void MemoryAllocation( );
		void EInterleaver( );
		void FInterleaver( );		
		void MapDecoding( float *Parity, float *Tail, int _NUser, int dim, char *Flag );
		void Apriori( float *Parity, float *Tail );
		void Aposteriori( int _Nuser, int dim, float *Parity, float *Tail, char *Flag );
		void PrePrtDec( float *Zin, float *Parity, float *bf, int blength );
		void PostPreDec( float *Zin, float Parity, float *bf, int blength );
		float Plr( float x, float y );
//		float Clip( float x );

	public:
float Sum_Ex[DATALEN];
		float Rate;
		void Init( int Nuser, int Datalen, int Codewordlen, int Enum, int Fnum, int Nestdim, int Spctrellislen, int Nodeorder, int Spcnpoly, int Spcdpoly, int Spcinternum );
		void Encoder( int *Codeword , int *rawData );
		void PreDecode( );
		void Decoder( int Nuser, float *Codeword, char *Flag );
		void End( );
};


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -