Skip to main content

Carrier

Struct Carrier 

Source
pub struct Carrier {
    pub n_rb: usize,
    pub n_fft: usize,
    pub first_symbol: usize,
}
Expand description

A downlink carrier: the grid of $K = 12 N_{\mathrm{RB}}$ subcarriers and its OFDM modulator at $N_{\mathrm{FFT}} \cdot 15$ kHz, with the empty DC subcarrier and the normal prefixes of every symbol of the subframe (see the module).

Fields§

§n_rb: usize

Resource blocks $N_{\mathrm{RB}}$.

§n_fft: usize

FFT size $N_{\mathrm{FFT}}$ (a multiple of 128, above $K$).

§first_symbol: usize

The position in the subframe (0 to 13) of the first OFDM symbol of the grid.

Implementations§

Source§

impl Carrier

Source

pub fn new(n_rb: usize, n_fft: usize) -> Result<Carrier>

The carrier of n_rb resource blocks and an FFT of n_fft, its grid starting with the first symbol of a subframe.

§Errors

Error::Config for a number of resource blocks outside 6 to 110 or an FFT size that is not a multiple of 128 above $K + 1$.

Source

pub fn n_subcarriers(&self) -> usize

Subcarriers $K$ of the grid.

Source

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

OFDM-modulate a grid (grid[l * K + k] for subcarrier k of symbol l), every symbol with the prefix of its position in the subframe.

§Errors

The errors of Carrier::new; Error::Shape for a grid that is not a whole number of symbols.

Source

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

The grid of the samples of whole OFDM symbols, their prefixes removed: the inverse of Carrier::modulate.

§Errors

The errors of Carrier::new; Error::Shape if the samples do not end with a whole symbol.

Source

pub fn prefix(&self, l: usize) -> usize

The prefix of the symbol l of the subframe (0 to 13), in samples.

Source

pub fn slot_len(&self) -> usize

Samples of a slot, $15360 N_{\mathrm{FFT}}/2048$ (0.5 ms).

Source

pub fn sample_rate(&self) -> f64

The sampling rate $N_{\mathrm{FFT}} \cdot 15$ kHz (Hz).

Trait Implementations§

Source§

impl Clone for Carrier

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 Copy for Carrier

Source§

impl Debug for Carrier

Source§

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

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

impl Eq for Carrier

Source§

impl PartialEq for Carrier

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 Carrier

Auto Trait Implementations§

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.