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

📄 codec.h

📁 Turbo码性能仿真源程序信道编码方面的
💻 H
字号:


class Conv
{
private:
	int NodeOrder;
	int NodeNum;
	int TrellisLen;
	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 );
	void TailGen( );

	float tmp[POLYSTATENUM];
	float Rcd[CONVTRELLISLEN+1][POLYSTATENUM];

public:
	int TermTable[POLYSTATENUM][POLYSTATEORDER*2];
	int Flnk[POLYSTATENUM][2];
	int Bcode[POLYSTATENUM][2];
	float aPP[CONVTRELLISLEN][4];
	float CodeInf[CONVTRELLISLEN][POLYSTATENUM][2];
	
	void Init( int _NodeOrder, int _TrellisLen, int _Npoly, int _Dpoly );
	void Encoder( int *_DataIn, int *_ParityOut, int *_EndS );
	void BCJR( float *_StartProb, float *_EndProb );
};

class SpcCoDec
{
	private:
		int NUser;
		int DataLen, CodewordLen, PuncturedCodewordLen;
		int Puncture;
		int EfoldNum, FfoldNum, FoldNum;
		int TrellisLen;
		int NestDim;
		int NodeOrder, NodeNum, Npoly, Dpoly;
		int SpcInterNum;
		
		int DataIn[SPCTRELLISLEN];
		int ParityOut[SPCTRELLISLEN];
		int ShaffleRule[NESTDIM][DATALEN];
		float Zin[DATALEN];
		float tmpbf[DATALEN];
		float Border[2][POLYSTATENUM];
		float ExInf[NUSER][NESTDIM][DATALEN];
		float Eparity[SPCTRELLISLEN];
		float Fparity[SPCTRELLISLEN];
		float EparityBf[SPCTRELLISLEN][EFOLDNUM];
		float FparityBf[SPCTRELLISLEN][FFOLDNUM+1];

		Conv ConvSpc;
		void Check( );
		void EInterleaver( );
		void FInterleaver( );	
		void BorderReSet( );
		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 );

	public:
		float Rate;
		void Init( int Nuser, int Datalen, int Pun, int Enum, int Fnum, int Nestdim, int Spctrellislen, int Nodeorder, int Spcnpoly, int Spcdpoly, int Spcinternum );
		void Encoder( int Nuser, int *Codeword, int *RawData );
		void PreDecode( );
		void Decoder( int Nuser, float *Codeword, char *Flag );
};

⌨️ 快捷键说明

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