TimeSkew#

class tonic.transforms.TimeSkew(coefficient: Union[float, Tuple[float, float]], offset: Union[float, Tuple[float, float]] = 0)[source]#

Skew all event timestamps according to a linear transform.

Parameters:
  • coefficient (Union[float, Tuple[float, 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. Can provide a tuple for a range of values.

  • offset (Union[float, Tuple[float, float]]) – 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. Tuple of values might be provided as a range to sample from.

Example

>>> transform1 = TimeSkew(coefficient=1.3, offset=100)
>>> transform2 = TimeSkew(coefficient=[0.8, 1.2], offset=[0, 150])