Skip to main content

Ufmc

Struct Ufmc 

Source
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: usize

Size of the grid and of the IDFT, $N$.

§n_subbands: usize

Sub-bands $B$.

§subband_size: usize

Subcarriers per sub-band, $Q$.

§filter_len: usize

Taps of the filters, $L$ (1: plain OFDM without prefix).

§sidelobe_db: f64

Attenuation of the sidelobes of the Dolph–Chebyshev filters (dB).

§sample_rate: Hertz

The 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

Source

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.

Source

pub fn n_active(&self) -> usize

The number of active subcarriers $K = BQ$.

Source

pub fn block_len(&self) -> usize

Samples per symbol, $N + L - 1$.

Source

pub fn subcarrier(&self, i: usize) -> isize

The subcarrier index (centred on the carrier) of the active subcarrier i.

Source

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.

Source

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.

Source

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.

Source

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 Clone for Ufmc

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 Ufmc

Source§

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

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

impl Default for Ufmc

Source§

fn default() -> Ufmc

4 sub-bands of 12 subcarriers on a grid of 64, filtered by Dolph–Chebyshev filters of 16 taps whose sidelobes are 40 dB below their main lobe, at the sample rate 1 Hz (the example of the module).

Source§

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<()>

§Errors

comnum_core::Error::Config for several streams or a signal at another sample rate, and the errors of Ufmc::demodulate.

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 Ufmc

UFMC as a Modulate block: one stream of symbols into one stream of samples at Ufmc::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 Ufmc

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 Ufmc

Auto Trait Implementations§

§

impl Freeze for Ufmc

§

impl RefUnwindSafe for Ufmc

§

impl Send for Ufmc

§

impl Sync for Ufmc

§

impl Unpin for Ufmc

§

impl UnsafeUnpin for Ufmc

§

impl UnwindSafe for Ufmc

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.