📄 main.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 + -