pub struct Frame {Show 19 fields
pub constellation: Option<Constellation>,
pub pmf: Option<Vec<f64>>,
pub bits: Vec<u8>,
pub indices: Vec<usize>,
pub symbols: Vec<C64>,
pub excluded: Vec<bool>,
pub samples: Vec<C64>,
pub antennas: Vec<Vec<C64>>,
pub sps: f64,
pub symbol_rate: f64,
pub layout: Layout,
pub channel: ChannelState,
pub receiver: ReceiverState,
pub coding: Coding,
pub in_flight: InFlight,
pub capture: CaptureState,
pub trial: u64,
pub values: Vec<(String, f64)>,
pub probes: Record,
}Expand description
The state carried along a link during one trial: what was transmitted, the current samples, and the contexts that some blocks set for the following ones.
Fields§
§constellation: Option<Constellation>The constellation of the source (unit mean energy for uniform symbols).
pmf: Option<Vec<f64>>The probabilities of the points of the constellation (probabilistic shaping);
uniform if None. The rate metrics, the soft demapper and awgn_ebn0 use them.
bits: Vec<u8>Transmitted bits (Gray labels of the constellation, MSB first).
indices: Vec<usize>Transmitted symbol indices.
symbols: Vec<C64>Transmitted symbols (of polarisation x, then y, with two polarisations).
excluded: Vec<bool>Symbols excluded from the metrics (pilots, preambles), one flag per symbol.
samples: Vec<C64>Current samples of antenna (or polarisation) 0.
antennas: Vec<Vec<C64>>The samples of the other antennas or polarisations (1, 2, …); empty for one.
sps: f64Current samples per symbol.
symbol_rate: f64Symbol rate (Bd; 1 for a normalised time axis).
layout: LayoutWhat the streams are: antennas, layers, polarisations.
channel: ChannelStateThe channel of the trial, as a genie-aided receiver knows it.
receiver: ReceiverStateWhat the receiver declares about its outputs.
coding: CodingThe information bits, the LLRs and the decisions of a coded link.
in_flight: InFlightThe frames between a transmitter block and its receiver (OFDM, WDM).
capture: CaptureStateA measured capture.
trial: u64The index of the trial of the condition (set by the runner; 0 outside a campaign), for the blocks that save or label a trial.
values: Vec<(String, f64)>Diagnostic values recorded by the blocks, reported as means.
probes: RecordThe metrics measured by the probe blocks, merged into the results of the trial.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn constellation(&self, block: &str) -> Result<&Constellation>
pub fn constellation(&self, block: &str) -> Result<&Constellation>
The constellation, or an error naming the block that needs it.
§Errors
Error::Config if no source has set the constellation before block.
Sourcepub fn int_sps(&self, block: &str) -> Result<usize>
pub fn int_sps(&self, block: &str) -> Result<usize>
The integer samples per symbol, or an error naming the block.
§Errors
Error::Config unless the signal is aligned at an integer number of samples per symbol.
Sourcepub fn require_one_sps(&self, block: &str) -> Result<()>
pub fn require_one_sps(&self, block: &str) -> Result<()>
Check that the signal is at one sample per symbol: the symbols of a source, or the output of a decimation.
§Errors
Error::Config naming block unless the signal is at one sample per symbol.
Sourcepub fn require_symbols(&self, block: &str) -> Result<()>
pub fn require_symbols(&self, block: &str) -> Result<()>
Check that the samples are at one sample per symbol and aligned on the symbols.
§Errors
Error::Config unless the signal is aligned at one sample per symbol.
Sourcepub fn streams_mut(&mut self) -> impl Iterator<Item = &mut Vec<C64>>
pub fn streams_mut(&mut self) -> impl Iterator<Item = &mut Vec<C64>>
The samples of every antenna, mutable.
Sourcepub fn take_streams(&mut self) -> Vec<Vec<C64>>
pub fn take_streams(&mut self) -> Vec<Vec<C64>>
Take the samples of every antenna, leaving the signal without samples.
Sourcepub fn set_streams(&mut self, streams: Vec<Vec<C64>>)
pub fn set_streams(&mut self, streams: Vec<Vec<C64>>)
Set the samples of every antenna (at least one stream).
Sourcepub fn reference_power(&self) -> f64
pub fn reference_power(&self) -> f64
The reference power of a noise block: the power entering the fading channel if there is one, else the mean power of the samples.
Sourcepub fn mean_power(&self) -> f64
pub fn mean_power(&self) -> f64
Mean power of the samples over every antenna: their energy
(comnum_math::energy) over their number.
Sourcepub fn pooled(&self) -> Cow<'_, Frame>
pub fn pooled(&self) -> Cow<'_, Frame>
The signal with the polarisations of a dual-polarisation channel concatenated
into one stream, aligned on symbols (the signal itself otherwise).
Sourcepub fn symbol_noise(&self, block: &str) -> Result<Vec<f64>>
pub fn symbol_noise(&self, block: &str) -> Result<Vec<f64>>
The noise variance of every symbol the receiver sees: symbol_noise, else the
declared posterior noise_var, else the channel’s noise_var.
§Errors
Error::Config if no block has set the noise variance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
impl UnwindSafe for Frame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more