[Eeglablist] How to use timefreq() ??

Edward Rooke Ed.Rooke at bristol.ac.uk
Fri Sep 18 04:57:17 PDT 2009


Dear all,

I am attempting to apply a morlet wavelet to obtain time-frequency plots
of some eeg data (which has already been aranged in 40 x -200 to 1000ms
epochs). I  decided to use the function timefreq() and have a few
problems:-

1)	When I attempt to call this function I get memory issues;

>> 	timefreq(EEG.data, 250,'cycles', 7, 'wletmethod', 'dftfilt3',
'tlimits', [-200 1000],  'padratio', 2 );

Using 7 cycles at all frequencies.
Value of 'timesout' must be <= frame-winsize, 'timesout' adjusted to 50
Generating 50 time points (-45.5 to 845.5 ms)
The window size used is 17 samples (68 ms) wide.
Estimating 3 linear-spaced frequencies from 109.4 Hz to 125.0 Hz.
Processing time point (of 50):??? Out of memory. Type HELP MEMORY for your
options.

Error in ==> timefreq at 526
            tmpall( freqind, index, :) = tmpX;


2)	There appears to be no input in timefreq() associated with specifying
channels. I attempted to select the channels beforehand using the
“select data” option on the GUI. However, I then got the
following error;

>>  timefreq(EEG.data, 250,'cycles', 7, 'wletmethod', 'dftfilt3',
'tlimits', [-200 1000],  'padratio', 2 );
??? Error using ==> timefreq at 367
Value of winsize must be less than frame length.


>> timefreq(EEG.data, 250,'cycles', 7, 'wletmethod', 'dftfilt3',
'tlimits', [-200 1000], 'freqs', [2 80], 'padratio', 2 );


3)	I would like a plot of frequencies between 2 and 80 Hz. I tried
including this in the ‘freq’ input but got the error message
below. Can anyone explain this?

>> timefreq(EEG.data, 250,'cycles', 7, 'wletmethod', 'dftfilt3',
'tlimits', [-200 1000], 'freqs', [2 80], 'padratio', 2 );
Using 7 cycles at all frequencies.
??? Error using ==> timefreq>gettimes at 685
Not enough data points, reduce the window size or lowest frequency

Error in ==> timefreq at 465
[ g.timesout g.indexout ] = gettimes(frame, g.tlimits, g.timesout,
g.winsize, g.ntimesout);

4)	‘wletmethod’ can be  defined both in “optional
inputs” and “optional FFT/DFT parameters”.I would like
to select Morlet wavelets (dftfilt3). Do I need to define this in both
“optional inputs” and “optional FFT/DFT
parameters”?

5)	The input ‘type` in “Optional ITC type” has given me
some confusion. Am I correct in thinking that this function creates a
time-frequency plot for the selected epoch and nothing more??

6)	I have read this function outputs to an array named “tf”.
Is it possible to programme it to produce a graphical plot as well?

7)	Has timefreq() been replaced by another function that is better to use?

For more information about what I am trying to do see my last email below

I would be most grateful for any suggestions. I am new to EEGlab and
really struggling with this

Cheers

Ed





---------------------------- Original Message ----------------------------
Subject: How to perform Morlet wavelet freq-time transforms (Tallon Baudry)?
From:    "Edward Rooke" <Ed.Rooke at bristol.ac.uk>
Date:    Mon, September 14, 2009 5:43 pm
To:      eeglablist at sccn.ucsd.edu
--------------------------------------------------------------------------

Dear all,

I am struggling to apply a morlet wavelet frequency-time transform some
data. I would like to apply exactly the same data analysis as used my
Tallon-Baudry in the 1999 paper; Oscillatory gamma activity in humans and
its role in object representation.

I notice the function timefreq() has a 'dftfilt3; option which is labelled
exact Tallon-Baudry. But also in the new_timef() information it says it is
possible to select 'dftfilt3' for Morlet wavelets. I was keen to use
new_timef() as it is the function that is called through the GUI for
channel time-frequency plots. Are the  'dftfilt3' Morlet wavelets in
new_timef() the same as the ones used in timefreq() and in Tallon-Baudry`s
paper? Which function would be best to use?

I have just been reading through the inputs for the new_timef() function
attempting to select the values that would produce the same wavelet used
in Tallon-Baudry`s paper but I am finding this extremely difficult. This
is due to an incomplete knowledge of both the EEGlab function and the
maths behind the analysis in the paper. Does anyone know which input
values I should select for this type of analysis? (I have tried to give
more of an outline of the analysis below) Any ideas which inputs I
definitely need to change or not change? (I think there are some which are
nothing to do with the wavelet that are confusing me).

The paper says "The signal to be analyzed s(t) is convoluted by complex
Morlet’s
wavelets w(t,f) having a Gaussian shape both in the time domain (standard
deviation U), and in the frequency domain (U=1/(2pi * U)) around a
frequency
f : w ( t , f ) = A . e x p ( – t^2 / (2*U^ 2) * exp(2i pi ft) with
A being a normalization factor: A=1/(U (pi^0.5))^0.5." In previous papers
they mention the wavelet is normalized so the total energy = 1, f/U = 7
and they use a 1 Hz step. (NB:-  "U" = sigma).

I also have another, more simple question; My understanding is that the
time-frequency transform in EEGlab is built up from data averaged accross
all trials producing a plot which represents evoked responses. I would
also like to build up time-frequency plots for individual trials and then
average these to produce a plot which shows induced responses. How would I
go about doing this?

Does anyone has a script for the Tallon-Baudry analysis they would be will
to share?

I apologies if my queries are a bit trivial I am very new to EEGlab.

Best regards

Ed Rooke


-- 



-- 





More information about the eeglablist mailing list