exportoutput.h
来自「这是校验位打孔重传的源程序」· C头文件 代码 · 共 41 行
H
41 行
#include "parameter_sets.h"
int ExportBerF(struct BasicParaS * ctrl, double * ber,double * ber1, double * ber2)
{
int i;
FILE * fpOut = fopen("BER.dat", "w");
fprintf(fpOut, "This is the statistic data of BER ..\n");
printf("\n");
for (i=0; i<59; i++)
printf("*");
printf("\n");
printf("This is the statistic data of BER ..\n");
if (ctrl->noiseMode == 0) {
for (i=0; i<ctrl->totalNumFrames; i++) {
fprintf(fpOut, "When Eb_No is %.2fdB, the BER is %E\n", ctrl->Eb_No[i], *(ber+i));
fprintf(fpOut, " the BER1 is %E\n", *(ber1+i));
fprintf(fpOut, " the BER2 is %E\n", *(ber2+i));
printf("When Eb_No is %.2fdB, the BER is %E\n", ctrl->Eb_No[i], *(ber+i));
printf( " the BER1 is %E\n", *(ber1+i));
printf( " the BER2 is %E\n", *(ber2+i));
}
}
else
{
for (i=0; i<ctrl->totalNumFrames; i++)
{
fprintf(fpOut, "When SNR is %.2fdB, the BER is %E\n", ctrl->Eb_No[i], *(ber+i));
fprintf(fpOut, " the BER1 is %E\n", *(ber1+i));
fprintf(fpOut, " the BER2 is %E\n", *(ber2+i));
printf("When SNR is %.2fdB, the BER is %E\n", ctrl->Eb_No[i], *(ber+i));
printf( " the BER1 is %E\n", *(ber1+i));
printf( " the BER2 is %E\n", *(ber2+i));
}
}
fclose(fpOut);
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?