<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Thomas and Will,<div><br></div><div>EEGLAB does not store the FFT for individual channels, so if you want to compute the coherence between all pairs of channels, the FFT will have to recomputed for every pair. I agree that this is far from being optimal. However, coherence analysis should be replaced by partial coherence analysis that considers the multi-variate EEG data channels (or ICA sources) and remove spurious (indirect) coherence. The SIFT toolbox (Source Information Flow Toolbox) of Tim Mullen that is built on top of EEGLAB does exactly that (and many other things).</div><div><br></div><div><a href="http://sccn.ucsd.edu/wiki/SIFT">http://sccn.ucsd.edu/wiki/SIFT</a></div><div><br></div><div>Best,</div><div><br></div><div>Arno</div><div><br><div><div>On Feb 23, 2011, at 9:08 AM, Thomas Ferree wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br></div>Will,<div><br></div><div>I am not sure how EEGLAB is implementing.  For N electrodes, there are N(N-1)/2 unique pairs.  If EEGLAB is computing coherence for every channel pair independently, depending upon the implementation, that might involve computing N(N-1)/2 FFTs for each pair, and that would be slow.  The most computationally efficient way would be to compute FFTs for each channel once and for all, then put them into an array, then read that array to compute the coherence for the pairs.  Perhaps Arno can comment on which of these approaches is being used in EEGLAB?</div>
<div><br></div><div>Also, a standard trick in any spectral analysis is to make sure that you have windows with length T equal to power of 2, e.g., 512 points not 500 points in each window, because this makes computation of FFT scale as TlogT, not T^2.</div>
<div><br></div><div>Finally, a qualitatively different way to approach the problem of many electrodes is to compute the so-called canonical coherence between sets of electrodes.  That is a reasonable approach if you are only interested in coherence between hemispheres, areas, etc.  Here are some references that might be helpful:</div>
<div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 16.4px/normal 'Times New Roman'; "><span style="font: 12.2px 'Times New Roman'"><span class="Apple-style-span" style="font-size: small; ">Daniel J. </span></span><span class="Apple-style-span" style="font-size: small;">Fletchera, </span><span style="font: 12.1px 'Times New Roman'"><span class="Apple-style-span" style="font-size: small;">Jonathan </span></span><span style="font: 11.5px 'Times New Roman'"><span class="Apple-style-span" style="font-size: small;">Rub, </span></span><span style="font: 12.4px 'Times New Roman'"><span class="Apple-style-span" style="font-size: small;">George </span></span><span style="font: 12.6px 'Times New Roman'"><span class="Apple-style-span" style="font-size: small;">Feina*  </span></span><span class="Apple-style-span" style="font-size: small;">Intra-hemispheric alpha coherence decreases </span><span style="font: 15.6px 'Times New Roman'"><span class="Apple-style-span" style="font-size: small;">with </span></span><span class="Apple-style-span" style="font-size: small;">increasing cognitive impairment in </span><span style="font: 15.8px 'Times New Roman'"><span class="Apple-style-span" style="font-size: small;">HIV </span></span><span class="Apple-style-span" style="font-size: small;">patients.  Electroencephalography </span><span style="font: 8.1px 'Courier New'"><span class="Apple-style-span" style="font-size: small;">and </span></span><span class="Apple-style-span" style="font-size: small;">clinical Neurophysiology </span><span style="font: 7.9px Arial"><span class="Apple-style-span" style="font-size: small;">102 (1997) 286-294 – Careful there is a mathematical typo in the appendix.</span></span></div>
</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 7px/normal Times; "><span class="Apple-style-span" style="font-size: small; ">A. A. Lyubushin, Jr.  </span><span class="Apple-style-span" style="font-size: small;">Analysis of Canonical Coherences in the Problems </span><span class="Apple-style-span" style="font-size: small;">of Geophysical Monitoring Izvestiya, Physics of the Solid Earth, Vol. 34, No. 1, 1998, pp. 52–58. Translated from Fizika Zemli, No. 1, 1998, pp. 59–66.</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 7px/normal Times; "><span class="Apple-style-span" style="font-size: small;"><br></span></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 7.0px Times"><span class="Apple-style-span" style="font-size: small;"></span></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; "><span class="Apple-style-span" style="font-size: small;">David J. Thomson  </span><span class="Apple-style-span" style="font-size: 7px; "><span class="Apple-style-span" style="font-size: small;"></span></span></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; "></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; ">
<span class="Apple-style-span" style="font-size: small;">GENERALIZED COHERENCES BETWEEN VECTOR DATA ON TWO SPACECRAFT  </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; ">
<span class="Apple-style-span" style="font-size: small;">1-4244-0309-X/06/$20.00 ©2006 IEEE</span></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; ">
<span class="Apple-style-span" style="font-size: small;"><br></span></div><div><br class="webkit-block-placeholder"></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times"><span class="Apple-style-span" style="font-size: 7px; "></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; ">
<span class="Apple-style-span" style="font-size: small;"></span></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.9px/normal Times; "><span class="Apple-style-span" style="font-size: small;">J. TIMMER et al, </span><span class="Apple-style-span" style="font-size: 7px; "><span class="Apple-style-span" style="font-size: small;"></span></span></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; "><span class="Apple-style-span" style="font-size: small;"></span></p>
<span class="Apple-style-span" style="font-size: small;"><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; "></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.9px/normal Times; display: inline !important; "></p></span><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 14.4px/normal Times; display: inline !important; ">
<span class="Apple-style-span" style="font-size: small;">CROSS-SPECTRAL ANALYSIS OF TREMOR TIME SERIES</span></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; ">
<span class="Apple-style-span" style="font-size: small;"></span></p><span class="Apple-style-span" style="font-size: small;"><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; ">
</p></span><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.9px/normal Times; display: inline !important; "><span class="Apple-style-span" style="font-size: small;"> </span></p>
<span class="Apple-style-span" style="font-size: small;"><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Times; display: inline !important; "></p>
</span><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 9px/normal Times; display: inline !important; "><span class="Apple-style-span" style="font-size: small;">International Journal of Bifurcation and Chaos, Vol. 10, No. 11 (2000) 2595–2610</span></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.9px Times"><span class="Apple-style-span" style="font-size: 7px; "><span class="Apple-style-span" style="font-size: small;"></span></span></p><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times"></p><div><br class="webkit-block-placeholder"></div></div><div>I have implemented a canonical coherence function that reads in the EEGLAB data structure, and am willing to share if you are interested.</div>
<div><br></div><div>Best,</div><div>Tom.</div><div><br></div><div>-- </div><div>Thomas Ferree, PhD<br>Cell: (415) 577-1285</div><div><div class="gmail_quote"><br></div><div class="gmail_quote">On Mon, Feb 21, 2011 at 10:06 AM, Will Sedley <span dir="ltr"><<a href="mailto:willsedley@gmail.com">willsedley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Dear EEGlab experts,<br>
<br>
I would be grateful for any help on this.<br>
<br>
I have a dataset of about 190 channels (which I have cut down from<br>
around 1400), and am needing to compute cross-coherence between every<br>
channel and every other channel.<br>
<br>
Presently I am running newcrossf for every channel combination, which<br>
means running it approx 18,000 times per condition. I have limited the<br>
resolution to 2 time points and 30 frequency to speed things up, but<br>
it still takes 5-10 hours to run.<br>
<br>
I am wondering if there is a way to do this a more<br>
computationally-efficient way. e.g. is there a way to compute<br>
coherence just based on the complex part of the last output argument<br>
of newtimef? Then perhaps I could just run a time/frequency<br>
decomposition once per channel, and then do some further computations<br>
to obtain the coherences.<br>
<br>
If anyone can suggest how to go about this (or an equivalent method),<br>
or even provide any code to help with this, then I would be extremely<br>
grateful.<br>
<br>
Many thanks in advance and best wishes,<br>
Will<br>
_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a><br>
</blockquote></div><br><br clear="all"><br>
</div>
_______________________________________________<br>Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a></blockquote></div><br></div></body></html>