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 EEG.data 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,

Arno

[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
    EEG.data(index,:) = detrend(EEG.data(index,:));
    EEG.data(index,:) = filtfilt( b, a, EEG.data(index,:));
end;


----------------------------------
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 http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100126/2607b767/attachment.html>


More information about the fieldtrip mailing list