Skip to main content

Frame

Struct Frame 

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

Current samples per symbol.

§symbol_rate: f64

Symbol rate (Bd; 1 for a normalised time axis).

§layout: Layout

What the streams are: antennas, layers, polarisations.

§channel: ChannelState

The channel of the trial, as a genie-aided receiver knows it.

§receiver: ReceiverState

What the receiver declares about its outputs.

§coding: Coding

The information bits, the LLRs and the decisions of a coded link.

§in_flight: InFlight

The frames between a transmitter block and its receiver (OFDM, WDM).

§capture: CaptureState

A measured capture.

§trial: u64

The 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: Record

The metrics measured by the probe blocks, merged into the results of the trial.

Implementations§

Source§

impl Frame

Source

pub fn fs(&self) -> f64

Sampling rate symbol_rate · sps (Hz).

Source

pub fn n_symbols(&self) -> usize

Number of transmitted symbols.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn record(&mut self, label: &str, name: &str, value: f64)

Record a diagnostic value.

Source

pub fn n_streams(&self) -> usize

Number of antenna streams (1 for a single antenna).

Source

pub fn streams(&self) -> impl Iterator<Item = &Vec<C64>>

The samples of every antenna.

Source

pub fn streams_mut(&mut self) -> impl Iterator<Item = &mut Vec<C64>>

The samples of every antenna, mutable.

Source

pub fn take_streams(&mut self) -> Vec<Vec<C64>>

Take the samples of every antenna, leaving the signal without samples.

Source

pub fn set_streams(&mut self, streams: Vec<Vec<C64>>)

Set the samples of every antenna (at least one stream).

Source

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.

Source

pub fn mean_power(&self) -> f64

Mean power of the samples over every antenna: their energy (comnum_math::energy) over their number.

Source

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

Source

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§

Source§

impl Clone for Frame

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 Frame

Source§

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

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

impl Default for Frame

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.