Skip to main content

Demapping

Struct Demapping 

Source
pub struct Demapping<'a> {
    pub log_priors: Option<&'a [f64]>,
    pub jacobian: Jacobian,
}
Expand description

The a priori information and the approximation of a soft demapper (Demap::demap_with_into). With the log-priors $\lambda_{x} = \ln P(x)$ of the points $x$ of the alphabet and the variance $\sigma^{2}$ of the complex noise, the LLR of a bit of the received symbol $y$ is

$$ L(b) = \ln \sum_{x:\, b = 0} e^{\lambda_{x} - |y - x|^{2} / \sigma^{2}} - \ln \sum_{x:\, b = 1} e^{\lambda_{x} - |y - x|^{2} / \sigma^{2}}, $$

each sum exact or max-log by Demapping::jacobian. A constant added to every $\lambda_{x}$ cancels, so the log-priors need not be normalised. The default, uniform priors and the exact logarithm, is that of Demap::demap_into.

§Examples

use comnum_core::traits::{Demapping, Jacobian};
let lp = [-0.5f64, -1.5];
let d = Demapping { log_priors: Some(&lp), jacobian: Jacobian::MaxLog };
assert_eq!(Demapping::default(), Demapping { log_priors: None, jacobian: Jacobian::Exact });
assert_ne!(d, Demapping::default());

Fields§

§log_priors: Option<&'a [f64]>

The a priori log-probabilities $\ln P(x)$, one per point in the order of the labels (probabilistic shaping); None for uniform priors, which need no table.

§jacobian: Jacobian

The Jacobian logarithm of the sums over the labels: exact or max-log.

Trait Implementations§

Source§

impl<'a> Clone for Demapping<'a>

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<'a> Copy for Demapping<'a>

Source§

impl<'a> Debug for Demapping<'a>

Source§

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

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

impl<'a> Default for Demapping<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> PartialEq for Demapping<'a>

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<'a> StructuralPartialEq for Demapping<'a>

Auto Trait Implementations§

§

impl<'a> Forget for Demapping<'a>

§

impl<'a> Freeze for Demapping<'a>

§

impl<'a> RefUnwindSafe for Demapping<'a>

§

impl<'a> Send for Demapping<'a>

§

impl<'a> Sync for Demapping<'a>

§

impl<'a> Unpin for Demapping<'a>

§

impl<'a> UnsafeUnpin for Demapping<'a>

§

impl<'a> UnwindSafe for Demapping<'a>

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.