#[non_exhaustive]pub enum Companding {
MuLaw {
mu: f64,
peak_db: f64,
},
Exponential {
degree: f64,
},
}Expand description
Companding of the envelope at the transmitter and expansion at the receiver; the compressed signal keeps the unit average power.
The expansion is exact without noise but amplifies the noise where the law is flat: the exponential law of degree 2 squeezes every amplitude above about twice the RMS into a narrow range below its maximum, and expanding them multiplies the noise by 20 to 150 — an error floor. A receiver can instead skip the expansion and treat the compression as a distortion (Bussgang gain plus noise), as for clipping.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MuLaw
μ-law (Wang, Tjhung & Ng 1999): $c(r) = V \ln(1 + \mu r/V) / \ln(1 + \mu)$, with
$V$ at peak_db above the average power, times the gain that keeps the unit
average power of a Rayleigh envelope. The gain is computed once per block, by a
64-point Gauss–Legendre rule within $10^{-13}$ (relative) of its integral for
$\mu/V \le 10^{5}$.
Fields
Exponential
Exponential companding (Jiang, Yang & Song 2005): $c(r) = \left[\alpha (1 - e^{-r^{2}})\right]^{1/d}$ with $\alpha = ((d + 2)/d)^{d/2}$, which turns the Rayleigh envelope into one of fixed distribution (uniform power for $d = 2$, a PAPR of 3 dB).
Implementations§
Source§impl Companding
impl Companding
Sourcepub fn compress(&self, r: f64) -> f64
pub fn compress(&self, r: f64) -> f64
Compress an envelope. Each call computes the normalisation of the μ-law (64
points); PaprReduction::reduce computes it once per block.
Sourcepub fn expand(&self, r: f64) -> f64
pub fn expand(&self, r: f64) -> f64
Expand an envelope (the inverse of Companding::compress).