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[, header])Precompute any expensive state and return a callable specialized for fs_in.
spec()Return canonical, hashable text repr.
- compile(fs_in, header=None)[source]#
Precompute any expensive state and return a callable specialized for fs_in.
headeris an optional per-channel metadata dict (physical dimension, physical min/max, …) forwarded to steps that declare they need it (needs_headerattribute, e.g.PhysicalScale). Steps that ignore it simply do not read it; the signature default keeps every existingcompile(fs)call site working.- Parameters:
- Return type: