Precoding Step Base

class SymbolPrecoder

Bases: abc.ABC

Abstract base class for signal processing algorithms operating on complex data symbols streams.

A symbol precoder represents one coding step of a full symbol precoding configuration. It features the encoding and decoding routines, meant to encode and decode multidimensional symbol streams during transmission and reception, respectively.

Symbol Precoder initialization.

yaml_tag: str
property precoding: hermespy.precoding.symbol_precoding.SymbolPrecoding

Access the precoding configuration this precoder is attached to.

Returns

Handle to the precoding.

Return type

SymbolPrecoding

Raises

RuntimeError – If this precoder is currently floating.

abstract encode(symbol_stream)

Encode a data stream before transmission.

This operation may modify the number of streams as well as the number of data symbols per stream.

Parameters

symbol_stream (np.ndarray) – An MxN matrix of data symbol streams feeding into the precoding step to be encoded. The first matrix dimension M represents the number of streams, the second dimension N the number of discrete data symbols.

Returns

A matrix of M’xN’ encoded data symbol streams. The first matrix dimension M’ represents the number of streams after encoding, the second dimension N’ the number of discrete data symbols after encoding.

Return type

np.ndarray

Raises

NotImplementedError – If an encoding operation is not supported

abstract decode(symbol_stream, channel_state, stream_noises)

Decode a data stream before reception.

This operation may modify the number of streams as well as the number of data symbols per stream.

Parameters
  • symbol_stream (np.ndarray) – An MxN matrix of data symbol streams feeding into the precoding step to be decoded. The first matrix dimension M represents the number of streams, the second dimension N the number of discrete data symbols.

  • channel_state (ChannelStateInformation) – The channel state estimates for each input symbol within input_stream.

  • stream_noises (np.ndarray) – The noise variances for each data symbol within symbol_stream. Identical dimensionality to input_stream.

Returns

A matrix of M’xN’ decoded data symbol streams.

The first matrix dimension M’ represents the number of streams after decoding, the second dimension N’ the number of discrete data symbols after decoding.

ChannelStateInformation:

Updated channel state information after decoding.

np.ndarray:

A matrix of M’xN’ data symbol noise estimations after this decoding step.

Return type

np.ndarray

Raises

NotImplementedError – If a decoding operation is not supported

abstract property num_input_streams: int

Required number of input symbol streams for encoding / number of resulting output streams after decoding.

Returns

The number of symbol streams.

Return type

int

abstract property num_output_streams: int

Required number of input symbol streams for decoding / number of resulting output streams after encoding.

Returns

The number of symbol streams.

Return type

int

property required_num_output_streams: int

Number of output streams required by the precoding configuration.

Returns

Required number of output streams.

Return type

int

Raises

RuntimeError – If precoder is not attached to a precoding configuration.

property required_num_input_streams: int

Number of input streams required by the precoding configuration.

Returns

Required number of input streams.

Return type

int

Raises

RuntimeError – If precoder is not attached to a precoding configuration.

property rate: fractions.Fraction

Rate between input symbol slots and output symbol slots.

For example, a rate of one indicates that no symbols are getting added or removed during precoding.

Returns

The precoding rate.

Return type

Fraction

classmethod to_yaml(representer, node)

Serialize an SymbolPrecoder object to YAML.

Parameters
  • representer (SafeRepresenter) – A handle to a representer used to generate valid YAML code. The representer gets passed down the serialization tree to each node.

  • node (SymbolPrecoder) – The SymbolPrecoder instance to be serialized.

Returns

The serialized YAML node

Return type

Node

classmethod from_yaml(constructor, node)

Recall a new SymbolPrecoder instance from YAML.

Parameters
  • constructor (SafeConstructor) – A handle to the constructor extracting the YAML information.

  • node (Node) – YAML node representing the SymbolPrecoder serialization.

Returns

Newly created SymbolPrecoder instance.

Return type

SymbolPrecoder