RF Signal Model

Inheritance diagram of hermespy.simulation.rf.signal.RFSignal
class RFSignal(num_streams: int, num_samples: int, sampling_rate: float, carrier_frequencies: ndarray | None = None, noise_powers: ndarray | None = None, delay: float = 0.0, buffer: Buffer | None = None)[source]

Bases: DenseSignal

An extension of general dense signals for propagation through RF chains.

It allows for diverging carrier frequencies and noise powers for each represented stream.

Parameters:
  • num_streams – Number of streams in the signal.

  • num_samples – Number of samples per stream.

  • sampling_rate – Sampling rate of the signal in Hz.

  • carrier_frequencies – Carrier frequencies for each stream in Hz. If specified, must be of size num_streams.

  • noise_powers – Noise power for each stream in Watts. If specified, must be of size num_streams.

  • delay – Delay of the signal in seconds.

  • buffer – Optional buffer to use for the signal data.

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:

RFSignal

Returns:

The deserialized object.

static FromDense(signal)[source]

Create a new RF signal from a given dense signal.

Parameters:

signal (DenseSignal) – Dense signal to convert.

Return type:

RFSignal

Returns:

The created RF signal.

classmethod FromNDArray(array, sampling_rate, carrier_frequency=None, noise_power=None, delay=0.0)[source]

Create a new RF signal from a given numpy ndarray.

Parameters:
  • array (ndarray[tuple[int, int], dtype[complex128]]) – Array containing the signal samples. Must be of shape (num_streams, num_samples).

  • sampling_rate (float) – Sampling rate of the signal in Hz.

  • carrier_frequency (float | ndarray[tuple[int], dtype[float64]] | None) – Carrier frequencies for each stream in Hz. If specified, must be of size num_streams.

  • noise_power (float | ndarray[tuple[int], dtype[float64]] | None) – Noise power for each stream in Watts. If specified, must be of size num_streams.

  • delay (float) – Delay of the signal in seconds.

Return type:

RFSignal

Returns:

The created RF signal.

copy(order=None)[source]

Copy the dense signal samples into a new signal model with identical parameters.

Return type:

RFSignal

resample(sampling_rate, aliasing_filter=True)[source]

Resample the modeled signal to a different sampling rate.

Parameters:
  • sampling_rate (float) – Sampling rate of the new signal model in Hz.

  • aliasing_filter (bool) – Apply an anti-aliasing filter during downsampling. Enabled by default.

Return type:

RFSignal

Returns: The resampled signal model.

Raises:

ValueError – If sampling_rate is smaller or equal to zero.

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 carrier_frequencies: ndarray[tuple[int], dtype[float64]][source]

Carrier frequencies for each stream in Hz.

Raises:

ValueError – If the carrier frequencies array does not match the number of streams.

property noise_powers: ndarray[tuple[int], dtype[float64]][source]

Noise power for each stream.

Raises:

ValueError – If the noise powers array does not match the number of streams.