AW: [Eeglablist] why is the result of coherence not between 0~1?
Sarnthein Johannes
Johannes.Sarnthein at usz.ch
Tue Sep 27 23:51:51 PDT 2005
Dear wu xiang,
it is hard for me to correct your script. But I append a script that calculates coherence correctly so may have a look yourself. The script is taken from Matlab signal analysis toolbox. If you can access this toolbox somehow (~200 USD), do that by all means, it will improve your analysis tremendously.
Best,
Johannes
-----Ursprüngliche Nachricht-----
Von: eeglablist-bounces at sccn.ucsd.edu [mailto:eeglablist-bounces at sccn.ucsd.edu]Im Auftrag von wu xiang
Gesendet: Mittwoch, 21. September 2005 17:14
An: eeglablist at sccn.ucsd.edu
Betreff: [Eeglablist] why is the result of coherence not between 0~1?
Dear all:
I have write a script to caululate coherence (not the event related
coherence of eeglab) according to some papers (e.g. Sarnthein, J.
Synchronization between prefrontal and posterior association cortex
during human working memory. pnas, 95,12,0792-7096,1998). But the result
is not between 0~1. So I ask here.
The following is the simple discription of coherence:
Coherence is the frequency domain equivalent to the cross-covariance
function, which measure the similarity of two signals in frequency domain.
The folowing is the simple discription of calculation of coherence:
For signals x(i),y(i)from two electrodes, i=1:n trials.
%----------------------------
step 1: Every single trials are fourier transformed, X(i) = fft( x(i) ),
Y(i) = fft( y(i) ).
step 2: cross power spectra Sxy(i) = X(i) .* conj( Y(i) ).
(auto) power spectra Sxx(i) = X(i) .* conj( X(i) ), and Syy(i) = Y(i) .*
conj( Y(i) )
step 3: average cross power spectra and power spectra across trials
AvSxy = ( Sxy(1) + ... Sxy(i) + ... Sxy(n) ) / n
AvSxx = ( Sxx(1) + ... Sxx(i) + ... Sxx(n) ) / n
AvSyy = ( Syy(1) + ... Syy(i) + ... Syy(n) ) / n
step 4: coherence Cxy = abs(AvSxy).^2 / (AvSxx .* AvSyy)
%-----------------------------
But the result is not between 0~1.
It's interesting that for every single trials, the coherence is between
0~1. for example:
abs(Sxy(i)).^2 / (Sxx(i) .* Syy(i)). Sure, average such "single trial
coherence" across trial will results in 0~1, while it is different from
the method discribed above -- in which, the cross power spectra and
power spectra are averaged first(see step 3).
Could some one tell me what's wrong?
--
wu xiang
Cognitive neuroscience lab of life school of university of science and technology of china
Hefei, anhui, P.R.China. 230027
web-page:http://202.38.64.10/~rwfwu
You can mail to: rwfwu at ustc.edu or rwfwuwx at gmail.com
_______________________________________________
eeglablist mailing list eeglablist at sccn.ucsd.edu
http://sccn.ucsd.edu/mailman/listinfo/eeglablist
Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cohere.m
Type: application/octet-stream
Size: 2575 bytes
Desc: cohere.m
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20050928/36b63dbb/attachment.obj>
More information about the eeglablist
mailing list