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: usizeResource blocks $N_{\mathrm{RB}}$.
n_fft: usizeFFT size $N_{\mathrm{FFT}}$ (a multiple of 128, above $K$).
first_symbol: usizeThe position in the subframe (0 to 13) of the first OFDM symbol of the grid.
Implementations§
Source§impl Carrier
impl Carrier
Sourcepub fn new(n_rb: usize, n_fft: usize) -> Result<Carrier>
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$.
Sourcepub fn n_subcarriers(&self) -> usize
pub fn n_subcarriers(&self) -> usize
Subcarriers $K$ of the grid.
Sourcepub fn modulate(&self, grid: &[C64]) -> Result<Vec<C64>>
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.
Sourcepub fn demodulate(&self, samples: &[C64]) -> Result<Vec<C64>>
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.
Sourcepub fn prefix(&self, l: usize) -> usize
pub fn prefix(&self, l: usize) -> usize
The prefix of the symbol l of the subframe (0 to 13), in samples.
Sourcepub fn sample_rate(&self) -> f64
pub fn sample_rate(&self) -> f64
The sampling rate $N_{\mathrm{FFT}} \cdot 15$ kHz (Hz).