physioex.data.BandpassFilter#
- class physioex.data.BandpassFilter(low=0.3, high=40.0, order=5, ftype='butter')[source]#
Bases:
PreprocessingStepIIR Butterworth bandpass filter (zero-phase via sosfiltfilt).
Uses second-order sections (SOS) representation for numerical stability. The ba-form (transfer function) is numerically unstable for long signals at high sampling rates with low normalized cutoffs (e.g., 0.3 Hz at 500 Hz → normalized = 0.0012), causing NaN output. SOS avoids this.
If the input sampling rate is too low for the filter band (high >= Nyquist), the filter is skipped with a warning.
Methods
__init__([low, high, order, ftype])compile(fs_in)Precompute any expensive state and return a callable specialized for fs_in.
spec()Return canonical, hashable text repr.