piel.analysis.signals.time.core.offset

piel.analysis.signals.time.core.offset#

Functions#

offset_to_first_rising_edge(→ piel.types.TimeSignalData)

Offsets the waveform's time axis so that the first rising edge occurs at time zero.

Module Contents#

offset_to_first_rising_edge(waveform: piel.types.TimeSignalData, lower_threshold_ratio: float = 0.1, upper_threshold_ratio: float = 0.9) piel.types.TimeSignalData[source]#

Offsets the waveform’s time axis so that the first rising edge occurs at time zero.

A rising edge is defined as the point where the signal transitions from below the lower threshold to above the upper threshold.

Parameters:
  • waveform (TimeSignalData) – The input waveform data.

  • lower_threshold_ratio (float) – Lower threshold as a ratio of the amplitude range.

  • upper_threshold_ratio (float) – Upper threshold as a ratio of the amplitude range.

Returns:

A new waveform with the time offset applied.

Return type:

TimeSignalData

Raises:

ValueError – If no rising edge is found in the waveform.