EEG bandpass filtering locutoff and hicutoff syntax

24 views (last 30 days)
Zhuo
Zhuo on 8 Nov 2025 at 4:29
Edited: Umar about 7 hours ago
I have been confused with this basic question for a while. If I want to keep the EEG data ranging from 0.05Hz- 80Hz when doing the bandpass filtering step, should I run: EEG = pop_eegfiltnew(EEG, 'locutoff', 0.05, 'hicutoff', 80)or EEG = pop_eegfiltnew(EEG, 'locutoff', 0.05, 'hicutoff', 80, ‘revfilt’, 1)? Thank you so much for anawering this question!

Answers (1)

Umar
Umar on 9 Nov 2025 at 7:14
Edited: Umar about 2 hours ago

Hi @Zhuo,

I have edited my comments after reviewing the sources provided by @Elias. Please see the latest response below. It was my mistake not thoroughly reviewing the sources.

To bandpass filter your EEG data from 0.05Hz to 80Hz, you should use:

EEG = pop_eegfiltnew(EEG, 'locutoff', 0.05, 'hicutoff', 80);

This command will keep frequencies between 0.05Hz and 80Hz, which is what you want. The function applies a zero-phase (non-causal) filter by default, which is appropriate for offline EEG analysis and preserves phase relationships in your data.

You should not use revfilt = 1 in this case. The revfilt parameter is used to reverse the filter behavior, converting a bandpass filter into a notch filter. If you set revfilt = 1, the filter would remove frequencies between 0.05Hz and 80Hz instead of keeping them, which is the opposite of what you're trying to achieve.

The default behavior of pop_eegfiltnew is already non-causal with zero-phase filtering, which is ideal for most offline EEG processing. This means you don't need to add any additional parameters to get phase-preserving filtering. The function automatically handles the delay correction for you.

If you ever needed causal filtering, which is only necessary for specific applications like real-time processing or pre-stimulus analysis, you would need to explicitly add the minphase parameter: pop_eegfiltnew(EEG, 'locutoff', 0.05, 'hicutoff', 80, 'minphase', 1). However, for standard offline analysis, the basic command without additional parameters is what you need.

References: https://sccn.ucsd.edu/eeglab/eeglab_news/9/Q_and_A.php https://sccn.ucsd.edu/pipermail/eeglablist/2013/005966.html

  2 Comments
Elias
Elias 4 minutes ago
Hi Umar,
So to your understanding, the default setting of 'pop_eegfiltnew' is a causal bandpass filter? Based on what I am reading, it sounds like the newer function is a non-causal filter unless one manually selects for it to be causal. Here is where I read that:
Elias
Umar
Umar about 23 hours ago
Edited: Umar about 6 hours ago

Hi Elias,

You're absolutely right to question my explanation. After reviewing the sources you provided, I can confirm that your understanding is correct.

The default behavior of pop_eegfiltnew is non-causal (zero-phase) filtering, not causal as I suggested. According to the EEGLAB News documentation, the function applies a linear zero-phase non-causal FIR filter by default, which automatically corrects for delay. This is the appropriate choice for most offline EEG analysis where preserving phase relationships is important.

The confusion in my response stems from a misunderstanding of the revfilt parameter. This parameter doesn't control whether filtering is causal or non-causal. Instead, it converts a bandpass filter into a notch filter (band-stop filter). So when you set revfilt to 1, you're creating a filter that removes frequencies in the specified range rather than keeping them, not changing the phase characteristics.

If you actually need causal filtering, which is only necessary for specific applications like real-time processing or analyzing pre-stimulus activity where post-stimulus contamination must be avoided, you would need to explicitly add the minphase parameter set to 1. The command would look like this: pop_eegfiltnew(EEG, 'locutoff', 0.05, 'hicutoff', 80, 'minphase', 1). However, for standard offline analysis, this is typically unnecessary and can introduce signal distortion.

The sources you found, particularly the detailed explanation from Andreas Widmann who is the expert behind these filtering functions, make it clear that the newer pop_eegfiltnew function was designed with zero-phase filtering as the default specifically because this is what most EEG researchers need. The older legacy function pop_eegfilt had options for causal filtering, but the newer implementation assumes non-causal unless you explicitly request otherwise.

For your bandpass filtering from 0.05 to 80 Hz in offline analysis, you can simply use pop_eegfiltnew(EEG, 'locutoff', 0.05, 'hicutoff', 80) without any additional parameters. This will give you the phase-preserving filter you need without requiring revfilt or any other modifications.

Good job!

Sign in to comment.

Categories

Find more on EEG/MEG/ECoG in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!