A python-based BER confidence level calculator is being developed for a GNU Radio OOT. From reference 1, the confidence level is calculated by the equation
However, reference 2 calculates the confidence level by using the formula:
The first question is about the two formulas. Why are they different? I did try to implement both of them. The first version is pretty straightforward. However, the exponential and the factorial operations in the second formula caused an "OverflowError: math range error" problem. How do we deal with this?
import math
def confidence_level(N,ber,E):
sum = 0.0;
for k in range(0,E):
sum += math.pow(N*ber,k)/math.factorial(k);
cl = 1.0 - math.exp(-N*ber)*sum;
print cl;
confidence_level(1.80e+10, 1.0e-6, 6350);
Reference 1: https://www.keysight.com/main/editorial.jspx?ckey=1481106&id=1481106&nid=-11143.0.00&lc=eng&cc=LV
Reference 2: https://www.jitterlabs.com/support/calculators/ber-confidence-level-calculator
EDIT It seems like the first formula reduces to CL = 1 - exp(-NErrors) since BER = NErrors/NBits. For BPSK modulation with Eb/No = 7 dB, the 100% confidence level is obtained after 14 errors have been detected, which doesn't seem to be accurate.
NBits: 1600 NErrs: 1 BER: 6.2500E-04 CL: 6.3212E-01
NBits: 3200 NErrs: 1 BER: 3.1250E-04 CL: 6.3212E-01
NBits: 4800 NErrs: 3 BER: 6.2500E-04 CL: 9.5021E-01
NBits: 8000 NErrs: 6 BER: 7.5000E-04 CL: 9.9752E-01
NBits: 9600 NErrs: 6 BER: 6.2500E-04 CL: 9.9752E-01
NBits: 11200 NErrs: 8 BER: 7.1429E-04 CL: 9.9966E-01
NBits: 12800 NErrs: 8 BER: 6.2500E-04 CL: 9.9966E-01
NBits: 14400 NErrs: 9 BER: 6.2500E-04 CL: 9.9988E-01
NBits: 16000 NErrs: 9 BER: 5.6250E-04 CL: 9.9988E-01
NBits: 17600 NErrs: 10 BER: 5.6818E-04 CL: 9.9995E-01
NBits: 19200 NErrs: 12 BER: 6.2500E-04 CL: 9.9999E-01
NBits: 20800 NErrs: 12 BER: 5.7692E-04 CL: 9.9999E-01
NBits: 22400 NErrs: 12 BER: 5.3571E-04 CL: 9.9999E-01
NBits: 24000 NErrs: 14 BER: 5.8333E-04 CL: 1.0000E+00
NBits: 25600 NErrs: 16 BER: 6.2500E-04 CL: 1.0000E+00
NBits: 27200 NErrs: 18 BER: 6.6176E-04 CL: 1.0000E+00
NBits: 28800 NErrs: 18 BER: 6.2500E-04 CL: 1.0000E+00