Normal Trigger

Inheritance diagram of hermespy.simulation.simulated_device.NormalTrigger

The NormalTrigger introduces a normally distributed random synchronization delay between the triggering event and the actual transmission or reception of a frame by a simulated device.

It can be configured by assigning the same NormalTrigger instance to the trigger_model property of multiple simulated devices:

# Create a new simulation featuring two sets of two linked, synchronized devices
simulation = Simulation()

# Create devices
device_A_Tx = simulation.new_device(carrier_frequency=3.7e9, bandwidth=400e6, oversampling_factor=4)
device_A_Rx = simulation.new_device(carrier_frequency=3.7e9, bandwidth=400e6, oversampling_factor=4)
device_B_Tx = simulation.new_device(carrier_frequency=3.9e9, bandwidth=400e6, oversampling_factor=4)
device_B_Rx = simulation.new_device(carrier_frequency=3.9e9, bandwidth=400e6, oversampling_factor=4)

# Specify trigger models
trigger_model_A = NormalTrigger(mean=0, std=1e-6)
device_A_Tx.trigger_model = trigger_model_A
device_A_Rx.trigger_model = trigger_model_A

trigger_model_B = NormalTrigger(mean=.5*device_A_Tx.max_frame_duration, std=1e-6)
device_B_Tx.trigger_model = trigger_model_B
device_B_Rx.trigger_model = trigger_model_B
class NormalTrigger(mean, std)[source]

Bases: TriggerModel

Model of a synchronization with a timing offset following a normal distribution.

Parameters:
  • mean (float) – Mean of the delay within this trigger group in seconds.

  • std (float) – Standard deviation of the delay within this trigger group in seconds.

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:

NormalTrigger

Returns:

The deserialized object.

realize(rng=None)[source]

Realize a triggering of all controlled devices.

Parameters:

rng (Generator | None) – Random number generator used to realize this trigger model. If not specified, the object’s internal generator will be queried.

Return type:

TriggerRealization

Returns: Realization of the trigger model.

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 mean: float[source]

Mean timing offset in seconds.

property std: float[source]

Standard deviation of the timing offset in seconds.

Raises:

ValueError – If the provided value is negative.