[FieldTrip] Issue with DFT filter used to remove power line noise at 50 Hz

Konstantinos Tsilimparis konstantinos.tsilimparis at outlook.com
Thu Jul 11 00:24:57 CEST 2024


Hello Hasnae,

The Fieldtrip's FAQ might provide you with an answer: https://www.fieldtriptoolbox.org/faq/why_is_there_a_residual_50hz_line-noise_component_after_applying_a_dft_filter/. An alternative to the DFT filter is the bandstop filter.

As mentioned in the webpage: https://www.fieldtriptoolbox.org/faq/what_kind_of_filters_can_i_apply_to_my_data/ , you can apply padding to make the DFT filter sharper. I am not sure if this would help you, but you can play with the padding and see if your results improve.

All the best,
Konstantinos Tsilimparis

From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of AGOURAM Hasnae via fieldtrip
Sent: Wednesday, July 10, 2024 2:26 PM
To: fieldtrip at science.ru.nl
Cc: AGOURAM Hasnae <hasnae.AGOURAM at univ-amu.fr>
Subject: [FieldTrip] Issue with DFT filter used to remove power line noise at 50 Hz

Hello everyone,

I am having a small issue with the DFT filter used to remove power line noise at 50 Hz. Even after applying the filter, I still observe line noise in the power spectral density.

I am using the ft_preproc_dftfilter<https://www.fieldtriptoolbox.org/reference/preproc/ft_preproc_dftfilter> function from the Fieldtrip toolbox, which applies a narrow-band notch filter to eliminate the 50 Hz noise.


Here is the snippet of code I am using


%filtre the data
       cfg                = [];
       cfg.hpfilter       = 'yes'; % High-pass filter
       cfg.hpfreq         = 1 ;    % High-pass frequency
       cfg.dftfilter      = 'yes'; % enable notch filtering to eliminate power line noise
       cfg.dftfreq        = [50]; %set frequencies for notch filtre
       dataContinuousResampled_filtred = ft_preprocessing(cfg,dataContinuousResampled);


If you have any suggestions, please let me know.

Hasnae Agouram
PhD student
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240710/befa9278/attachment.htm>


More information about the fieldtrip mailing list