Skip to main content

Module signal

Module signal 

Source
Expand description

Multi-stream containers: bits, log-likelihood ratios, symbols, labels and waveforms.

Every container is two-dimensional, streams × elements, in standard (row-major) layout; SISO is n_streams == 1. MIMO, polarisation multiplexing and space-division multiplexing therefore reuse the same blocks. DualPol, the two polarisations of an optical field as two vectors, is kept for the slice-based optical blocks.

§Model

The sign convention of the log-likelihood ratios is fixed library-wide: a positive LLR favours the bit 0,

$$ L(b) = \ln \frac{P(b = 0 \mid y)}{P(b = 1 \mid y)} $$

§Examples

use comnum_core::signal::{Bits, Signal};
use comnum_core::units::Hertz;
let b = Bits::from_stream(vec![0, 1, 1, 0]).unwrap();
assert_eq!((b.n_streams(), b.len()), (1, 4));
let s = Signal::zeros(2, 1024, Hertz(64e9));
assert_eq!((s.n_streams(), s.len()), (2, 1024));
assert_eq!(s.stream(1).len(), 1024);

Structs§

Bits
Hard bits, one row per stream; the values are 0 or 1.
DualPol
A field in two polarisations, x and y, of equal length.
Labels
The labels of symbols, one row per stream: the index $a \in \{0, \dots, M - 1\}$ of every symbol of an alphabet of $M$ (a chirp of chirp spread spectrum, a level of continuous-phase modulation, a point of a constellation), the input and the decisions of the waveforms that carry an index (Modulate<Labels>).
Llr
Log-likelihood ratios, one row per stream (positive favours 0, see the module documentation).
Signal
A complex baseband waveform, [n_streams, n_samples], with its sample rate.
Symbols
Complex symbols at one sample per symbol, one row per stream.

Constants§

KNOWN_BIT_LLR
The magnitude of the LLR of a bit taken as known: $+30$ for a known 0 (a filler or shortened bit of a rate matching), $\pm 30$ for a decision whose counter-hypothesis left a tree search; $e^{-30} \approx 10^{-13}$, a probability no channel output reaches, and small enough for the check-node products of the decoders.

Functions§

hard_decisions
The hard decisions of log-likelihood ratios: a negative LLR is a 1, any other a 0 (see the module for the sign convention).