[Eeglablist] Notch filter

Andreas Widmann widmann at uni-leipzig.de
Fri Sep 29 02:45:20 PDT 2017


Hi Luis,

> I'm trying to run this code:
> 
> EEGOUT = pop_eegfilt( EEG, 45, 55, 'revfilt',1);
> 
> But Matlab shows this error:
> 
> Filter error: continuous data portion too narrow (DC removed if highpass only)

(1) Do NOT use pop_eegfilt („legacy" in GUI)! it is known to be broken since many years. It is deprecated and left for backward compatibility only (see https://www.frontiersin.org/articles/10.3389/fpsyg.2012.00233/full for more details).
(2) The syntax is wrong. It should not take string arguments. Correct syntax would be pop_eegfilt( EEG, 45, 55, [], 1 );
(3) The error message suggests that you have very short continuous segments (or epoched data?). The error is due to pop_eegfilt using filtfilt not accepting segments shorter than 3 times filter order (IIRC).

However, note that notch filters do show ringing at the signal edges. Thus, you should not notch filter short segments or epochs. Even if the solution suggested below would run it is not actually recommended to be used here.

> Could anyone tell me which it is the best way to run a Notch filter?

EEGOUT = pop_eegfiltnew( EEG, 47.5, 52.5, [], 1 );

Hope this helps! Best,
Andreas


More information about the eeglablist mailing list