Tutorial 10: Frequency filters

Authors: Francois Tadel, Elizabeth Bock, John C Mosher, Sylvain Baillet

Evaluation of the noise sources

We are now going to process our continuous recordings to remove the main sources of noise. Typically, we can expect contaminations coming from the environment (power lines, stimulation equipment) and from the subject (movements, blinks, heartbeats, breathing, muscle tension, metal in the mouth or the body). In this tutorial will focus first on the contaminations that occur continuously, at specific frequencies.

Before running any type of cleaning procedure on MEG/EEG recordings, we recommend to always start with a quick evaluation of the noise level. An easy way to do this is to estimate the power spectrum of all the sensors over the entire recordings.

Interpretation of the PSD

Detect and remove artifacts

Spectral evaluation

Power line contamination

From Continuous

It is common to have portions of recordings contaminated by events coming from the subject (eye blinks, movements, heartbeats, teeth clenching, implanted stimulators...) or from the environment (stimulation equipment, elevators, cars, trains, building vibrations...). Some occur at specific frequencies and can be removed using frequency filters, as introduced in the first chapter of this tutorial. Some other artifacts have more complex frequency patterns but are well defined, reproducible and can be removed efficiently using Signal Space Projections (SSP). This tutorial shows how to apply this technique to correct for the cardiac and ocular artifacts.

We are going to use the protocol TutorialRaw created in the previous tutorial ?Review continuous recordings and edit markers. If you have not followed this tutorial yet, please do it now.

Power line contamination

Notch filters are adapted to remove some well identified contaminations from oscillating systems, such as the power lines 50Hz or 60Hz. Here is an example of how to evaluate and correct fixed frequency artifacts. Important notes:

  1. Usually you would prefer to apply the frequency filters before the SSP correction.

  2. This approach is limited to CTF and Elekta-Neuromag recordings for now, other file formats will be developed on demand. An alternative approach for other file formats is described in the EEG/Epilepsy tutorial.

Identify the unwanted frequencies

Drag and drop the "Link to raw file" in the Process1 tab, click on the button [Run] to open the Pipeline editor window and select the process "Frequency > Power spectrum density (Welch)". This will estimate the power spectrum of the signal using the Welch method. Set the time window to process to [0,50]s, and the window length to 4 sec, with an overlap of 50%, this will be more than enough to get a good estimate of the spectrum (average of the Fourier transform of 24 windows of 4800 samples each). Leave the other options to the default values.

psdRun.gif

Double click on the "Power (MEG)" file that was created under the "Link to raw file" in the database explorer. This shows the estimate of the power spectrum for the first 50 seconds of the continuous file, for all the sensors, with a logarithmic scale. You can identify four peaks at the following frequencies: 60Hz, 120Hz, 180Hz and 300Hz. The first three are related with the power lines (acquisition in Canada, where the electricity is delivered at 60Hz, plus the harmonics), and are expected to be coming from pure sinusoidal components in the signal. The last one is an artifact of the low-pass filter at 300Hz that was applied on the recordings at the acquisition time. We are going to ignore this one, as it is probably more complex and spanning over several frequency bins.

psdBefore.gif

Remove: 60Hz and harmonics

Leave the file "Link to raw file" in the Process1 list and now run "Pre-process > Notch filter".

sinRemoval.gif

The operation creates a new "Link to raw file" entry in the database, pointing to a new CTF dataset in the same folder as the original continuous file. To check where this file was created: right-click on the file "Raw | notch(60Hz 120Hz 180Hz)" > File > Show in file explorer. This file has the exact same properties as the original file, including the SSP projectors, only the values of the MEG sensors were updated.

sinRemovalDb.gif

Alternatives

If the notch filter is not giving satisfying result, you can use two other processes:

Evaluate the results

Now run the same frequency analysis: process "Frequency > Power spectrum density (Welch)", time window = [0,50]s, window length = 4000ms, overlap = 50%. Double click on the new "Power (MEG)" file. As expected, the three first peaks due to the power lines are gone.

psdAfter.gif

You can run a few other pre-processing operations directly on the continuous files, including a band-pass filter. Frequency filters and sinusoid removals are operations that you should apply at very early stages of the analysis, before epoching the recordings. Those operations do not perform well next to the beginning and the end of the signals, they may generate important artifacts. It is therefore much more accurate to filter the entire recordings from the original continuous file at once, rather than filtering small epochs after importing them in the database.

From now on, we are only going to work on this clean file "Raw | notch(60Hz 120Hz 180Hz)".








Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):


Tutorials/ArtifactsFilter (last edited 2015-03-03 21:33:46 by FrancoisTadel)