mne.filter.
create_filter
(data, sfreq, l_freq, h_freq, filter_length=’auto’, l_trans_bandwidth=’auto’, h_trans_bandwidth=’auto’, method=’fir’, iir_params=None, phase=’zero’, fir_window=’hamming’, verbose=None)[source]¶Create a FIR or IIR filter.
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 filterl_freq > h_freq
: band-stop filterl_freq is not None and h_freq is None
: high-pass filterl_freq is None and h_freq is not None
: low-pass filter
Parameters: | data : ndarray, shape (…, n_times)
sfreq : float
l_freq : float | None
h_freq : float | None
filter_length : str | int
l_trans_bandwidth : float | str
h_trans_bandwidth : float | str
method : str
iir_params : dict | None
phase : str
fir_window : str
verbose : bool, str, int, or None
|
---|---|
Returns: | filt : array or dict
|
See also
Notes
Band-pass filter
The frequency response is (approximately) given by:
1-| ----------
| /| | \
|H| | / | | \
| / | | \
| / | | \
0-|---------- | | --------------
| | | | | |
0 Fs1 Fp1 Fp2 Fs2 Nyq
Where:
- Fs1 = Fp1 - l_trans_bandwidth in Hz
- Fs2 = Fp2 + h_trans_bandwidth in Hz
Band-stop filter
The frequency response is (approximately) given by:
1-|--------- ----------
| \ /
|H| | \ /
| \ /
| \ /
0-| -----------
| | | | | |
0 Fp1 Fs1 Fs2 Fp2 Nyq
Where Fs1 = Fp1 + l_trans_bandwidth
and
Fs2 = Fp2 - h_trans_bandwidth
.
Multiple stop bands can be specified using arrays.
Low-pass filter
The frequency response is (approximately) given by:
1-|------------------------
| \
|H| | \
| \
| \
0-| ----------------
| | | |
0 Fp Fstop Nyq
Where Fstop = Fp + trans_bandwidth
.
High-pass filter
The frequency response is (approximately) given by:
1-| -----------------------
| /
|H| | /
| /
| /
0-|---------
| | | |
0 Fstop Fp Nyq
Where Fstop = Fp - trans_bandwidth
.
New in version 0.14.
mne.filter.create_filter
¶