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

📄 main.c

📁 zigzag纠错码是一种非常简单但却具有非常优秀性能的码。非常适合用于中码率或者高码率编码的系统。此为一位教授提供的源码。
💻 C
字号:
/*******************************************************************//*                                                                 *//*           Zigzag Codes and Concatenated Zigzag Codes            *//*            IEEE Transactions on Information Theory              *//*             vol. 47, no. 2, pp. 800-807, Feb. 2001              *//*                                                                 *//*******************************************************************/#include <stdio.h> #include <stdlib.h> #include <math.h>int SimPtNum		= 5;	//This is the number of Eb/No points to be simulated.int ErrorNum		= 500;	//This is the error number to be collected.int IterationNum	= 18; int InterleaverReset	= -1;	//The interval to general a new interleaver.				//Always use the same interleaver if it is less than one.double EbNoStart	= 0.0;	//In dBdouble EbNoStep		= 0.5;void Sweep( double *r, double (*ber)( double, int ) );void Error( char *message );extern void Presim( );extern double Sim( double EbOverNo, int num ); int main( ){	double results[100];	Presim( );	Sweep( results, (*Sim) );        return 0;}void Sweep( double *r, double (*ber)( double, int ) ){	double snr;	int i;	snr = EbNoStart;	for( i=0; i<SimPtNum; i++ )	{		r[i] = ber(snr, ErrorNum); 		fprintf( stdout, "%le %le \n", snr, r[i] );		fflush( stdout );		fprintf( stderr, "%le %le \n", snr, r[i] );		snr += EbNoStep;	}}void Error( char *message ){	fprintf( stderr, "ERROR - %s\n", message );	exit( -1 );}

⌨️ 快捷键说明

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