Skip to main content

ber

Function ber 

Source
pub fn ber(kind: ConstellationKind, m: usize, ebn0_db: f64) -> Result<f64>
Expand description

Theoretical bit error rate over AWGN with Gray mapping (OptiCommPy theoryBER).

  • QAM (L = √M): P_b = 2(1 - 1/L)/log2 L · Q(√(3 log2 L/(L²-1) · 2 E_b/N_0));
  • PSK: P_b = 2 Q(√(2 log2 M · E_b/N_0) sin(π/M)) / log2 M, and the exact Q(√(2 E_b/N_0)) for M = 2 (OptiCommPy applies the general formula, which counts two nearest neighbours and doubles the BER of BPSK);
  • PAM: P_b = 2(M-1)/M · Q(√(6 log2 M/(M²-1) · E_b/N_0)) / log2 M.

§Errors

Error::Config for another family, an order that is not a power of two (at least 2), or a QAM that is not square.