<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style id="owaParaStyle" type="text/css">
<!--
p
{margin-top:0;
margin-bottom:0}
p
{margin-top:0;
margin-bottom:0}
p
{margin-top:0;
margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Dear Fieldtrip Community<br>
I am still stuck with the implementation of PLV. To be sure that I understand properly the principle of Phase Locking Value, I wrote a code to compute it. That code (see below) gave me the same results as ft_connectivityanalysis.<br>
<font color="000000">plv = squeeze(abs(mean(exp(1i*(angle(data.fourierspctrm(:,electrodes_1,:,:)) -angle(data.fourierspctrm(:,electrode_2,:,:)))),1)));</font><br>
(<font color="000000">data.fourierspctrm being produced by ft_freqanalysis</font>).<br>
<br>
However, I then realized that the subtraction between the two angles should be done in the complex plane as in:<br>
<font color="000000">plv = squeeze(abs(mean(exp(1i*(angle(exp(1i*(angle(data.fourierspctrm(:,electrodes_1,:,:)))) - exp(1i*(angle(data.fourierspctrm(:,electrode_2,:,:))))))),1)));</font><br>
<br>
I doubt that PLV computed through FT is wrong, but then I am circumspect since the first formula is somewhat no correct and give the same results a as ft_connectivityanalysis.<br>
I went to FT code and got confused by the way ft_connectivity_corr use the cross spectrum to compute PLV.<br>
I would greatly appreciate if someone could tell me where I am missing/misunderstanding something.<br>
Thanks you for your help,<br>
<br>
Manuel<br>
<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<hr style="width:100%; height:2px">
<br>
Manuel Mercier, PhD<br>
Research Fellow<br>
<br>
Cognitive Neurophysiology Laboratory,<br>
Children’s Evaluation and Rehabilitation Center (CERC),<br>
Departments of Pediatrics and Neuroscience<br>
Albert Einstein College of Medicine,<br>
1225 Morris Park Avenue<br>
Bronx , NY 10461<br>
<br>
phone: +1 (718) 862 1859<br>
fax: +1 (718) 862 1807</div>
</div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF910756"><font color="#000000" face="Tahoma" size="2"><b>From:</b> fieldtrip-bounces@science.ru.nl [fieldtrip-bounces@science.ru.nl] on behalf of Manuel Mercier [manuel.mercier@einstein.yu.edu]<br>
<b>Sent:</b> Friday, June 28, 2013 4:43 PM<br>
<b>To:</b> fieldtrip@science.ru.nl<br>
<b>Subject:</b> [FieldTrip] PLV formula<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Dear Fieldtripers<br>
Sometime ago I wrote for myself a function that was computing PLV and some related non parametric statistics.<br>
(Phase Locking Value as define as the mean across trials of the phase angle difference recorded at two loci ; based on Lachaux et al., 1999, HBM).<br>
I implemented PLV in matlab using the following formula:<br>
<i><font color="0000FF">plv = squeeze(abs(mean(exp(1i*(angle(data.fourierspctrm(:,cmb(1),:,:)) ...<br>
-angle(data.fourierspctrm(:,cmb(2),:,:)))),1)));</font></i><br>
with cmb(1) and cmb(2) being the indices of the electrodes of interest (between which PLV is computed).<br>
I compared my results with the ft_connectivityanalysis function from Fieldtrip and the results were exactly the same.<br>
So far so good.<br>
<br>
But I recently went back to my code, and I was a little bit confused.<br>
Since I was dealing with angles, I though that the best way to do the subtraction should be done in the complex plane<br>
Like:<br>
<i><font color="0000FF">plv = squeeze(abs(mean(exp(1i*(angle(exp(1i*(angle(data.fourierspctrm(:,cmb(1),:,:)))) ...<br>
</font> <font color="0000FF"> - exp(1i*(angle(data.fourierspctrm(:,cmb(2),:,:))))))),1)));</font></i><br>
(for instance if the two angles: pi/2 and -pi/2 the direct subtraction will give pi,<br>
whereas in the complex plan it will be pi/2 - with the norm x2).<br>
<br>
The result I got with this code is obviously different from the previous one, and what I got from Fieldtrip.<br>
I went back to the archive of the mailing list but didn't find a clear answer to my point. Does anyone can enlighten me ?<br>
Thanks !<br>
<br>
Manuel<br>
<br>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>