Skip to main content

Dpsk

Struct Dpsk 

Source
pub struct Dpsk { /* private fields */ }
Expand description

Differential M-PSK with Gray-labelled phase transitions: the differential phase index $k$ carries the label $g(k)$ (comnum_math::gray).

Implementations§

Source§

impl Dpsk

Source

pub fn new(m: usize) -> Result<Dpsk>

Differential PSK of order m.

§Errors

Error::Config unless m is a power of two ≥ 2.

Source

pub fn order(&self) -> usize

The order $M$.

Source

pub fn bits_per_symbol(&self) -> usize

Bits per symbol, $\log_{2} M$.

Source

pub fn indices(&self, bits: &[u8]) -> Result<Vec<usize>>

The differential phase indices of a bit stream (most significant bit first).

§Errors

Error::Shape if the number of bits is not a multiple of $\log_{2} M$.

Source

pub fn bits(&self, indices: &[usize]) -> Result<Vec<u8>>

The bits of a sequence of differential phase indices.

§Errors

Error::Config if an index is not below $M$.

Source

pub fn map_bits(&self, bits: &[u8]) -> Result<Vec<C64>>

The n/log2 M + 1 unit-energy PSK symbols carrying n bits (the reference first).

§Errors

Error::Shape if the number of bits is not a multiple of $\log_{2} M$.

Source

pub fn demap_bits(&self, r: &[C64]) -> Result<Vec<u8>>

Noncoherent demodulation (detect) of n + 1 received symbols into n log2 M bits.

§Errors

Error::Shape for an empty input.

Source

pub fn demodulate_coherent(&self, r: &[C64]) -> Result<Vec<u8>>

Coherent demodulation with differential decoding (detect_coherent then decode) of n + 1 received symbols into n log2 M bits.

§Errors

Error::Shape for an empty input.

Trait Implementations§

Source§

impl Clone for Dpsk

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Dpsk

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Dpsk

Source§

impl PartialEq for Dpsk

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Dpsk

Auto Trait Implementations§

§

impl Forget for Dpsk

§

impl Freeze for Dpsk

§

impl RefUnwindSafe for Dpsk

§

impl Send for Dpsk

§

impl Sync for Dpsk

§

impl Unpin for Dpsk

§

impl UnsafeUnpin for Dpsk

§

impl UnwindSafe for Dpsk

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.