comnum.Frame#

class comnum.Frame#

The state carried along a link during one trial: the current samples and what the metrics need (the transmitted bits, symbol indices and symbols, the constellation). Python blocks read and write samples (and sps); the other fields are set by the source.

Examples

>>> import comnum
>>> f = comnum.Frame()
>>> f.samples = [1, -1]
>>> f.samples.dtype, f.n_streams
(dtype('complex128'), 1)
copy()#

A copy of the frame.

Returns:

an independent copy.

Return type:

Frame

record(name, value)#

Record a diagnostic value (reported as a mean by the runners).

Parameters:
  • name (str) – the name of the metric.

  • value (float) – the value.

constellation#

The constellation of the source (unit energy), if any.

Type:

Constellation | None

decoded#

Information bits decided by the decoder (uint8).

Type:

numpy.ndarray

llr#

bit 0).

Type:

numpy.ndarray

Type:

Bit LLRs of the demapper or the detector (positive

n_blocks#

Coded blocks per trial.

Type:

int

n_streams#

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

Type:

int

noise_var#

Noise variance per sample added by the channel blocks, if any.

Type:

float | None

payload#

Information bits of the coded blocks (uint8).

Type:

numpy.ndarray

samples#

Current samples of antenna 0 (complex128; read and write).

Type:

numpy.ndarray

sps#

Samples per symbol (read and write).

Type:

float

streams#

The samples of every antenna (antenna 0 is samples).

Type:

list[numpy.ndarray]

symbol_noise#

Noise variance of every received symbol after equalisation or detection (float64).

Type:

numpy.ndarray

symbol_rate#

Symbol rate (Bd).

Type:

float

trial#

The index of the trial of the condition (set by the runners; 0 outside a campaign), for the blocks that save or label a trial (read and write).

Type:

int

tx_bits#

Transmitted bits (uint8).

Type:

numpy.ndarray

tx_indices#

Transmitted symbol indices (int64).

Type:

numpy.ndarray

tx_symbols#

Transmitted symbols (complex128).

Type:

numpy.ndarray

values#

Diagnostic values recorded by the blocks.

Type:

list[tuple[str, float]]