<html>
<body>
Thanks again,<br>
I have just one last follow-up question:<br>
Why would you square the final ITC?  Tallon-Baudry et al. do not do
this in their j Neurosci. '97 publication.<br><br>
Brian<br>
At 02:02 AM 11/21/2006, Jan Mathijs Schoffelen wrote:<br>
<blockquote type=cite class=cite cite=""><font face="arial" size=2 color="#000080">Dear
Brian et al,<br>
 <br>
<hr>
<div align="center"></font></div>
<font face="tahoma" size=2><b>From:</b> Brian Roach
[<a href="mailto:Brian.Roach@yale.edu" eudora="autourl">mailto:Brian.Roach@yale.edu</a>]
<br>
<b>Sent:</b> Monday, November 20, 2006 11:56 PM<br>
<b>To:</b> Jan Mathijs Schoffelen<br>
<b>Subject:</b> Re: [FIELDTRIP] freqanalysis_wltconvol.m question<br>
</font><font face="Times New Roman, Times"> <br>
Hi, I could not get this posted to the list, and figured since you gave
most of the feedback, I would see what you think.<br><br>
thanks,<br>
Brian<br><br>
<br>
Date: Mon, 13 Nov 2006 12:09:00 -0500<br>
To: FieldTrip discussion list <FIELDTRIP@NIC.SURFNET.NL><br>
From: Brian Roach <Brian.Roach@yale.edu><br>
Subject: Re: [FIELDTRIP] freqanalysis_wltconvol.m question<br>
Bcc: Daniel Mathalon <daniel.mathalon@yale.edu><br><br>
Thanks for the advice,  I am wondering if FT users would agree that
this is an acceptable way to estimate univariate phase
coherence:<br><br>
In freqanalysis_wltconvol.m, line 283:<br>
</font><font face="Courier New, Courier">               
</font><font face="Courier New, Courier" color="#228B22">%        
powdum = (2.* abs(autspctrmacttap)  ./ data.fsample) .^ 2;<br>
</font><font face="Courier New, Courier">               
powdum = (2.*autspctrmacttap  ./ data.fsample);<br><br>
</font>1. I've commented out the power line and inserted basically the
same thing (but not squared)<br>
2. As suggested, I change cfg.keeptrials = 'yes';<br>
3. After running freqanalysis.m, in the command prompt:<br>
<x-tab>        </x-tab>itc =
abs(mean(squeeze(freq.powspctrm)./abs(squeeze(freq.powspctrm)),1))<br><br>
squeeze is used because freq.powspctrm is a 3 d matrix including sites,
times, and frequencies and in the above case I am just getting itc from 1
channel.  Does this method seem alright?  Regarding step #1
above, it seemed to make no difference whether I left the 2.* in that
equation or not, which seems consistent with an earlier e-mail that
mentioned this multiplication being tied into power, so it does not
influence phase angle.  Is that right?  Or, should it be taken
out for my purposes?<br><br>
thanks,<br>
Brian<br><br>
<font face="arial" size=2 color="#000080">This looks fine to me. Indeed
the factor of 2 does not affect the outcome, because it falls out in the
division (normalization) step.<br>
 <br>
Yours,<br>
 <br>
Jan-Mathijs<br>
 <br>
PS: you might have to think about whether or not to square the final itc,
to make it consistent with the way it is defined in the literature.<br>
 <br>
 <br>
 <br>
</font><font face="Times New Roman, Times">At 04:37 AM 11/9/2006, you
wrote:<br><br>
Dear Brian,<br><br>
Freqanalysis_wltconvol does not support fourier as an output. However,
since<br>
wavelet-analysis and fft's in the end are about the same thingy, you
could<br>
use freqanalysis_mtmconvol to achieve your goal.<br>
There is a tutorial on the fieldtrip-website which deals with this
function,<br>
and uses it in a way that it resembles a wavelet-analysis, in which
the<br>
time-frequency resolution is treated in the same way as with
standard<br>
wavelet-analysis.<br><br>
Phase-locking-value is defined in fieldtrip as a bivariate-measure, so
that<br>
means that it quantifies how consistent the phase-relation between
two<br>
channels is across trials. <br>
Inter-trial coherence is a bit an odd thingy, because the term
coherence<br>
suggests something bivariate, but the way you would like to use it,
is<br>
essentially univariate. You want to estimate how consistent the phase of
the<br>
oscillations at a particular channel is across trials.<br>
However, both measures use similar math. In fact, when you create a<br>
dummy-fourier-channel you can use the plv-option to obtain your 'itc'.
This<br>
is because in this situation, the mathematics become identical. I
would<br>
advise it like this:<br><br>
Do your freqanalysis as Robert suggested in one of his previous mails
(see<br>
below (cfg.keeptapers = 'yes')).<br>
Then create a dummy channel:<br><br>
dim                            
= size(freq.fourierspctrm;<br>
freq.fourierspctrm(:,end+1,:,:) = ones(dim([1 3 4])); <br>
freq.label = 'dummy';<br><br>
cfg = [];<br>
cfg.cohmethod = 'plv';<br>
cfg.channelcmb = channelcombination({'dummy' 'all'}, freq.label);
%should<br>
work<br><br>
itc = freqdescriptives(cfg, freq);<br><br>
Your 'itc' now is contained in the field itc.cohspctrm; <br><br>
The check whether this is correctly done is done outside
fieldtrip:<br><br>
itc2 =
abs(mean(freq.fourierspctrm./abs(freq.fourierspctrm),1));<br><br>
Yours,<br><br>
Jan-Mathijs<br><br>
<br>
-----Original Message-----<br>
From: FieldTrip discussion list
[<a href="mailto:FIELDTRIP@NIC.SURFNET.NL" eudora="autourl">mailto:FIELDTRIP@NIC.SURFNET.NL</a>]
On Behalf<br>
Of Brian Roach<br>
Sent: Wednesday, November 08, 2006 11:13 PM<br>
To: FIELDTRIP@NIC.SURFNET.NL<br>
Subject: Re: [FIELDTRIP] freqanalysis_wltconvol.m question<br><br>
Robert,<br>
Thanks for your quick reply.  I did not realize that <br>
freqanalysis_wltconvol.m allowed for 'fourier' output, but maybe I need
to <br>
download the latest version.  Or, do you mean I should use
freqanalysis_mtm <br>
instead?  Also, how does ITC differ from phase-locking value? 
I thought <br>
they were the same measure.<br>
At 04:56 PM 11/8/2006, you wrote:<br>
>Hi Brian<br>
><br>
>On 8 Nov 2006, at 21:20, Brian Roach wrote:<br>
>>eI would like to take this complex output and use it to
calculate<br>
>>phase-locking factor, but I am not sure what parts of the
power<br>
>>transformation need to be removed - just the abs() and the<br>
>>squaring?  Clarification of this line of code would be
extremely<br>
>>helpful to me.<br>
><br>
>You can use the existing code for that:<br>
><br>
>For computing the phase-locking value I suggest that you use
either<br>
>   cfg.output='fourier'<br>
>   cfg.keeptrials='yes'<br>
>   cfg.keeptapers='yes'<br>
>or<br>
>   cfg.output='fourier'<br>
>   cfg.keeptrials='yes'<br>
>   cfg.keeptapers='no' (not needed now)<br>
>   cfg.channelcmb = something, see the help<br>
>in freqanalysis.<br>
><br>
>Subsequently, use the option<br>
>   cfg.cohmethod='plv'<br>
>in freqdescriptives. In case of fourier output in freqanalysis,
you<br>
>should specify the channel combinations here.<br>
><br>
>...<br>
>Looking back at your previous mail, I see that you mean ITC and
not<br>
>PLV. The stuff above then does not apply. You can do
output=fourier<br>
>in freqanalysis and work manually on the output freq structure.
I<br>
>think that this should work<br>
><br>
>magnitude = abs(freq.fourierspctrm);<br>
>scaled    = freq.fourierspctrm ./ magnitude;<br>
>freq.itcspctrm = mean(scaled, 1);<br>
>freq = rmfield(freq, 'fourierspctrm');   % remove the
single<br>
>fourierspectrum, to avoid confusion<br>
>freq.dimord =
'chan_freq_time';          %
remove the rpt or rpttap<br>
>dimension<br>
><br>
>best regards,<br>
>Robert<br>
><br>
</font></blockquote></body>
<br>
</html>