<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" 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)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Palatino Linotype";
        panose-1:2 4 5 2 5 5 5 3 3 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@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=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'>Hello,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'>I have just subscribed
to the eeglablist, so it might still be necessary to respond directly to my
e-mail in order for me to get a response.  <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'>I have a question
regarding the newcrossf function that is used to calculate coherences.  I
am trying to calculate the coherence between two time series without any
epoch.  The time series in this case are actually two voxel time courses
from an fMRI image, with a sampling rate of .67 Hz and a total length of 288
time points.  When I run the newcrossf using these timecourses I get a
very reasonable looking coherence map, however the values are not normalized. 
I have now spent a fair amount of time searching around the internet for
resources on calculating coherence values and it seems that the proper formula
is coh(x) = |Sxy| ^2 / Sxx(f)Syy(f) (or the square root of that) where Sxy is
the cross spectrum between x and y and Sxx and Syy the autospectra.  From
the discussion at <a href="http://www.dsprelated.com/showmessage/49505/1.php">http://www.dsprelated.com/showmessage/49505/1.php</a>,
it seems to make sense to me that Sxy can be computed as Sxy(f) = X(f)Y’(f)
where X and Y are the fourier transforms of the two time series and Y’
the complex conjugate of Y.  This seems to me to be born out by the code
used to calculate the unnormalized coherence values: coherres = alltfX .* conj(alltfY)
where alltfX and alltfY are the time/frequency decompositions of the two time
series as computed by the timefreq function in EEGLAB.  Sxx(f) should
therefore be computed as Sxx(f) = X(f)X’(f), and the equation for
coherence should become (in Matlab notation) coherres = (alltfX .*  alltfY)
./ sqrt(  (abs(alltfX) .^2) .*  (abs(alltfY) .^2)    ). 
Running this however results in all of the coherences becoming 1.  It is
also interesting to meet that virtually this exact formula (it also contains
summing over a third dimension which I do not believe exists in my runs) is
found in the ‘coher’ conditions.  It seems to meet from
looking at the code that this ‘coher’ condition is never or rarely
satisfied, and when I forced EEGLAB to run under the ‘coher’
condition it produced the exact same result of coherences of value 1.  <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'>So my question is
basically how it is possible to normalize the coherences in the newcrossf
function and what is wrong with my formula.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'>My call to newcrossf
is as follows:  newcrossf(t1, t2, 288, [0 (288*1500)], .67, 0)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'>Any responses would be
very helpful!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'>Thanks,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Palatino Linotype"><span
style='font-size:11.0pt;font-family:"Palatino Linotype"'>Sam Norman-Haignere <o:p></o:p></span></font></p>

</div>

</body>

</html>