Tutorial 10: Power spectrum and frequency filters

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

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, building vibrations) and from the subject (movements, blinks, heartbeats, breathing, teeth clenching, muscle tension, metal in the mouth or the body). In this tutorial, we will focus first on the noise patterns that occur continuously, at specific frequencies.

We can correct for these artifacts using frequency filters. Usually we prefer to run these notch and band-pass filters before any other type of correction, on the continuous files. They can be applied to the recordings without much supervision, but they may create important artifacts at the beginning and the end of the signals. Processing the entire continuous recordings at once instead of the imported epochs avoids adding these edge effects to all the trials.

Evaluation of the noise level

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

Interpretation of the PSD

File: AEF#01

File: AEF#02

File: Noise recordings

X Log-scale

Elekta-Neuromag and EEG users

The Elekta-Neuromag MEG systems combine different types of sensors with very different amplitude ranges, therefore you would not observe the same types of figures. Same thing for EEG users, this might not look like what you observe on your recordings.

For now, keep on following these tutorials with the example dataset to learn how to use all the Brainstorm basic features. Once you're done, read additional tutorials in the section "Other analysis scenarios" to learn about the specificities related with your own acquisition system.

Apply a notch filter

For illustration purposes, we will now run a frequency filter to remove the 60Hz+harmonics from the continuous files. Notch filters are adapted for removing well identified contaminations from systems oscillating at very stable frequencies.

Evaluation of the filter

Some cleaning

To avoid any confusion later, delete the links to the original files:

Note for beginners

Everything below is advanced documentation, you can skip it for now.




Advanced

What filters to apply?

The frequency filters you should apply depend on the noise present in your recordings, but also on the type of analysis you are planning to use them for. This sections provides some general recommendations.

High-pass filter

Low-pass filter

Band-pass filter

Notch filter

When to apply these filters?

Filter specifications: Band-pass

[ATTACH]

Warning: mirroring just masks the edge effects, it doesn't improve the quality of the filter.

There are two options in this process. The first one relaxes the stopband attenuation from -60db (default value) to -40db. This results to a lower order filter with a smaller edge effect, faster filtering, but with a lower accuracy.

Another option is the filtering method. After building a FIR band-pass filter, we can perfrom filtering in freuqency domain(using FFTs of input signal and filter impulse response) or in time domain (by convultion). The first approach is much faster for most cases and filters, while the later might be more practical for few cases. Anyway, both methods have a same result.

Relax: "this option reduces the transient length, but at the expense of reduced performance in the filter in terms of stopband attenuation (40dB rather than 60dB)"

The HPF is implemented as a zero-phase (zero delay) FIR filter and based on Kaiser window design.

The edge effect region lasts for a number of samples equal to half of the filter order. If the edge effect affects too much of your data, adjust the filter parameters to reduce filter order

. BrainStorm will generate a warning if your choice of filter parameters results in an edge effect of two seconds or more.BrainStorm will generate a warning if the combined edge effects at the start and end of your data represents 10 percent or more of the total number of samples.

Filter specifications: Notch

Filter specifications: Band-stop

Advanced

On the hard drive

The names of the files generated by the process "Power spectrum density" start with the tag timefreq_psd, they share the same structure as all the files that include a frequency dimension.

To explore the contents of a PSD file created in this tutorial, right-click on it and use the popup menus
File > View file contents or File > Export to Matlab.

Structure of the time-frequency files: timefreq_psd_*.mat

Useful functions








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


Tutorials/ArtifactsFilter (last edited 2016-10-18 20:29:02 by FrancoisTadel)