pub struct Fbmc { /* private fields */ }Expand description
An FBMC/OQAM modem (see the module).
Implementations§
Source§impl Fbmc
impl Fbmc
Sourcepub fn new(n_fft: usize, overlap: usize) -> Result<Fbmc>
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.
Sourcepub fn with_sample_rate(self, sample_rate: Hertz) -> Result<Fbmc>
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));Sourcepub fn sample_rate(&self) -> Hertz
pub fn sample_rate(&self) -> Hertz
The sample rate of the modem.
Sourcepub fn n_samples(&self, half_symbols: usize) -> usize
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$.
Sourcepub fn half_symbols(&self, n_samples: usize) -> Result<usize>
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.
Sourcepub fn pulse(&self, m: usize, n: usize) -> (usize, Vec<C64>)
pub fn pulse(&self, m: usize, n: usize) -> (usize, Vec<C64>)
The pulse $g_{m,n}$ on its support: (first sample, values).
Sourcepub fn interference(&self, m: usize, n: usize, dm: isize, dn: isize) -> C64
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.
Sourcepub fn modulate(&self, a: &[f64]) -> Result<Vec<C64>>
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.
Sourcepub fn demodulate(&self, r: &[C64]) -> Result<Vec<C64>>
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 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.
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<()>
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§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.
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.