pub struct Constellation { /* private fields */ }Expand description
A symbol constellation with a bit labelling.
Implementations§
Source§impl Constellation
impl Constellation
Sourcepub fn bpsk() -> Constellation
pub fn bpsk() -> Constellation
Binary phase-shift keying: bit 0 → +1, bit 1 → −1.
Sourcepub fn qpsk() -> Constellation
pub fn qpsk() -> Constellation
Quadrature PSK with Gray labelling (the same constellation as 4-QAM).
Sourcepub fn psk(m: usize) -> Result<Constellation, ErrorsJSL>
pub fn psk(m: usize) -> Result<Constellation, ErrorsJSL>
m-ary PSK (m a power of two, at least 2) on the unit circle with Gray labelling:
symbol k sits at angle 2πk/m.
Sourcepub fn qam(m: usize) -> Result<Constellation, ErrorsJSL>
pub fn qam(m: usize) -> Result<Constellation, ErrorsJSL>
Square m-QAM (m = 4, 16, 64, 256 or 1024) with independent Gray-coded PAM on the I and Q
axes: the first half of the bits label I, the second half label Q.
pub fn bits_per_symbol(&self) -> usize
Sourcepub fn average_power(&self) -> f64
pub fn average_power(&self) -> f64
Mean symbol energy (1 by construction).
Sourcepub fn min_distance(&self) -> f64
pub fn min_distance(&self) -> f64
Smallest distance between two distinct symbols.
Sourcepub fn map_bits(&self, bits: &[u8]) -> Result<Vec<Complex<f64>>, ErrorsJSL>
pub fn map_bits(&self, bits: &[u8]) -> Result<Vec<Complex<f64>>, ErrorsJSL>
Maps bits (each 0 or 1, MSB first within a symbol) to symbols; the bit count must be a
multiple of bits_per_symbol.
Sourcepub fn nearest(&self, sample: Complex<f64>) -> usize
pub fn nearest(&self, sample: Complex<f64>) -> usize
The label of the symbol nearest to sample.
Sourcepub fn slice(&self, sample: Complex<f64>) -> Complex<f64>
pub fn slice(&self, sample: Complex<f64>) -> Complex<f64>
The symbol nearest to sample (a slicer).
Trait Implementations§
Source§impl Clone for Constellation
impl Clone for Constellation
Source§impl Debug for Constellation
impl Debug for Constellation
Source§impl PartialEq for Constellation
impl PartialEq for Constellation
impl StructuralPartialEq for Constellation
Auto Trait Implementations§
impl Freeze for Constellation
impl RefUnwindSafe for Constellation
impl Send for Constellation
impl Sync for Constellation
impl Unpin for Constellation
impl UnsafeUnpin for Constellation
impl UnwindSafe for Constellation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more