Modem

Within HermesPy, the Modem class represents the full signal processing chain configuration for the transmission of information in form of bits. Modems are a form of hermespy.core.device.DuplexOperator, binding to both the transmitter and receiver slot of hermespy.core.device.Device objects. In other words, they both transmit and receive complex waveforms over the devices. It acts as a managing container for 5 signal processing step abstractions:

Processing Step

Description

BitsSource

Source of data bits to be transmitted

EncoderManager

Channel coding pipeline configuration

WaveformGenerator

Communication waveform configuration

StreamCoding

Precoding configuration

%%{init: {'theme': 'dark'}}%% flowchart LR subgraph Modem direction LR subgraph BitSource direction TB Bits end subgraph BitCoding direction TB BitEncoding[Encoding] BitDecoding[Decoding] end subgraph Waveform Mapping --> Modulation ChannelEstimation[Channel Estimation] Synchronization Unmapping --- Demodulation end subgraph StreamCoding StreamEncoding[Encoding] StreamDecoding[Decoding] end subgraph BeamForming TxBeamform[Tx Beamforming] RxBeamform[Rx Beamforming] end Bits --> BitEncoding BitEncoding --> Mapping Modulation --> StreamEncoding StreamEncoding --> TxBeamform StreamDecoding --> RxBeamform Demodulation --- StreamDecoding Synchronization --- StreamDecoding ChannelEstimation --- StreamEncoding ChannelEstimation --- StreamDecoding BitDecoding --- Unmapping end subgraph Device direction TB txslot>Tx Slot] rxslot>Rx Slot] end txsignal{{Tx Signal Model}} txbits{{Tx Bits}} txsymbols{{Tx Symbols}} rxsignal{{Rx Signal Model}} rxbits{{Rx Bits}} rxsymbols{{Rx Symbols}} TxBeamform --> txsignal RxBeamform --> rxsignal txsignal --> txslot rxsignal --> rxslot Bits --> txbits Mapping --> txsymbols BitDecoding --> rxbits Unmapping --> rxsymbols

Modem Signal Processing Chain

%%{init: {'theme': 'dark'}}%% flowchart LR subgraph Modem direction LR subgraph BitSource direction TB Random([RandomSource]) === Stream([StreamSource]) end subgraph BitCoding direction TB LDPC[/LDPC/] Interleaving[/Block-Interleaving/] CRC[/CRC/] Repetition[/Repetition/] Scrambler3G[/3GPP Scrambling/] Scrambler80211a[/802.11a Scrambling/] LDPC === Interleaving Interleaving === CRC CRC === Repetition Repetition === Scrambler3G Scrambler3G === Scrambler80211a end subgraph Waveform direction TB FSK([FSK]) OFDM([OFDM]) GFDM([GFDM]) QAM([QAM]) FSK === OFDM OFDM === GFDM GFDM === QAM end subgraph StreamCoding direction TB SC[/Single Carrier/] SM[/Spatial Multiplexing/] DFT[/DFT/] STBC[/STBC/] MRC[/Maximum Ratio Combining/] SC === SM === DFT === STBC === MRC end subgraph BeamForming direction TB Conventional[/Conventional/] end BitSource ===> BitCoding BitCoding <===> Waveform Waveform <===> StreamCoding StreamCoding <===> BeamForming end linkStyle 0 display: None linkStyle 1 display: None linkStyle 2 display: None linkStyle 3 display: None linkStyle 4 display: None linkStyle 5 display: None linkStyle 6 display: None linkStyle 7 display: None linkStyle 8 display: None linkStyle 9 display: None linkStyle 10 display: None linkStyle 11 display: None linkStyle 12 display: None linkStyle 11 display: None
class Modem(encoding=None, precoding=None, waveform=None, seed=None)

Bases: hermespy.core.random_node.RandomNode, hermespy.core.device.DuplexOperator, hermespy.core.factory.SerializableArray

HermesPy representation of a wireless communication modem.

Modems may transmit or receive information in form of bit streams.

In HermesPy, a modem is the basis of every simulation entity which may transmit or receive electromagnetic waveforms.

The modem consists of an analog RF chain, a waveform generator, and can be used either for transmission or reception of a given technology.

Parameters
  • encoding (EncoderManager, optional) – Bit coding configuration. Encodes communication bit frames during transmission and decodes them during reception.

  • precoding (SymbolPrecoding, optional) – Modulation symbol coding configuration.

  • waveform (WaveformGenerator, optional) – The waveform to be transmitted by this modem.

  • seed (int, optional) – Seed used to initialize the pseudo-random number generator.

yaml_tag: Optional[str] = 'Modem'

YAML serialization tag.

transmit(duration=0.0)

Returns an array with the complex base-band samples of a waveform generator.

The signal may be distorted by RF impairments.

Parameters

duration (float, optional) – Length of signal in seconds.

Returns

signal (Signal):

Signal model carrying the data_bits in multiple streams, each stream encoding multiple radio frequency band communication frames.

symbols (Symbols):

Symbols to which data_bits were mapped, used to modulate signal.

data_bits (np.ndarray):

Vector of bits mapped to data_symbols.

Return type

transmissions (tuple)

property transmitted_bits: numpy.ndarray

Recently transmitted data bits.

Returns

Numpy array of recently transmitted data bits.

Return type

np.ndarray

property transmitted_symbols: hermespy.modem.symbols.Symbols

Recently transmitted modulation symbols.

Returns

Recently transmitted symbol series.

Return type

Symbols

receive()
Return type

Tuple[Signal, Symbols, ndarray]

property received_bits: numpy.ndarray

Recently received data bits.

Returns

Numpy array of recently received data bits.

Return type

np.ndarray

property received_symbols: hermespy.modem.symbols.Symbols

Recently received modulation symbols.

Returns

Recently received symbol series.

Return type

Symbols

property num_streams: int

The number of data streams handled by the modem.

The number of data streams is always less or equal to the number of available antennas num_antennas.

Returns

The number of data streams generated by the modem.

Return type

int

property bits_source: hermespy.modem.bits_source.BitsSource

Source of bits transmitted over the modem.

Returns

Handle to the bits source.

Return type

bits_source (BitsSource)

property encoder_manager: hermespy.coding.coding.EncoderManager

Access the modem’s encoder management.

Returns

Handle to the modem’s encoder instance.

Return type

EncoderManager

property waveform_generator: hermespy.modem.waveform_generator.WaveformGenerator

Communication waveform emitted by this modem.

Returns

Handle to the modem’s WaveformGenerator instance.

Return type

WaveformGenerator

property precoding: hermespy.precoding.symbol_precoding.SymbolPrecoding

Access this modem’s precoding configuration.

Returns

Handle to the configuration.

Return type

SymbolPrecoding

property num_data_bits_per_frame: int

Compute the number of required data bits to generate a single frame.

Returns

The number of data bits.

Return type

int

property frame_duration: float
Return type

float

property sampling_rate: float
Return type

float

property energy: float

Average energy of the transmitted and received signal.

Returns

Energy.

Return type

flot

generate_data_bits()

Generate data bits required to build a single transmit data frame for this modem.

Returns

A vector of hard data bits in 0/1 format.

Return type

numpy.ndarray

classmethod to_yaml(representer, node)

Serialize a Modem object to YAML.

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

  • node (Modem) – The Device instance to be serialized.

Returns

The serialized YAML node.

Return type

MappingNode

classmethod from_yaml(constructor, node)

Recall a new Modem class instance from YAML.

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

  • node (MappingNode) – YAML node representing the Modem serialization.

Returns

Newly created serializable instance.

Return type

Modem