Skip to main content

ser_mgf

Function ser_mgf 

Source
pub fn ser_mgf(
    kind: ConstellationKind,
    m: usize,
    mgf: impl Fn(f64) -> f64,
) -> Result<f64>
Expand description

The average SER of m-PSK or square m-QAM over a fading channel whose SNR per symbol $\gamma$ has the moment generating function mgf $(s) = \mathbb{E}, e^{s\gamma}$, $s \le 0$, by the MGF approach with Craig’s form of the $Q$ function (E. Basar et al., “Wireless communications through reconfigurable intelligent surfaces,” IEEE Access, 2019, eqs. (16) and (21)): with $g = \sin^{2}(\pi/M)$,

$$ P_{e}^{\mathrm{PSK}} = \frac{1}{\pi} \int_{0}^{(M-1)\pi/M} M_{\gamma}\Bigl(-\frac{g}{\sin^{2}\eta}\Bigr) d\eta , $$

and with $c = 3/(2(M-1))$ and $q = 1 - 1/\sqrt{M}$,

$$ P_{e}^{\mathrm{QAM}} = \frac{4q}{\pi} \int_{0}^{\pi/2} M_{\gamma}\Bigl(-\frac{c}{\sin^{2}\eta}\Bigr) d\eta - \frac{4q^{2}}{\pi} \int_{0}^{\pi/4} M_{\gamma}\Bigl(-\frac{c}{\sin^{2}\eta}\Bigr) d\eta , $$

by Gauss–Legendre quadrature of 96 nodes on every interval. With the MGF $e^{s\gamma_{0}}$ of a constant SNR, these are the SERs of ser_esn0 over AWGN.

§Errors

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

§Examples

use comnum_mapping::{theory, constellation::ConstellationKind};
// BPSK over Rayleigh fading of mean SNR 10: M(s) = 1/(1 - 10 s)
let p = theory::ser_mgf(ConstellationKind::Psk, 2, |s| 1.0 / (1.0 - 10.0 * s))?;
assert!((p - 0.5 * (1.0 - (10.0f64 / 11.0).sqrt())).abs() < 1e-12);