[FieldTrip] Questions on High pass and Dft filtering

Philipp Hintze philipp.hintze at uni-muenster.de
Wed Jun 27 15:30:42 CEST 2012

Dear mailing list members,

I continue to run into errors during my first FieldTrip analysis:
I would like to use a high pass filter on my data prior to the segmentation
into trials, the reason being that the trial duration is ~900 ms and I would
like to filter low frequencies. The continuous data set is 900 seconds long.
Simply using
     cfg.continuous          = 'yes';

     cfg.hpfilter                 = 'yes';
     cfg.hpfreq                  = 0.1;
     filteredContinuousData  = ft_preprocessing(cfg);

as my first run of preprocessing, I am confronted with an error stating

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.

How can I avoid this?

Another problem I have concernes the line noise filtering. I would like to use
the dft filter to get rid of the line noise. Using it on the segmented trials,
I still notice residual 50 Hz noise, despite using cfg.padding = 10. A
combination of the dft filter and a band stop filter using cfg.bsfreq =
[49:0.1:51 99:0.1:101 149:0.1:151] leads to acceptable filtering of the line

The problem I have concerns the order of the filtering steps: I would like to
use the high pass filter described above, given it works, on the continuous
data. If I use the dft filter on the continuous data set, there is no effect
on the averaged trials. Is this trivial or is there a mistake on my part?
However, I can hardly use the dft filter on data that was preprocessed as
continuous and than segmented using ft_redefinetrial, because I can not set
any filter padding (because the data is not read from the dataset).
Is there something I am overlooking or doing wrong or has someone used a
different approach to a similar problem?

Thank you in advance for your time and effort,


More information about the fieldtrip mailing list