Base Modem

Inheritance diagram of hermespy.modem.modem.BaseModem
class BaseModem(encoding=None, waveform=None, frame_generator=None, seed=None)[source]

Bases: Generic[CWT], RandomNode, Serializable

Base class for wireless modems transmitting or receiving information over devices.

Configure a TransmittingModem, ReceivingModem or the convenience wrappers SimplexLink and DuplexModem implementing this abstract interface.

Parameters:
  • encoding (EncoderManager | Sequence[Encoder] | None) – Bit coding configuration. Encodes communication bit frames during transmission and decodes them during reception.

  • waveform (TypeVar(CWT, bound= CommunicationWaveform) | None) – The waveform to be transmitted by this modem.

  • frame_generator (FrameGenerator | None) – Frame generator used to pack and unpack communication frames. If not specified, a stub generator will be assumed.

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

classmethod Deserialize(process)[source]

Deserialize an object’s state.

Objects cannot be deserialized directly, instead a Factory must be instructed to carry out the deserialization process.

Parameters:

process (DeserializationProcess) – The current stage of the deserialization process. This object is generated by the Factory and provides an interface to deserialization methods supporting multiple backends.

Return type:

TypeVar(_BMT, bound= BaseModem)

Returns:

The deserialized object.

frame_duration(bandwidth)[source]

Duration of a single communication frame in seconds.

Parameters:

bandwidth (float) – Target bandwidth of the communication waveform in Hz.

Return type:

float

Convenience wrapper for the waveform frame_duration method.

samples_per_frame(bandwidth, oversampling_factor)[source]

Number of samples required to process at least a single frame.

Convenience wrapper for the waveform's samples_per_frame method.

Parameters:
  • bandwidth (float) – The processed signal’s bandwidth in Hz.

  • oversampling_factor (int) – Factor by which the processed signal is oversampled.

Return type:

int

Returns:

Number of discrete samples.

serialize(process)[source]

Serialize this object’s state.

Objects cannot be serialized directly, instead a Factory must be instructed to carry out the serialization process.

Parameters:

process (SerializationProcess) – The current stage of the serialization process. This object is generated by the Factory and provides an interface to serialization methods supporting multiple backends.

Return type:

None

property encoder_manager: EncoderManager[source]

Description of the modem’s forward error correction.

Refer to EncoderManager for further information.

property frame_generator: FrameGenerator[source]
property waveform: CWT | None[source]

Description of the communication waveform emitted by this modem.

The only mandatory attribute required to transmit or receive over a modem.