physioex.data.Clip#
- class physioex.data.Clip(n_std=3.0)[source]#
Bases:
PreprocessingStepSymmetric outlier clipping around the signal mean.
y = clip(x, mean - n_std*std, mean + n_std*std)with the mean and standard deviation (ddof=0) computed over the whole signal. This is thenp.clip(x, x.mean()-3*x.std(), x.mean()+3*x.std())step of the SleepPPG-Net reference preprocessing. The sampling rate is unchanged.Parameters#
- n_stdfloat
Number of standard deviations for the clip bounds (default 3.0).
Methods
__init__([n_std])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:
- Parameters:
n_std (float)