Skip to main content

Gamp

Struct Gamp 

Source
pub struct Gamp {
    pub iterations: usize,
    pub damping: f64,
    pub points: usize,
}
Expand description

The GAMP receiver (see the module).

Fields§

§iterations: usize

Iterations per block.

§damping: f64

Damping factor $\beta \in (0, 1]$ (1: no damping).

§points: usize

Points of the midpoint rule of the output step.

Implementations§

Source§

impl Gamp

Source

pub fn detect( &self, ce: &CeOfdm, r: &[C64], c: &Constellation, noise_var: f64, ) -> Result<Vec<C64>>

The posterior means of the data symbols of every block (prefix removed) of the received samples r, for symbols of the constellation c (as transmitted) and the noise variance per sample noise_var (CeOfdm::noise_variance).

§Errors

comnum_core::Error::Config for invalid parameters or a constellation whose real and imaginary parts are not independent, comnum_core::Error::Shape for a number of samples that is not a multiple of N + N_cp.

§Examples
use comnum_waveform::ce_ofdm::{CeOfdm, gamp::Gamp};
use comnum_mapping::constellation::Constellation;
use comnum_core::rng::Rng;
// 2πh = 1.4: the phase leaves (-π, π] and the arctangent receiver fails
let ce = CeOfdm::new(63, 4, 1.4 / std::f64::consts::TAU).unwrap();
let c = Constellation::qam(4).unwrap().normalized();
let (_, d) = comnum_mapping::source::symbols(&c, 63, None, &mut Rng::new(1)).unwrap();
let r = ce.modulate(&d).unwrap();
let e = Gamp::default().detect(&ce, &r, &c, 1e-4).unwrap();
assert_eq!(c.decide(&e), c.decide(&d));

Trait Implementations§

Source§

impl Clone for Gamp

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 Gamp

Source§

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

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

impl Default for Gamp

Source§

fn default() -> Gamp

50 iterations (as the paper), a damping of 0.5 and 64 points.

Source§

impl PartialEq for Gamp

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 Gamp

Auto Trait Implementations§

§

impl Forget for Gamp

§

impl Freeze for Gamp

§

impl RefUnwindSafe for Gamp

§

impl Send for Gamp

§

impl Sync for Gamp

§

impl Unpin for Gamp

§

impl UnsafeUnpin for Gamp

§

impl UnwindSafe for Gamp

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.