Tutorial 17: Time-frequency

Authors: Francois Tadel, Dimitrios Pantazis, Sylvain Baillet

This tutorial introduces how to compute time-frequency decompositions of MEG recordings and cortical currents using complex Morlet wavelets. There are several ways to reach the same result, please read all the sections carefully and then choose the method that is best suited for your own data.

slide.gif

Introduction to complex Morlet wavelets

Complex Morlet wavelets are very popular in EEG/MEG data analysis for time-frequency decomposition. They have the shape of a sinusoid, weighted by a Gaussian kernel, and they can therefore capture local oscillatory components in the time series. An example of this wavelet is show below, where the blue and red curves represent the real and imaginary part, respectively.

Contrary to the standard short-time Fourier transform, wavelets have variable resolution in time and frequency. When designing the wavelet, we basically decide a trade off between temporal and spectral resolution.

To design the wavelet, we first need to choose a central frequency, ie the frequency where we will define the mother wavelet. All other wavelets will be scaled and shifted versions of the mother wavelet. Unless interested in designing the wavelet at a particular frequency band, the default 1Hz should be fine.

Then, the desirable time resolution for the central frequency should be defined. For example, we may wish to have a temporal resolution of 3 seconds at frequency 1 Hz (default parameters). These two parameters, uniquely define the temporal and spectral resolution of the wavelet for all other frequencies, as shown in the plots below.

Resolution is given in units of Full Width Half Maximum of the Gaussian kernel, both in time and frequency. The relevant plots are given below.

waveletOptions.gif

Edge effects

Users should pay attention to edge effects when applying wavelet analysis. Wavelet coefficients are computed by convolving the wavelet kernel with the time series. Similarly to any convolution of signals, there is zero padding at the edges of the time series and therefore the wavelet coefficients are weaker at the beginning and end of the time series.

From the figure above, which designs the Morlet wavelet, we can see that the default wavelet (central frequency 1Hz, FWHM=3sec) has temporal resolution 0.25sec at 5Hz and 0.1sec at 10Hz. In such case, the edge effects are roughly half these times: 125ms in 5Hz and 50ms in 10Hz. Examples of such edge effects are given in the figures below.

edgeEffect5Hz.gif edgeEffect10Hz.gif

Time-frequency decomposition of MEG Recordings

We are going first to compute the time-frequency decomposition for the two averaged recordings we have in the protocol. Drag and drop the two ERF files from Right and Left in Process1. Select "Recordings".

[ATTACH]

Click on Run. Select the process: Frequency > Time-frequency (Morlet wavelets).

[ATTACH]

Click on the "Edit" button to get access to the options specific to the time-frequency decomposition process. With this time-frequency option window, you can:

  1. define bands in time and frequency or analyze the data in all points,
  2. configure the time and frequency resolution of the wavelets,
  3. define the output type (complex coefficients or squared coefficients / power).

[ATTACH]

Description of the options

Comment: String that will be displayed in the database explorer to represent the output file.

Time definition:

Frequency definition:

Morlet wavelet options:

Processing options:

Computation

Back to our evoked fields. Let's select the following options:

Start the computation:

Display time-frequency maps

Right-click on the TF file of the Left condition to see what are the possible display options

One channel

Display tab

Mouse and keyboard

Display multiple channels

Three menus display the same information (the TF maps of all the channels) with different spatial organizations.

What to do with these figures:

Power spectrum and time series

These two menus generate similar figures: they represent as a line the evolution of each sensor for one parameter (time or frequency) when the other parameter is fixed.

Open at the same time three figures for the Left/ERF file:

Then navigate in time and frequencies, and observe how each figure gets updated at each change.

2D topography

Right-click on the TF file in condition Left and select successively the first three topography menus. All these three windows represent the same information, in a slightly different way: a spatial map of the power of the current frequency, for all the sensors at the current time.

Try to move the time and frequency sliders and see what happens. You can open at the same time a "One channel" view, to keep track easily of the current time and frequency.

Keyboard shortcuts:

2D Layout

The last display mode available for these TF decomposition of recordings is this "2D Layout" topography menu. Right-click on the TF file for the Left condition and select "2D Layout".

This represents spatially the power of the current frequency for all the sensors and all the time points. Try to move the current frequency slider to see how the display changes when increasing the frequency. It is a good example to show that the time resolution increase with the frequency. Below: the "2D Layout" for f=8Hz and f=60Hz.

Useful operations for this window:

Contents of the "timefreq" files

Right click one of the TF files, and select the menu File > View file contents, to have a look to what is the actual contents of these structures.

Time and frequency bands

Frequency bands

Time bands

Time bands and frequency bands

Cortical sources

Scouts time series

Processing time-frequency files: Z-score

What's in the time-frequency file

Document file tags

Additional discussions on the forum








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


Tutorials/TimeFrequency (last edited 2015-07-10 21:39:47 by FrancoisTadel)