[Mne_analysis] 50Hz artefact for time frequency analysis {Disarmed}

David Leitman davidileitman at gmail.com
Fri Oct 6 06:43:11 EDT 2017
Search archives:

Hi all, 

I am trying to deal with line noise that may have come from HPI or and outside line ( 60HZ) I saw this thread from Wed Oct 8 08:03:00 EDT 2014: cited below (https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2014-October/002627.html <https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2014-October/002627.html>):

I have used both the notch filter and cHPI_filter approach  provided by MNE but as you can see in the figures attached it does result in some distortions. I  would like to try the approach Donald Kreiger suggests below and  deal with the noise by (1) performing a Fourier transform, (2) attenuating the coefficients of the two frequencies, and (3) reconstructing the modified signal with an inverse Fourier transform.  I have attached the results 

My question is as follows: 1)is there a good reason not to try this approach 2) Is there a way to implement it natively and  easily within men python?

Many thanks in advance for your kind attention


attachments of PSD plots  of meg channels raw, filtered with notch filter and with cHPI filter function 
code to generate filters: 
for cHPI_filter:
for notch_filter:
notches = np.arange(60, 181, 60),

[Mne_analysis] 50Hz artefact for time frequency analysis

Krieger, Donald N. kriegerd at upmc.edu  <mailto:mne_analysis%40nmr.mgh.harvard.edu?Subject=Re:%20%5BMne_analysis%5D%2050Hz%20artefact%20for%20time%20frequency%20analysis&In-Reply-To=%3C7FC4F062F840C344B5028EE833EEEADD131E2928%40MSXMBXNSPRD12.acct.upmchs.net%3E>
Wed Oct 8 08:03:00 EDT 2014
Previous message: [Mne_analysis] 50Hz artefact for time frequency analysis <https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2014-October/002626.html>
Next message: [Mne_analysis] 50Hz artefact for time frequency analysis <https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2014-October/002628.html>
Messages sorted by: [ date ] <https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2014-October/date.html#2627> [ thread ] <https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2014-October/thread.html#2627> [ subject ] <https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2014-October/subject.html#2627> [ author ] <https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2014-October/author.html#2627>	Search archives:  
Hi Elisabeth,

As someone else pointed out, your 50 Hz is almost certainly from the mains power.
That is almost surely the source of the 150 Hz also.
Noise from this source have the properties that (1) the frequency is very stable and (2) the amplitude is almost always also very stable.
Because of these properties, this type of noise it typically best removed by measuring its amplitude and phase over a fairly long period, say a second or more, and then subtracting it off.  This approach is typically very precise at remove the line noise while leaving any 50 and 150 Hz activity which is not constant in the signal.
One way it can be done is by (1) performing a Fourier transform, (2) attenuating the coefficients of the two frequencies, and (3) reconstructing the modified signal with an inverse Fourier transform.
This is likely a better approach than convolution with a notch filter since it explicitly uses the "constant amplitude" property of this noise.
If the tools are readily available in mne-python, it might be worthwhile to try before chasing the low frequency noise you mentioned.

One other thing to consider is whether it is actually necessary to remove the noise at all.
If the method you plan to use to explore the gamma band activity has high spectral resolution, the line noise may just show up as sharp peaks which you can ignore.
On the other hand, if your method has low spectral resolution, it definitely is worthwhile and likely it will make sense to use some high resolution spectral method to assess whether the spectrum is adequately smooth across the two line noise peaks.

Finally it might be worthwhile to check a few data samples from other runs to see if line noise is consistently showing up on those same channels.  If so,  it's likely that the noise pickup is due to loss of proper "balance" by the amplifiers or to degradation in the connections which run to those amplifiers.



From: mne_analysis-bounces at nmr.mgh.harvard.edu <https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis> [mailto:mne_analysis-bounces at nmr.mgh.harvard.edu <https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis>] On Behalf Of Elisabeth Fonteneau
Sent: Wednesday, October 08, 2014 7:31 AM
To: mne_analysis at nmr.mgh.harvard.edu <https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis>
Subject: [Mne_analysis] 50Hz artefact for time frequency analysis

Hi all,
Thanks for your reply,
Indeed the artefacts are coming from the cHPI (I did not say that it is not picking up the electrical mainline)
But here is a snapshot (see files in the link below) of one participant/part with the artefact
You have view of few electrodes and this is raw data
The green line correspond to the start of the cHPI
You could see that before some electrodes were bad and remain unchanged
However some EEG were good before and with cHPI they have picked up some high frequency
Also In general you could see that all EEG picked up some level of artefacts
I gave you also a plot for this subject/part of frequency decomposition
The EEG have 50z, 150z & around 330Hz
See files in art2/art4
https://www.dropbox.com/sh/hm7pdbhoc98yxf2/AABlCIdmLs4sWHw3W0sHesYGa?dl=0 <https://www.dropbox.com/sh/hm7pdbhoc98yxf2/AABlCIdmLs4sWHw3W0sHesYGa?dl=0>

Elekta is aware about this problem as it was recurrent in our recent recordings and they are investigating

For the analysis,
I started to use a notch filter and it seems that it is removing the artefacts as I would like (filtering the 3 sensors together)
However by comparing the unfilter vs notch filter data
I noticed that the filter data have another low frequency component added (around 10Z) , effect present in the Mag
See figure art5 in the same dropbox..

I am using MNE_python for this notch filter with the command
raw.notch_filter(np.arange(50, 251, 50), method='fft', n_jobs=4)

any tips for this low frequency band addition?

Thanks for your answers


Dr Elisabeth Fonteneau
Neurolex Group
Department of Psychology
University of Cambridge
Downing Street, Cambridge CB2 3EB, UK
Phone: +44 1223 333 548
Email: ef309 at cam.ac.uk <https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis><mailto:ef309 at cam.ac.uk <https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis>>
Web: www.neurolex.psychol.cam.ac.uk/directory/ef309 at cam.ac.uk <https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis><http://www.neurolex.psychol.cam.ac.uk/directory/ef309@cam.ac.uk <http://www.neurolex.psychol.cam.ac.uk/directory/ef309@cam.ac.uk>>

David I. Leitman PhD
Visiting Scientist,
PSYR2 - Psychiatric disorders: from Resistance to Response
Centre de Recherche en Neurosciences de Lyon (CRNL) INSERM-CNRS
E. david.leitman at ext.inserm.fr
Web.   davidileitman.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171006/584449df/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: L13190PSD_filter_notch_filter_60_180_60_meg_channels_raw_tsss_file.png
Type: image/png
Size: 81835 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171006/584449df/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: L13190PSD_filter_chpi_meg_channels_raw_tsss_file.png
Type: image/png
Size: 85892 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171006/584449df/attachment-0004.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: L13190PSD_meg channels_raw_tsss_file.png
Type: image/png
Size: 62497 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171006/584449df/attachment-0005.png 

More information about the Mne_analysis mailing list