pub struct Gamp {
pub iterations: usize,
pub damping: f64,
pub points: usize,
}Expand description
The GAMP receiver (see the module).
Fields§
§iterations: usizeIterations per block.
damping: f64Damping factor $\beta \in (0, 1]$ (1: no damping).
points: usizePoints of the midpoint rule of the output step.
Implementations§
Source§impl Gamp
impl Gamp
Sourcepub fn detect(
&self,
ce: &CeOfdm,
r: &[C64],
c: &Constellation,
noise_var: f64,
) -> Result<Vec<C64>>
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§
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> 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