[FieldTrip] question about ft_preproc_bandpassfilter

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Thu Jul 8 18:04:23 CEST 2021


Hi Lara,

See https://mailman.science.ru.nl/pipermail/fieldtrip/2018-July/038096.html which also describes the issue you encounter. Apparently, there is some dependence of hardware/OS version and possibly also the matlab version on the numerical stability of the computed filter coefficients. The function filter_with_correction (which is the low-level workhorse underlying the intermediate level ft_preproc_<some>filter functions) checks whether the filter coefficients are stable of not. If not, the risk exists that the filter blows up in your face, and the filtered time courses go out of control. The filter coefficients are based on the specified order, the required passband, and the sampling frequency, so changing any of those could turn an unstable filter into a stable filter again.

The consequence of switching to a lower order filter is typically a more ’shallow’ filter response, in your case a less ‘boxlike’ appearance of the filter’s passband.

Best wishes,
Jan-Mathijs



On 7 Jul 2021, at 16:46, Lara Todorova via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear all,

I am applying a bandpass filter 8-12 Hz on EEG data, 64 channels, 1000 sampling frequency. The data was preprocessed in eeglab software.

I get an error that suggests changing the order of the filter
ft_error('Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter.');

I'm not sure why I get this error. Does anyone have an idea?

Indeed when I change the filter order to 3 instead of default 4, the problem is solved.
I also noticed that if I change Fs to 500 instead of 1000 it also works.

Could someone comment on how Fs affects filtering in ft_preproc_bandpassfilter or what are the consequences of switching to the filter of the lower order?

Thanks,
Lara

--
Lara Todorova | PhD
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!s1uGzqWITr75SHZ5KD3SYH8WIt4KWj8c8V8hVNJHd-J-MsV3sKZDc1cqrHNF7Xc1PDdHNkqP28MUHI4$

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210708/7fd4e5e1/attachment.htm>


More information about the fieldtrip mailing list