Time Offset Trigger

Inheritance diagram of hermespy.simulation.simulated_device.TimeOffsetTrigger

The TimeOffsetTrigger introduces an offset of a fixed time duration to the start of the SimulatedDrop.

It can be configured by assigning the same TimeOffsetTrigger 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)
device_A_Rx = simulation.new_device(carrier_frequency=3.7e9)
device_B_Tx = simulation.new_device(carrier_frequency=3.9e9)
device_B_Rx = simulation.new_device(carrier_frequency=3.9e9)

# Specify trigger models
trigger_model_A = TimeOffsetTrigger(0.0)
device_A_Tx.trigger_model = trigger_model_A
device_A_Rx.trigger_model = trigger_model_A

trigger_model_B = TimeOffsetTrigger(.5 * device_B_Tx.max_frame_duration)
device_B_Tx.trigger_model = trigger_model_B
device_B_Rx.trigger_model = trigger_model_B
class TimeOffsetTrigger(offset)[source]

Bases: TriggerModel, Serializable

Model of a trigger that generates a constant time offset between drop start and frame start.

Note that the offset is rounded to the nearest smaller integer number of samples, depending on the sampling rate of the first controlled device’s sampling rate.

Parameters:

offset (float) – Offset between drop start and frame start in seconds.

realize(rng=None)[source]

Realize a triggering of all controlled devices.

Parameters:

rng (np.random.Generator, optional) – 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.

property offset: float

Offset between drop start and frame start in seconds.