Skip to main content

Fbmc

Struct Fbmc 

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

An FBMC/OQAM modem (see the module).

Implementations§

Source§

impl Fbmc

Source

pub fn new(n_fft: usize, overlap: usize) -> Result<Fbmc>

n_fft subcarriers $M$ (even) with the PHYDYAS prototype of overlapping factor overlap, at the sample rate 1 Hz (Fbmc::with_sample_rate). The prototype is sampled once here: the fields are read through getters.

§Errors

Error::Config for an odd or zero number of subcarriers or an unknown overlapping factor.

Source

pub fn with_prototype( n_fft: usize, overlap: usize, prototype: Prototype, ) -> Result<Fbmc>

Fbmc::new with another prototype.

§Errors

As Fbmc::new.

Source

pub fn with_sample_rate(self, sample_rate: Hertz) -> Result<Fbmc>

The modem at the sample rate sample_rate ($M \Delta f$), the rate of the Signal of Modulate and the rate Demodulate expects.

§Errors

Error::Config for a rate that is not positive and finite.

§Examples
use comnum_waveform::fbmc::Fbmc;
use comnum_core::units::Hertz;
let f = Fbmc::new(64, 4)?.with_sample_rate(Hertz(64.0 * 15e3))?;
assert_eq!(f.sample_rate(), Hertz(960e3));
Source

pub fn sample_rate(&self) -> Hertz

The sample rate of the modem.

Source

pub fn n_fft(&self) -> usize

The number of subcarriers $M$.

Source

pub fn overlap(&self) -> usize

The overlapping factor $K$.

Source

pub fn taps(&self) -> &[f64]

The prototype filter (unit energy, $KM - 1$ taps).

Source

pub fn n_samples(&self, half_symbols: usize) -> usize

The number of samples of half_symbols real symbols per subcarrier: $(n - 1) M/2 + L$.

Source

pub fn half_symbols(&self, n_samples: usize) -> Result<usize>

The number of half-symbols of a signal of n_samples samples, the inverse of Fbmc::n_samples.

§Errors

Error::Shape if no whole number of half-symbols has this length.

Source

pub fn pulse(&self, m: usize, n: usize) -> (usize, Vec<C64>)

The pulse $g_{m,n}$ on its support: (first sample, values).

Source

pub fn interference(&self, m: usize, n: usize, dm: isize, dn: isize) -> C64

The intrinsic interference $\langle g_{m+\Delta m, n+\Delta n}, g_{m,n} \rangle = \sum_{k} g_{m+\Delta m,n+\Delta n}[k], g_{m,n}^{*}[k]$ that the symbol $(m + \Delta m, n + \Delta n)$ leaves on the estimate of $(m, n)$: 1 for $\Delta m = \Delta n = 0$, purely imaginary otherwise (Bouhadda et al. 2014, eq. (7) and Table 1). The subcarrier index is taken modulo $M$; pulses $|\Delta n| \ge 2K$ half-symbols apart do not overlap and give 0.

Source

pub fn modulate(&self, a: &[f64]) -> Result<Vec<C64>>

Modulate real symbols a laid out half-symbol after half-symbol, a[n * M + m].

§Errors

Error::Shape unless a holds whole half-symbols.

Source

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

Project r, the Fbmc::n_samples of a whole number of half-symbols, on every pulse: $y_{m,n} = \langle r, g_{m,n} \rangle$, laid out y[n * M + m]; the real parts estimate the symbols, the imaginary parts hold the intrinsic interference.

§Errors

As Fbmc::half_symbols of the length of r.

Trait Implementations§

Source§

impl Clone for Fbmc

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 Fbmc

Source§

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

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

impl Demodulate for Fbmc

FBMC/OQAM as a Demodulate block: the complex symbols of the real parts of the projections (oqam_destagger), the intrinsic interference dropped.

Source§

fn demodulate_into(&mut self, y: &Signal, out: &mut Symbols) -> Result<()>

§Errors

Error::Config for several streams or a signal at another sample rate; the errors of Fbmc::demodulate and of oqam_destagger (an odd number of half-symbols).

Source§

fn demodulate(&mut self, y: &Signal) -> Result<Out, Error>
where Out: Default,

Demodulate y (allocates, calls Demodulate::demodulate_into). Read more
Source§

impl Modulate for Fbmc

FBMC/OQAM as a Modulate block: one stream of complex symbols, M per symbol ($c[k M + m]$), staggered into real symbols (oqam_stagger) and modulated at Fbmc::sample_rate.

Source§

fn modulate_into(&self, x: &Symbols, out: &mut Signal) -> Result<()>

Modulate x into out. Read more
Source§

fn modulate(&self, x: &In) -> Result<Signal, Error>

Modulate x (allocates, calls Modulate::modulate_into). Read more
Source§

impl PartialEq for Fbmc

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 Fbmc

Auto Trait Implementations§

§

impl Forget for Fbmc

§

impl Freeze for Fbmc

§

impl RefUnwindSafe for Fbmc

§

impl Send for Fbmc

§

impl Sync for Fbmc

§

impl Unpin for Fbmc

§

impl UnsafeUnpin for Fbmc

§

impl UnwindSafe for Fbmc

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.