<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:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1837643575;
mso-list-type:hybrid;
mso-list-template-ids:2027296358 67567631 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang="DE" link="#0563C1" vlink="#954F72"><div class="WordSection1"><p class="MsoNormal">Dear Fieldtrippers,<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><span lang="EN-GB">I am a doctoral student and my research fields are local field potentials (LFPs). <o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB">Therefore I wanted to calculate the weighted phase lag index which is implemented in the Fieldtrip toolbox.<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB">The data I want to analyse has the following structure:<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB">data = <o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-GB"> struct with fields:<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-GB"> label: {7×1 cell}<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB"> time: {1×5 cell}<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB"> trial: {1×5 cell}<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB"> fsample: 1000 % Seven channels and five trials<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-GB">The code I produced for the wPLI is the following:<o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">%% Freqanalysis to obtain the cross spectral density</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_freq = [];</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_freq.method = </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'mtmfft'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_freq.output = </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'powandcsd'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_freq.channel = {</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'CH2'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'CH4'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">};</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_freq.keeptrials = </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'yes'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">; </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% do not return an average of all trials for subsequent wpli analysis</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_freq.taper = </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'dpss'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_freq.tapsmofrq = 1;</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_freq.foilim = [0 48];</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">freq_data = ft_freqanalysis(cfg_freq, data);</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">%% WPLI analysis</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_conn = [];</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg_conn.method = </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'wpli_debiased'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">wpli = ft_connectivityanalysis(cfg_conn, freq_data);</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">wpli = ft_checkdata(wpli, </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'cmbrepresentation'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">, </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'full'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">,</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'datatype'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">,</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'freq'</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black">);<o:p></o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p> </o:p></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-GB" style="font-family:"Courier New""><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-GB">I now have two questions:<o:p></o:p></span></p><ol style="margin-top:0cm" start="1" type="1"><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><span lang="EN-GB">Why are there negative results? I already saw this question in a previous discussion but I’m still not sure about the hundred percent correct answer.<o:p></o:p></span></li></ol><p class="MsoListParagraph"><span lang="EN-GB"><o:p> </o:p></span></p><ol style="margin-top:0cm" start="2" type="1"><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><span lang="EN-GB">The results I get look rather strange at the first glance because there are a lot of consecutive One-values which seems unrealistic to me.<br>Do you think my analysis has a mistake or the data is corrupted?<o:p></o:p></span></li></ol><p class="MsoListParagraph"><span lang="EN-GB"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-GB">Thank you very much for your help in advance and best regards<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-GB">Daniel<o:p></o:p></span></p></div></body></html>