physioex.data.steps.JonesECGPreprocess#
- class physioex.data.steps.JonesECGPreprocess(line_freq=60.0, remove_clips=True, find_noise=True, archetypes_path=None)[source]#
Bases:
PreprocessingStepFull Jones et al. (2024) ECG preprocessing in a single step.
Turn one raw single-lead ECG channel (whole night, any fs) into the network input of
physioex.models.jones_ecg.JonesECGNet: 256 Hz, scaled by the per-night R-wave normalization factor and clipped to[-1, 1].Order of operations (MATLAB stage 2 -> stage 3 -> stage 5 scaling):
remove_large_clips— loose-lead clipping mask removal;zero-phase Chebyshev-II high-pass (0.5 / 0.25 Hz, 0.1 / 60 dB);
line-noise notch at
line_freq(with the aliasing rules) plus up to 10 iterative extra-noise notches (iffind_noise);resample to 256 Hz with
resample_poly(p/q fromFraction(256/fs).limit_denominator());R-wave detection (local variation + template; archetypes when available) and normalization factor = 2 x P90 of per-beat
max |x|;divide by the factor, clip to
[-1, 1].
Parameters#
- line_freqfloat
Mains frequency to notch (60.0 in the authors’ US data, 50.0 in EU data).
- remove_clipsbool
Apply the loose-lead clip-mask removal.
- find_noisebool
Run the iterative extra-noise notch search.
- archetypes_pathstr, optional
Path to
archetypes.mat.None(default) downloads it from the authors’ repository on first use. Deliberately excluded fromspec()— a path must not change the cache hash.
Degenerate inputs (all zeros, fully clipped, no beats found) return zeros of the correct length with a warning instead of raising.
Methods
__init__([line_freq, remove_clips, ...])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: