tonic.functional.time_skew#

Module Contents#

Functions#

time_skew_numpy(events, coefficient[, offset])

Skew all event timestamps according to a linear transform, potentially sampled from a

tonic.functional.time_skew.time_skew_numpy(events: numpy.ndarray, coefficient: float, offset: int = 0)[source]#

Skew all event timestamps according to a linear transform, potentially sampled from a distribution of acceptable functions.

Parameters:
  • events (numpy.ndarray) – ndarray of shape [num_events, num_event_channels].

  • coefficient (float) – a real-valued multiplier applied to the timestamps of the events. E.g. a coefficient of 2.0 will double the effective delay between any pair of events.

  • offset (int) – value by which the timestamps will be shifted after multiplication by the coefficient. Negative offsets are permissible but may result in in an exception if timestamps are shifted below 0.

Returns:

the input events with rewritten timestamps.