parameter_sets.h

来自「这是校验位打孔重传的源程序」· C头文件 代码 · 共 87 行

H
87
字号
#include "stdlib.h"
#include "stdio.h"
#include "string.h"
#include "time.h"
#include "math.h"

///////////////////////////////////////////////////////////////////////////////
// Define consts here below


///////////////////////////////////////////////////////////////////////////////
// Define structs here below
struct Complex {
	double real;
	double imag;
};

struct LinkNode {
	int rowIdx;
	int colIdx;
	double rMsg[2];
	double qMsg[2];
	struct LinkNode * rowPtr;
	struct LinkNode * colPtr;
};

struct BasicParaS {
	int mode;
	int maxIter;
	int numCols; // numCols is the number of colomns of base H matrix
	int numRows; // numRows is the number of rows of base H matrix
	int numInBits; // numInBits is the number of input bits of encoder including padding bits
	int numOutBits; // numOutBits is the number of output bits of encoder including tail bits
	int numVar; // number of variables, equal to the numInBits
	int numChk; // number of checks, equal to the (numOutBits-numInBits)
	int codeK; // K parameter, number of info bits
	int codeN; // N parameter, length of code words
	int codeM; // M parameter, number of check bits
	int zfactor; // Z parameter, expansion factor
	int totalNumFrames;
	int bitsPerSym;
	int numSymOut;
	int typeModu;
	int typeDecode;
	int noiseMode;
	int numFrames[20];
	int basicH[72][108];
	int expandedH[72][108];
	double Eb_No[20];
	double r;
	struct LinkNode * * rowLink;
	struct LinkNode * * colLink;
	int motherCode[1152];
	int motherCode1[1152];
	int numIter;
	int numHarq;
	double ber1;
};

///////////////////////////////////////////////////////////////////////////////
// List the declarations of functions here below

int DispInitParaF(struct BasicParaS * ctrl);
int LoadBasicMatrixF(struct BasicParaS * ctrl);
int ExpandMatrixF(struct BasicParaS * ctrl);
int * GenerateInputF(struct BasicParaS * ctrl);
int * EncodingF(struct BasicParaS * ctrl, int * input);
struct Complex * ModulatingF(struct BasicParaS * ctrl, int * input, int N) ;
struct Complex * ChanAwgnF(struct BasicParaS * ctrl, struct Complex * input, double Eb_No_dB);
double * DemodulatingF(struct BasicParaS * ctrl, struct Complex * input, double Eb_No_dB);
int * DecodingF(struct BasicParaS * ctrl, double * input);
int SumProductF(struct BasicParaS * ctrl, int * output, double * prob1);
int LogSumProductF(struct BasicParaS * ctrl, int * output, double * c);
int MinSumF(struct BasicParaS * ctrl, int * output, double * c);
double CountBerF(struct BasicParaS * ctrl, int * input, int * output);
int ExportBerF(struct BasicParaS * ctrl, double * ber,double * ber1, double * ber2);
int ExportFerF(struct BasicParaS * ctrl, double * fer, double * fer1, double * fer2);
int ExportOutputF(struct BasicParaS * ctrl, double * throughPut,double * numOper) ;
double logcothsemi(double x);
int MaxLogDeMap(int start, int length, double symbol, double * llr);
int CalcZfactorF(int K, int N);
int ResumeBitsF(struct BasicParaS * ctrl, double * input, double * output);
int * HarqF(struct BasicParaS * ctrl, int * input, double *chanelout,double Eb_No_dB);
int CountEF(struct BasicParaS * ctrl);


⌨️ 快捷键说明

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