Waveform

Inheritance diagram of hermespy.modem.waveforms.orthogonal.waveform.OrthogonalWaveform, hermespy.modem.waveforms.orthogonal.waveform.GridVisualization
class OrthogonalWaveform(num_subcarriers, grid_resources, grid_structure, pilot_section=None, pilot_sequence=None, repeat_pilot_sequence=True, **kwargs)[source]

Bases: ConfigurablePilotWaveform, ABC

Base class for wavforms with orthogonal subcarrier modulation.

Parameters:
  • num_subcarriers (int) – Number of available orthogonal subcarriers per symbol.

  • grid_resources (Sequence[GridResource]) – Grid resources available for modulation.

  • grid_structure (Sequence[GridSection]) – Grid structure of the time-domain.

  • pilot_section (PilotSection | None) – Pilot section transmitted at the beginning of each frame.

  • pilot_sequence (PilotSymbolSequence | None) – Sequence of pilot / reference symbols.

  • repeat_pilot_sequence (bool) – Repeat the pilot sequence if it is shorter than the frame.

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:

OrthogonalWaveform

Returns:

The deserialized object.

demodulate(signal, bandwidth, oversampling_factor)[source]

Demodulate a base-band signal stream to data symbols.

Parameters:
  • signal (ndarray) – Vector of complex-valued base-band samples of a single communication frame.

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

  • oversampling_factor – Oversampling factor of the communication waveform.

Return type:

Symbols

Returns:

The demodulated communication symbols

frame_duration(bandwidth)[source]

Duration of a single communication frame in seconds.

Parameters:

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

Returns:

Duration of a single communication frame in seconds.

Return type:

float

map(data_bits)[source]

Map a stream of bits to data symbols.

Parameters:

data_bits (ndarray) – Vector containing a sequence of L hard data bits to be mapped onto data symbols.

Return type:

Symbols

Returns: Mapped data symbols.

modulate(data_symbols, bandwidth, oversampling_factor)[source]

Modulate a stream of data symbols to a base-band signal containing a single data frame.

Parameters:
  • data_symbols (Symbols) – Singular stream of data symbols to be modulated by this waveform.

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

  • oversampling_factor – Oversampling factor of the communication waveform.

Return type:

ndarray

Returns:

Samples of the modulated base-band signal.

pick(placed_symbols)[source]

Pick the mapped symbols from the communicaton frame.

Additionally removes interleaved pilot symbols.

Parameters:

placed_symbols (StatedSymbols) – The placed symbols.

Return type:

StatedSymbols

Returns: The symbols with the mapped symbols picked from the frame.

pilot_signal(bandwidth, oversampling_factor)[source]

Model of the pilot sequence within this communication waveform.

Parameters:
  • bandwidth (float) – Bandwidth of the communication waveform in Hz.

  • oversampling_factor (int) – Oversampling factor of the communication waveform.

Return type:

Signal

Returns: The pilot sequence.

place(symbols)[source]

Place the mapped symbols within the communicaton frame.

Additionally interleaves pilot symbols.

Parameters:

symbols (Symbols) – The mapped symbols.

Return type:

Symbols

Returns: The symbols with the mapped symbols placed within the frame.

samples_per_frame(bandwidth, oversampling_factor)[source]

Number of time-domain samples per processed communication frame.

Parameters:
  • bandwidth (float) – Bandwidth of the communication waveform in Hz.

  • oversampling_factor (int) – Oversampling factor of the communication waveform.

Note that the overall sampling rate is defined as bandwidth * oversampling_factor.

Returns:

Number of samples per frame.

Return type:

int

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

symbol_energy(bandwidth, oversampling_factor)[source]

Expected energy of a single communication symbol within the modulated baseband-signal.

Parameters:
  • bandwidth (float) – Bandwidth of the communication waveform in Hz.

  • oversampling_factor (float) – Oversampling factor of the communication waveform.

Typically denoted by \(E_s\). HermesPy defines the symbol energy as the expected sum of squared magnitudes

\[E_s = \sum_{n=0}^{N-1} |x[n]|^2\]

where \(x[n]\) are the complex base-band samples of a single communication symbol.

Returns:

The expected symbol energy.

Return type:

float

unmap(symbols)[source]

Map a stream of data symbols to data bits.

Parameters:

symbols (Symbols) – Sequence of K data symbols to be mapped onto bit sequences.

Return type:

ndarray

Returns:

Vector containing the resulting sequence of L data bits In general, L is greater or equal to K.

property grid_resources: Sequence[GridResource][source]

Available resources within the time-subcarrier grid.

property grid_structure: Sequence[GridSection][source]

Structure of the time-subcarrier grid.

property mapping: PskQamMapping[source]

Constellation mapping used to translate bit sequences into complex symbols.

property modulation_order: int[source]

Access the modulation order.

Returns:

The modulation order.

Return type:

int

property num_data_symbols: int[source]

Number of bit-mapped symbols contained within each communication frame.

property num_subcarriers: int[source]

Number of available orthogonal subcarriers.

Raises:

ValueError – If smaller than one.

property pilot_section: PilotSection | None[source]

Static pilot section transmitted at the beginning of each OFDM frame.

Required for time-domain synchronization and equalization of carrier frequency offsets.

Returns:

FrameSection of the pilot symbols, None if no pilot is configured.

property plot_grid: GridVisualization[source]

Visualize the resource grid.

property power: float[source]

Expected in-band power of the generated baseband-signal for within given target bandwidth.

Typically denoted by \(P\).

Returns:

The expected power of the modulated signal.

property references_per_frame: int[source]

Number of reference symbols per communication frame.

property resource_mask: ndarray[source]

Boolean resource mask of the full OFDM frame.

property symbols_per_frame: int[source]

Number of modulated symbols within each transmitted communication frame.

This includes both data and reference symbols.

property words_per_frame: int[source]

Number of words per communication frame.

class OWT[source]

Type variable for orthogonal waveform types.

alias of TypeVar(‘OWT’, bound=OrthogonalWaveform)

class GridVisualization(wave)[source]

Bases: VisualizableAttribute[ImageVisualization]

Plot the grid structure of an orthogonal waveform.

Parameters:

wave (OrthogonalWaveform) – Waveform this plot is associated with.

property title: str[source]

Title of the visualizable.

Returns: Title string.