problems with high pass filter

Arnaud Delorme arno at CERCO.UPS-TLSE.FR
Tue Jan 26 21:39:04 CET 2010

Dear Susana and Ingrid,

designing efficient filters at very low frequency can be challenging.
Below is a solution using pure Matlab code and elliptic filters for
high pass filtering at 0.1 Hz (transition bandwidth is from 0.05 to
0.1 Hz).
EEG.srate is the sampling rate, EEG.nbchan, the number of data channel
and contains the continuous data (number of channels x number
of data points). The code below requires the signal processing toolbox.
You may also notice that I detrend the data first. This is to remove
any DC offset and very slow drifts that tend to generate more
artifacts at data boundaries.
The function filtfilt applies the filter in both direction (forward
then backward) to avoid phase distortions.

Hope this helps,


[N, Wn] = ellipord(.1/(EEG.srate/2), .05/(EEG.srate/2), 0.5, 3)
[b a] = ellip(N, 0.5, 3, Wn, 'high');

for index = 1:EEG.nbchan,:) = detrend(,:));,:) = filtfilt( b, a,,:));

The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also and
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the fieldtrip mailing list