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

AGOURAM Hasnae hasnae.AGOURAM at univ-amu.fr
Fri Jul 12 13:08:38 CEST 2024


Hello Konstantinos Tsilimparis,


Thank you very much for the useful information.

I tried padding, but it doesn't work for me, so I did it with the bandstop filter, to remove for example the noise of power lines at 50 Hz, I chose the frequency interval from [49 51 Hz].


Thanks again,

Hasnae

________________________________
De : fieldtrip <fieldtrip-bounces at science.ru.nl> de la part de Konstantinos Tsilimparis via fieldtrip <fieldtrip at science.ru.nl>
Envoyé : jeudi 11 juillet 2024 01:24:57
À : FieldTrip discussion list
Cc : Konstantinos Tsilimparis
Objet : Re: [FieldTrip] Issue with DFT filter used to remove power line noise at 50 Hz


Ce mail provient de l'extérieur, restons vigilants
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/20240712/59db5398/attachment.htm>


More information about the fieldtrip mailing list