Hello,
I’m looking for help on best practices when reporting filters for publications and have some questions after having seen this doc advising to report
- Filter type (high-pass, low-pass, band-pass, band-stop, FIR, IIR)
- Cutoff frequency (including definition)
- Filter order (or length)
- Roll-off or transition bandwidth
- Passband ripple and stopband attenuation
- Filter delay (zero-phase, linear-phase, non-linear phase) and causality
- Direction of computation (one-pass forward/reverse, or two-pass forward and reverse)
In our case, we are filtering our signals using these two functions
A) raw.plot(theme="light", highpass=1.0, lowpass=40.0, block=True)
Setting up band-pass filter from 1 - 40 Hz
IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 40.00 Hz: -6.02, -6.02 dB
B) All other filters follow this format
raw1.filter(
l_freq=1.0,
h_freq=40.0,
picks="eeg",
method="fir",
phase="zero-double",
fir_window="hamming",
fir_design="firwin",
pad="edge",
)
Filtering raw data in 1 contiguous segment
Setting up band-pass filter from 1 - 40 Hz
FIR filter parameters
---------------------
Designing a two-pass forward and reverse, zero-phase, non-causal bandpass filter:
- Windowed time-domain design (firwin) method
- Hamming window with 0.0194 passband ripple and 53 dB stopband attenuation
- Lower passband edge: 1.00
- Lower transition bandwidth: 1.00 Hz (-12 dB cutoff frequency: 0.50 Hz)
- Upper passband edge: 40.00 Hz
- Upper transition bandwidth: 10.00 Hz (-12 dB cutoff frequency: 45.00 Hz)
- Filter length: 3381 samples (3.302 s)
My questions:
- with raw.plot(), regarding the order:
On one hand, this output “Filter order 16 (effective)”
On the other hand, from the doc of mne.io.Raw.plot(), I see:
filtorder=4
Filtering order. 0 will use FIR filtering with MNE defaults. Other values will construct an IIR filter of the given order and apply it with filtfilt()
Should I be reporting one over the other (is it 4 or 16?) or both?
Something like:
- Filter order 4 (order 16 (effective, after forward-backward))
- Cutoffs at 1.00, 40.00 Hz
- next, with an IIR, I’m not sure what to report for:
- Roll-off or transition bandwidth
- Passband ripple and stopband attenuation
When using raw.filter as a FIR filter, I can see the output for passband ripple & stopband attenuation and transition bandwidth, though that’s not the case wih raw.plot() with an IIR filter.
Going back up the source, I see that raw.plot() leads up to create_filter()
and l_trans_bandwidth and h_trans_bandwidth have a note saying:
Only used for method=‘fir’.
Does it mean this info is not applicable to IIR, and there is no need to report something here?
If it is, how can I extract the information from our code? Or can I assume it is similar to FIR, and we can just follow this table
Many thanks!
Best
Arthur