mne.chpi.filter_chpi#

mne.chpi.filter_chpi(raw, include_line=True, t_step=0.01, t_window='auto', ext_order=1, allow_line_only=False, verbose=None)[source]#

Remove cHPI and line noise from data.

Note

This function will only work properly if cHPI was on during the recording.

Parameters:
rawinstance of Raw

Raw data with cHPI information. Must be preloaded. Operates in-place.

include_linebool

If True, also filter line noise.

t_stepfloat

Time step to use for estimation, default is 0.01 (10 ms).

t_windowfloat

Time window to use to estimate the amplitudes, default is 0.2 (200 ms).

ext_orderint

The external order for SSS-like interfence suppression. The SSS bases are used as projection vectors during fitting.

Changed in version 0.20: Added ext_order=1 by default, which should improve detection of true HPI signals.

allow_line_onlybool

If True, allow filtering line noise only. The default is False, which only allows the function to run when cHPI information is present.

New in v0.20.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns:
rawinstance of Raw

The raw data.

Notes

cHPI signals are in general not stationary, because head movements act like amplitude modulators on cHPI signals. Thus it is recommended to use this procedure, which uses an iterative fitting method, to remove cHPI signals, as opposed to notch filtering.

New in v0.12.

Examples using mne.chpi.filter_chpi#

Signal-space separation (SSS) and Maxwell filtering

Signal-space separation (SSS) and Maxwell filtering