comnum.theory_ber#

comnum.theory_ber(m, ebn0_db, kind='qam')#

Theoretical BER over AWGN with Gray mapping (OptiCommPy theoryBER, exact for BPSK).

Parameters:
  • m (int) – order.

  • ebn0_db (float | array_like) – E_b/N_0 (dB).

  • kind (str) – "qam", "psk" or "pam".

Returns:

the bit error probability at every E_b/N_0.

Return type:

float | numpy.ndarray

Raises:

ValueError – for an invalid parameter or input (the message names it).

Examples

>>> import comnum
>>> round(comnum.theory_ber(4, 0.0), 6)
0.07865
>>> comnum.theory_ber(16, [8.0, 12.0], "qam").shape
(2,)