speasy.signal.filtering package
- speasy.signal.filtering.apply_sos_filter(sos: ndarray, filter_function: Callable, var: SpeasyVariable | Collection[SpeasyVariable]) SpeasyVariable | Collection[SpeasyVariable] [source]
Apply an IIR filter to the variable(s) using the given filter function. This function just applies the filter to the values of the variable without any resampling, it assumes that the variable has a regular time axis.
- Parameters:
- sos: np.ndarray
Second-order sections representation of the filter, as returned by
scipy.signal.iirfilter()
with output=’sos’ for example.- filter_function: Callable
The filter function to use (e.g.
scipy.signal.sosfiltfilt()
)- var: SpeasyVariable or Collection[SpeasyVariable]
The variable(s) to filter
- Returns:
- SpeasyVariable or Collection[SpeasyVariable]
The filtered variable(s)
Notes
It only supports 1D variables.
- speasy.signal.filtering.sosfiltfilt(sos: ndarray, var: SpeasyVariable | Collection[SpeasyVariable]) SpeasyVariable | Collection[SpeasyVariable] [source]
Apply an IIR filter to the variable(s) using
scipy.signal.sosfiltfilt()
. This function just applies the filter to the values of the variable without any resampling, it assumes that the variable has a regular time axis.- Parameters:
- sos: np.ndarray
Second-order sections representation of the filter
- var: SpeasyVariable or Collection[SpeasyVariable]
The variable(s) to filter
- Returns:
- SpeasyVariable or Collection[SpeasyVariable]
The filtered variable(s)
Notes
It only supports 1D variables.