data filtering in Fieldtrip

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Mon Aug 28 22:15:14 CEST 2006


Dear Mikhail

On 9 Aug 2006, at 20:36, Mikhail Zvyagintsev wrote:
> I have a question regarding filtering in Fieldtrip. I see, that in
> example routines you apply quite often 'butter' function. I got a
> feeling that this is rather a rude approach (I might be wrong). For
> example, I see that some important information could be lost using
> it. I am trying to use 'firpmord' function to generate parameters
> and then 'firpm' for filter design. For filtration 'fltfilt' like
> you do. They all need Sgnal Processing Toolbox, therefore it should
> not be a limitaion. What is your opinion about filtering?

I do not have strong opinions about filtering. In my formal education
(physics) there was little attention spent on filter design, so I
also don't know too much about the details. Of course I could say
that the reason for choosing a Butterworth as default is that
"Butterworth filters are optimal in the sense of having a maximally
flat amplitude response, as measured using a Taylor series expansion
about dc" but that is something that I just googled for, so that is
cheating ;)

My reason for implementing a Butterworth as default is that it is
easy, seems to be good enough (but that is subjective), and is also
pretty standard. The alternative that I also implemented is using the
Matlab fir1 function. I did recently make some changes to the low-
level filtering code, you may want to download a recent copy from the
FTP server and have a look at the lowpassfilter.m function in the
fieldtrip/private directory (there is also a highpassfilter etc).

It should not be too difficult to add support for other filter types
as well, since the cfg-handling and low-level code is designed to
handle different filter types. If you feel that it is worth to
implement more advanced filter design strategies (like firpm), then I
certainly would welcome additions to the code.

best regards,
Robert

P.S. I should also note that at the FC Donders most people that are
using FieldTrip are mainly focussed on frequency and time-frequency
analyses. That means that we often don't apply any filters to the
data at all, but only bandpass-filter the data temporary in order to
find artifacts (eog and muscle). The typical ERP people  within the
FC Donders for whom the filtering would be more relevant still use
BrainVision Analyser a lot (although they do import their ERPs into
fieldtrip for the final statistics).

P.P.S. would you know a good online resource where the difference
between various filters is explained in a way that allows the users
of FieldTrip to make a better choise in the filter settings?



More information about the fieldtrip mailing list