meeg_utils.steps.Filter#

class meeg_utils.steps.Filter(l_freq, h_freq, *, picks=None, method='fir', iir_params=None, phase='zero', l_trans_bandwidth='auto', h_trans_bandwidth='auto', filter_length='auto', fir_window='hamming', fir_design='firwin', n_jobs=None)[source]#

Band-pass, high-pass or low-pass filter the data.

Thin wrapper of mne.io.Raw.filter(); the defaults are MNE’s (zero-phase FIR, firwin design, automatic transition bands).

Parameters:
  • l_freq (float | None) – High-pass cutoff in Hz; None for a low-pass filter.

  • h_freq (float | None) – Low-pass cutoff in Hz; None for a high-pass filter.

  • picks (str | list | None) – Channels to filter; None means all data channels.

  • method ({"fir", "iir"}) – Filter type.

  • iir_params (dict | None) – IIR parameters when method="iir".

  • phase (str) – "zero" (default), "zero-double", "minimum" or "causal".

  • l_trans_bandwidth (float | "auto") – Transition bandwidths in Hz.

  • h_trans_bandwidth (float | "auto") – Transition bandwidths in Hz.

  • filter_length (str | int) – FIR filter length.

  • fir_window (str) – FIR window.

  • fir_design (str) – FIR design method.

  • n_jobs (int | str | None) – Parallel jobs, or "cuda".

qc_#

highpass and lowpass of the filtered data (from info).

Type:

dict

psd_#

Per channel type, PSDs before and after the last transform.

Type:

dict

Notes

Figures (plot()): "response" (filter frequency and impulse response, mne.viz.plot_filter()) and "psd" (spectra before and after filtering).

__init__(l_freq, h_freq, *, picks=None, method='fir', iir_params=None, phase='zero', l_trans_bandwidth='auto', h_trans_bandwidth='auto', filter_length='auto', fir_window='hamming', fir_design='firwin', n_jobs=None)[source]#

Methods

__init__(l_freq, h_freq, *[, picks, method, ...])

fit(inst[, y, system])

Learn the step's state from the data.

fit_transform(inst[, y, system, copy])

Fit the step on the data and transform the same data.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

plot([kind, inst])

Draw quality-control figures.

set_fit_request(*[, inst, system])

Configure whether metadata should be requested to be passed to the fit method.

set_params(**params)

Set the parameters of this estimator.

set_transform_request(*[, copy, inst])

Configure whether metadata should be requested to be passed to the transform method.

transform(inst, *[, copy])

Apply the fitted step to the data.

Attributes

accepts

Data types the step accepts.

adds_annotations

Whether the step may add BAD_ annotations (existing ones are kept).

changes_channels

Whether the step may add, drop or reorder channels.

changes_times

Whether the step may change the time axis (e.g. resampling, cropping).

drops_epochs

Whether the step may drop epochs (e.g. artifact rejection).

plot_kinds

kind -> whether it needs data (inst).

returns

Data type the step returns; None means the same type as its input.

systems

Acquisition systems the step applies to; None means all systems.

accepts: ClassVar[tuple[type, ...]] = (<class 'mne.io.base.BaseRaw'>, <class 'mne.epochs.BaseEpochs'>, <class 'mne.evoked.Evoked'>)#

Data types the step accepts.

plot_kinds: ClassVar[dict[str, bool]] = {'psd': False, 'response': False}#

kind -> whether it needs data (inst). Each kind is drawn by a _plot_<kind>(inst, **kwargs) method.

Type:

Figures the object can draw once fitted