[Eeglablist] plotphase in time-frequency analysis
James Desjardins
jdesjardins at brocku.ca
Sun Jul 11 10:57:34 PDT 2010
Hi Dorothy,
You are correct, the ITC should not be negative. The colour in the ITC
plot when you have the "plotphase" option set to "on" only indicates
the sign of the phase angle at each time point and frequency in the
figure (it looks like the newtimef option name has been changed to
"plotphasesign" to be less ambiguous). This option renders the ITC
colour bar a bit misleading, but notice how the blue to red colour
shifts mimic the phase angle shifts in the ERP plotted below the ITC
figure.
Pasting the code below to your tutorial code following your call to
newtimef will display a series of six compass plots that describe the
data in the ITC figure.
%Store single trial data from TF decomposition in vector tfdata...
[ersp,itc,powbase,times,freqs,erspboot,itcboot,tfdata]=newtimef(
mysig',2000,[-500 1500],1000,cyc,'plotphasesign','on');
text(52,20,'Complex wave');
%plot compass figure for 9.9Hz at times -21, 185, and 220 respectively...
figure;compass(tfdata(4,40,:));text(52,20,'TFDATA, t=-21ms, fq=9.9Hz');
figure;compass(tfdata(4,64,:));text(52,20,'TFDATA, t=185ms, fq=9.9Hz');
figure;compass(tfdata(4,68,:));text(52,20,'TFDATA, t=220ms, fq=9.9Hz');
%Set absolute value of complex coefficients = 1...
itcdata=tfdata./abs(tfdata);
figure;compass(itcdata(4,40,:))
hold on;compass(mean(itcdata(4,40,:),3),'r')
figure;compass(itcdata(4,64,:))
hold on;compass(mean(itcdata(4,64,:),3),'r')
figure;compass(itcdata(4,68,:))
hold on;compass(mean(itcdata(4,68,:),3),'r')
%-----------------------------------------------------------------------
The first three compass plots illustrate the complex coefficients
produced by the wavelet decomposition called from the newtimef
function. Each compass figure produces an arrow emanating from the
origin of the circle for each trial at a specific time point and
frequency. All of the compass plots present values for 9.9Hz (freqs=4)
and the first three plots illustrate time point -21ms, 185ms and then
220ms respectively. The length of each line in these figures
represents the amplitude of the signal at that time and frequency
(information used for ERSP) while the direction from the origin of the
circle represents the phase angle for that time and frequency
(information used for ITC).
ITC is calculated by setting the absolute value (length of the arrow
in compass plots) of the complex coefficients to 1 and then
calculating the average coefficient. This is illustrated in the second
set of three compass plots. These three compass plots are identical to
the first three except that the length of the blue arrows for each
trial are fixed at 1. The red line in each plot represents the average
coefficient. Notice how the length of this line corresponds to the
values in ITC plots (unambiguously when "plotphasesign" is set to
"off"), and that the length of this line is determined only by the
degree to which the phase angles cluster together across trials at a
give time point and frequency. The color shift in the ITC plots when
"plotphasesign" is set to "on" only refers to the direction of the red
line in these compass plots.
I hope that this is helpful. I appreciate the work that you are doing.
James Desjardins
Technician, MA Student
Department of Psychology, Behavioural Neuroscience
Cognitive and Affective Neuroscience Lab
Brock University
St. Catharines, ON, Canada
Quoting Dorothy Bishop <Dorothy.Bishop at psy.ox.ac.uk>:
> Thanks to those who have commented on the blog I did on ERSP.
> I am writing a bit more, but have a query about phase of ITC.
>
> I've created simple simulated waveforms, made by summing sine waves
> with some variation from trial to trial of phase, and adding a bit
> of noise, and then setting phase to be constant just for part of the
> waveform, t1 to t2.
> I was surprised to see that where I would have expected a block of
> positive ITC (ie in the interval t1-t2), I had instead a sequence of
> blocks of +ve and -ve ITC.
> Visually there is an abrupt transition from blocks of red to blocks of blue.
>
> I can get the output to look as I expect it by setting 'plotphase'
> to 'off', and I notice that in some sample scripts, this option is
> set.
>
> Does this mean that the polarity of ITC is irrelevant? I had thought
> that +ve meant phase was positively correlated from trial to trial,
> and -ve mean it was negatively correlated, but i then started to
> wonder whether the circular nature of phase meant that when
> something is totally in phase it might be equally likely to come out
> as + or -?
> Yours a bit confusedly.
> thanks
>
>
>
>
>
>
> Dorothy Bishop
> Professor of Developmental Neuropsychology
> Department of Experimental Psychology
> University of Oxford
> OX1 3UD
> Website: http://psyweb.psy.ox.ac.uk/oscci/
> Blog: http://deevybee.blogspot.com/
> tel: +44 (0)1865 271369
> fax: +44 (0)1865 281255
>
>
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>
More information about the eeglablist
mailing list