physioex.data.BandpassFilter#

class physioex.data.BandpassFilter(low=0.3, high=40.0, order=5, ftype='butter')[source]#

Bases: PreprocessingStep

IIR 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.

Parameters:
__init__(low=0.3, high=40.0, order=5, ftype='butter')[source]#
Parameters:

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.

compile(fs_in)[source]#

Precompute any expensive state and return a callable specialized for fs_in.

Parameters:

fs_in (float)

Return type:

CompiledStep

spec()[source]#

Return canonical, hashable text repr.

Format: ClassName(key1=val1,key2=val2,…) with sorted keys, floats normalized via f’{float(v):.10g}’.

Return type:

str