Estimator to filter data array along the last dimension.
Applies a zero-phase low-pass, high-pass, band-pass, or band-stop filter to the channels.
l_freq and h_freq are the frequencies below which and above which, respectively, to filter out of the data. Thus the uses are:
l_freq < h_freq: band-pass filter
l_freq > h_freq: band-stop filter
l_freq is not None, h_freq is None: low-pass filter
l_freq is None, h_freq is not None: high-pass filter
float
| None
Low cut-off frequency in Hz. If None the data are only low-passed.
float
| None
High cut-off frequency in Hz. If None the data are only high-passed.
float
, default 1.0Sampling frequency in Hz.
str
| int
, default ‘auto’Length of the FIR filter to use (if applicable):
int: specified length in samples.
‘auto’ (default in 0.14): the filter length is chosen based on the size of the transition regions (7 times the reciprocal of the shortest transition band).
str: (default in 0.13 is “10s”) a human-readable time in units of “s” or “ms” (e.g., “10s” or “5500ms”) will be converted to that number of samples if
phase="zero"
, or the shortest power-of-two length at least that duration forphase="zero-double"
.
float
| str
Width of the transition band at the low cut-off frequency in Hz
(high pass or cutoff 1 in bandpass). Can be “auto”
(default in 0.14) to use a multiple of l_freq
:
min(max(l_freq * 0.25, 2), l_freq)
Only used for method='fir'
.
float
| str
Width of the transition band at the high cut-off frequency in Hz
(low pass or cutoff 2 in bandpass). Can be “auto”
(default in 0.14) to use a multiple of h_freq
:
min(max(h_freq * 0.25, 2.), info['sfreq'] / 2. - h_freq)
Only used for method='fir'
.
int
| str
, default 1Number of jobs to run in parallel.
Can be ‘cuda’ if cupy
is installed properly and method=’fir’.
str
, default ‘fir’‘fir’ will use overlap-add FIR filtering, ‘iir’ will use IIR forward-backward filtering (via filtfilt).
dict
| None
, default None
Dictionary of parameters to use for IIR filtering. See mne.filter.construct_iir_filter for details. If iir_params is None and method=”iir”, 4th order Butterworth will be used.
str
, default ‘hamming’The window to use in FIR design, can be “hamming”, “hann”, or “blackman”.
str
Can be “firwin” (default) to use scipy.signal.firwin()
,
or “firwin2” to use scipy.signal.firwin2()
. “firwin” uses
a time-domain design technique that generally gives improved
attenuation using fewer samples than “firwin2”.
New in version 0.15.
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.
Methods
|
Do nothing (for scikit-learn compatibility purposes). |
|
Fit to data, then transform it. |
|
Filter data along the last dimension. |
Do nothing (for scikit-learn compatibility purposes).
TemporalFilter
The modified instance.