<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
h1
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Times New Roman";}
h2
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-style:italic;}
h3
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        line-height:200%;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoToc5, li.MsoToc5, div.MsoToc5
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Times New Roman";
        font-style:italic;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:6.0pt;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p.JMsstyle01, li.JMsstyle01, div.JMsstyle01
        {margin:0in;
        margin-bottom:.0001pt;
        line-height:200%;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-weight:bold;}
p.JMsstyle02, li.JMsstyle02, div.JMsstyle02
        {margin:0in;
        margin-bottom:.0001pt;
        line-height:200%;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-style:italic;}
p.JMsstyle03, li.JMsstyle03, div.JMsstyle03
        {margin:0in;
        margin-bottom:.0001pt;
        text-align:justify;
        line-height:200%;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-weight:bold;
        font-style:italic;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Dear Brian et al,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Brian Roach
[mailto:Brian.Roach@yale.edu] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, November 20, 2006
11:56 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Jan Mathijs Schoffelen<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [FIELDTRIP]
freqanalysis_wltconvol.m question</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Date: Mon, 13 Nov 2006 12:09:00 -0500<br>
To: <st1:PersonName w:st="on">FieldTrip discussion list</st1:PersonName>
<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>
</span></font><font face="Courier New"><span style='font-family:"Courier New"'>               
<font color=forestgreen><span style='color:forestgreen'>%        
powdum = (2.* abs(autspctrmacttap)  ./ data.fsample) .^ 2;<br>
</span></font>               
powdum = (2.*autspctrmacttap  ./ data.fsample);<br>
<br>
</span></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>        <font face="Courier New"><span
style='font-family:"Courier New"'></x-tab>itc =
abs(mean(squeeze(freq.powspctrm)./abs(squeeze(freq.powspctrm)),1))<br>
<br>
</span></font>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 color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>This looks fine to me. Indeed the factor
of 2 does not affect the outcome, because it falls out in the division
(normalization) step.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Yours,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Jan-Mathijs<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>At 04:37 AM 11/9/2006, you wrote:<br>
<br>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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: <st1:PersonName w:st="on">FieldTrip discussion list</st1:PersonName> [<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>
><o:p></o:p></span></font></p>

</div>

</body>

<br>
</html>