Triggering criteria
threshold_crossing_hysteresis_falling(arr_t, arr_s, threshold, hysteresis_height, n_est=None)
This function implements the constant threshold triggering method with hysteresis on the falling edge. The hysteresis height is specified in the same units as the signal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arr_t
|
ndarray
|
The time values of the signal. |
required |
arr_s
|
ndarray
|
The signal to determine the threshold level for. |
required |
threshold
|
float
|
The threshold level to use for the constant threshold triggering method. |
required |
hysteresis_height
|
float
|
The height of the hysteresis. It has the same units as the signal. |
required |
n_est
|
Optional[float]
|
The estimated number of ToAs in this signal. Defaults to None. This number is used to pre-allocate the array containing the ToAs. If this number is not provided, the array will be pre-allocated as the same dimension as arr_t and arr_s. You should specify this value for large signals. |
None
|
Source code in bladesight/btt/triggering_criteria.py
threshold_crossing_hysteresis_rising(arr_t, arr_s, threshold, hysteresis_height, n_est=None)
A sequential threshold crossing algorithm that interpolates the ToA between the two samples where the signal crosses the threshold.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arr_t
|
ndarray
|
The array containing the time values. |
required |
arr_s
|
ndarray
|
The array containing the signal voltage values corresponding to the time values. |
required |
threshold
|
float
|
The threshold value. |
required |
hysteresis_height
|
float
|
The height of the hysteresis, in the same units as the signal. |
required |
n_est
|
float
|
The estimated number of ToAs in this signal. Defaults to None. This number is used to pre-allocate the array containing the ToAs. If this number is not provided, the array will be pre-allocated as the same dimension as arr_t and arr_s. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: An array containing the ToAs. |
Source code in bladesight/btt/triggering_criteria.py
threshold_crossing_interp(arr_t, arr_s, threshold, n_est=None, trigger_on_rising_edge=True)
A sequential threshold crossing algorithm that interpolates the ToA between the two samples where the signal crosses the threshold.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arr_t
|
ndarray
|
The array containing the time values. |
required |
arr_s
|
ndarray
|
The array containing the signal voltage values corresponding to the time values. |
required |
threshold
|
float
|
The threshold value. |
required |
n_est
|
float
|
The estimated number of ToAs in this signal. Defaults to None. This number is used to pre-allocate the array containing the ToAs. If this number is not provided, the array will be pre-allocated as the same dimension as arr_t and arr_s. |
None
|
trigger_on_rising_edge
|
bool
|
Whether to trigger ToAs on the rising or falling edge. Defaults to True. If True, the ToA is triggered on the rising edge. |
True
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: An array containing the ToAs. |