?? countber.cpp
字號(hào):
/**********************************************/
/* Counter of error bits
/* double CountBerF(struct BasicParaS * ctrl, int * input, int * output)
/* Written by: Ouyang Ziyue,
/* Date: Jun 19th, 2007,
/* Function: It compares the orginial info bits and the decoded info bits to calc the error ratio
/* Input parameter:
/* The length of info bits is included in the ctrl,
/* The input is the original input bits,
/* The output is the output of decoder
/* Output parameter:
/* The return value is the BER
/* Note:
/* ctrl should be built before this function is called,
/**********************************************/
#include "parameter_sets.h"
double CountBerF(struct BasicParaS * ctrl, int * input, int * output)
{
//////////////////////////////////////////////////////////////////////////
//Declaration
double ber;
int i;
double counter=0;
//////////////////////////////////////////////////////////////////////////
//Counting BER
for (i=0; i<ctrl->codeK; i++)
{
if ((*(input+i)) != (*(output+i)))
{
counter += 1;
#ifdef DEBUG
printf("%d\n",i);
#endif
}
}
ber = counter/ctrl->codeK;
return ber;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -