Signal Processing#
- get_rising_frames_from_ttl(trace: ndarray, threshold: Optional[float] = None) ndarray [source]#
Return the frame indices for rising events in a TTL pulse.
- Parameters
trace (numpy.ndarray) – A TTL signal.
threshold (float, optional) – The threshold used to distinguish on/off states in the trace. The mean of the trace is used by default.
- Returns
rising_frames – The frame indices of rising events.
- Return type
numpy.ndarray
- get_falling_frames_from_ttl(trace: ndarray, threshold: Optional[float] = None) ndarray [source]#
Return the frame indices for falling events in a TTL pulse.
- Parameters
trace (numpy.ndarray) – A TTL signal.
threshold (float, optional) – The threshold used to distinguish on/off states in the trace. The mean of the trace is used by default.
- Returns
falling_frames – The frame indices of falling events.
- Return type
numpy.ndarray