Trigger Realization

Inheritance diagram of hermespy.simulation.simulated_device.TriggerRealization

TriggerRealizations are generated once per SimulatedDrop for each unique TriggerModel and contain information about the synchronized simulated devices’ assumed time offsets.

class TriggerRealization(num_offset_samples, sampling_rate)[source]

Bases: Serializable

Realization of a trigger model.

A trigger realization will contain the offset between a drop start and the waveform frames contained within the drop.

Parameters:
  • num_offset_samples (int) – Number of discrete samples between drop start and frame start

  • sampling_rate (float) – Sampling rate at which the realization was generated in Hz.

Raises:
  • ValueError – For num_offset_samples smaller than zero.

  • ValueError – For a sampling_rate smaller or equal to zero.

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:

TriggerRealization

Returns:

The deserialized object.

compute_num_offset_samples(sampling_rate, initial_delay=0.0)[source]

Compute the number of realized offset samples for a custom sampling rate.

The result is rounded to the nearest smaller integer.

Parameters:
  • sampling_rate (float) – Sampling rate of interest in Hz.

  • initial_delay (float) – Delay already accounted for in seconds. For example a signal model with a non-zero delay attribute.

Return type:

int

Returns: The integer number of trigger offset samples.

Raises:

ValueError – For a sampling_rate 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 num_offset_samples: int[source]

Number of discrete samples between drop start and frame start.

property sampling_rate: float[source]

Sampling rate at which the realization was generated in Hz.

property trigger_delay: float[source]

Time between drop start and frame start in seconds.