pub struct Ufmc {
pub n_fft: usize,
pub n_subbands: usize,
pub subband_size: usize,
pub filter_len: usize,
pub sidelobe_db: f64,
pub sample_rate: Hertz,
}Expand description
A UFMC modem (see the module): its fields are its parameters, set by struct update
from Ufmc::default and checked by Ufmc::check (and by the modulator and the
demodulator).
Fields§
§n_fft: usizeSize of the grid and of the IDFT, $N$.
n_subbands: usizeSub-bands $B$.
subband_size: usizeSubcarriers per sub-band, $Q$.
filter_len: usizeTaps of the filters, $L$ (1: plain OFDM without prefix).
sidelobe_db: f64Attenuation of the sidelobes of the Dolph–Chebyshev filters (dB).
sample_rate: HertzThe rate of the samples, $N \Delta f$: the rate of the Signal of Modulate
and the rate Demodulate expects; 1 Hz by default (time in samples).
Implementations§
Source§impl Ufmc
impl Ufmc
Sourcepub fn check(&self) -> Result<()>
pub fn check(&self) -> Result<()>
Check the configuration.
§Errors
comnum_core::Error::Config if the sub-bands do not fit the grid, if the filter has
no tap or is longer than $N + 1$ taps (a symbol must fit the DFT of $2N$ of the
receiver), or for a sample rate that is not positive and finite.
Sourcepub fn subcarrier(&self, i: usize) -> isize
pub fn subcarrier(&self, i: usize) -> isize
The subcarrier index (centred on the carrier) of the active subcarrier i.
Sourcepub fn subband_taps(&self, b: usize) -> Vec<C64> ⓘ
pub fn subband_taps(&self, b: usize) -> Vec<C64> ⓘ
The taps of the filter of sub-band b: the window shifted to the centre of the
sub-band.
Sourcepub fn response(&self, i: usize) -> C64
pub fn response(&self, i: usize) -> C64
The response of the filter of the sub-band of the active subcarrier i at its
frequency, the gain the receiver divides by.
Sourcepub fn modulate(&self, data: &[C64]) -> Result<Vec<C64>>
pub fn modulate(&self, data: &[C64]) -> Result<Vec<C64>>
Modulate the symbols data, $K$ per UFMC symbol.
§Errors
comnum_core::Error::Shape unless data holds whole symbols, and the errors of
Ufmc::check.
Sourcepub fn demodulate(&self, samples: &[C64]) -> Result<Vec<C64>>
pub fn demodulate(&self, samples: &[C64]) -> Result<Vec<C64>>
Demodulate whole symbols: zeros up to $2N$, DFT, the even bins divided by the response of the filters.
§Errors
comnum_core::Error::Shape unless samples holds whole symbols, and the errors
of Ufmc::check.
Trait Implementations§
Source§impl Demodulate for Ufmc
UFMC as a Demodulate block: one stream of samples at Ufmc::sample_rate.
impl Demodulate for Ufmc
UFMC as a Demodulate block: one stream of samples at Ufmc::sample_rate.
Source§fn demodulate_into(&mut self, y: &Signal, out: &mut Symbols) -> Result<()>
fn demodulate_into(&mut self, y: &Signal, out: &mut Symbols) -> Result<()>
§Errors
comnum_core::Error::Config for several streams or a signal at another sample rate,
and the errors of Ufmc::demodulate.
Source§impl Modulate for Ufmc
UFMC as a Modulate block: one stream of symbols into one stream of samples at
Ufmc::sample_rate.
impl Modulate for Ufmc
UFMC as a Modulate block: one stream of symbols into one stream of samples at
Ufmc::sample_rate.