Skip to main content

ber_exact

Function ber_exact 

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

The exact bit error rate of a Gray-labelled constellation over AWGN, as a function of $E_{b}/N_{0}$ (dB), where a closed form exists: ber_gray_pam for PAM, ber_gray_qam for square QAM (Cho and Yoon 2002), and ber for BPSK and QPSK, whose nearest-neighbour expression is exact.

§Errors

Error::Config for another constellation (8-PSK and beyond, OOK, rectangular QAM: see ber and ber_gray_rect_qam).

§Examples

use comnum_mapping::{theory, constellation::ConstellationKind};
let qam = theory::ber_exact(ConstellationKind::Qam, 16, 10.0).unwrap();
assert!((qam - theory::ber_gray_qam(16, 10.0).unwrap()).abs() < 1e-15);
assert!(theory::ber_exact(ConstellationKind::Psk, 8, 10.0).is_err());