<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        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;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:54009127;
        mso-list-type:hybrid;
        mso-list-template-ids:1400950296 -951840820 134807555 134807557 134807553 134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1
        {mso-list-id:220598630;
        mso-list-type:hybrid;
        mso-list-template-ids:209716090 254420066 134807555 134807557 134807553 134807555 134807557 134807553 134807555 134807557;}
@list l1:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l2
        {mso-list-id:1356535587;
        mso-list-type:hybrid;
        mso-list-template-ids:-1238618266 646248954 134807555 134807557 134807553 134807555 134807557 134807553 134807555 134807557;}
@list l2:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l2:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l2:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l2:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l2:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l2:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l2:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l2:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l2:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
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="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Dear Jan-Mathijs,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Thank you for this very clear answer !<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">May I ask a further question on the same topic? Why the script gives a result of ‘1’ for each frequency bin if I change the number of repetitions (‘numrpt’) to 1 ? I would expect that, even over
 1 single trial, phase synchronization can still be measured across time between two signals, and should thus not be equal to 1 (except if both signals are not identical, which is not the case) ?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">- it is true that I did not find this tutorial straight away, but I am trying different methods to calculate phase synchronization between pairs of sensors. If you have another method that I could
 use without a Fourier transform, I would greatly appreciate it ! (I already tried the inter-trial coherence of the phase differences between the 2 sensors across time).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Thanks again for your help!<br>
Laurent<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="FR">De :</span></b><span lang="FR"> fieldtrip <fieldtrip-bounces@science.ru.nl>
<b>De la part de</b> Schoffelen, J.M. (Jan Mathijs)<br>
<b>Envoyé :</b> lundi, 8 juin 2020 18:13<br>
<b>À :</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Objet :</b> Re: [FieldTrip] Phase synchronization and coherence spectrum<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:13.5pt">Dear Laurent,</span> <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt">Hmmm, interesting that you managed to find this tutorial, since it does not seem to be linked. This is a very ‘old’ tutorial (i.e. > 15 years), and hasn’t been updated for quite a while. You are indeed correct
 that the x-axis represents frequency bins, but given the way that the data are plotted, i.e. as plot(<some-vector>) these frequency bins are not reflecting physical units as expressed in Hz. Rather, the number of points in the graph just reflect the number
 of points of the fft, which is by definition equal to the number of samples in the time domain signal. These frequency bins essentially span an axis that runs from 0 Hz up to (in this case) twice the Nyquist frequency (minus a little bit), where the Nyquist
 frequency is defined as the sampling frequency divided by 2. In other words, the 100 ‘bins’ on the frequency axis run from 0 to 99 Hz, which nicely correspond to a bin width of 1 Hz per bin. As you see in the graph, the coherence peak is actually at the 11’th
 bin, coinciding with a frequency of 10 Hz.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt">Now, if you change the length of  your signal to 2.5 seconds (at a sampling frequency of 100 Hz), your signals will be 250 samples long, and by consequence the fft of the signals will also be 250 samples long.
 Now the total frequency range (i.e. 0 Hz up to 100 Hz minus a bit) will be divided into 250 bins. This indeed causes the bin with the maximum coherence to be the 26th bin, but this still corresponds to a physical frequency of 10 Hz, because the bin width has
 changed from 1 bins/Hz into 2.5 bins/Hz.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt">Best wishes,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt">Jan-Mathijs</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On 8 Jun 2020, at 14:27, Laurent Sheybani <<a href="mailto:Laurent.Sheybani@unige.ch">Laurent.Sheybani@unige.ch</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span lang="FR-CH">Dear Fieldtrippers,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="FR-CH"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I am trying to implement the example provided here (<a href="http://www.fieldtriptoolbox.org/tutorial/fourier/"><span style="color:#954F72">http://www.fieldtriptoolbox.org/tutorial/fourier/</span></a>) to measure the phase synchronization
 between two signals. I followed the paragraph starting by “The coherence spectrum”.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">From what I understand of the “Coherence spectrum” example script of this web-page, the plot that one should obtain when calling<span class="apple-converted-space"> </span><i>plot(coh)</i><span class="apple-converted-space"> </span>is a
 2-D plot with the y-axis corresponding to the coherence index between 0 to 1 and x-axis corresponding to frequencies (right ?).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">However, when I changed the length of the signal (argument “<i>len</i>”), I noticed that the frequency (x-) axis increased by the same factor (e.g. if I change<span class="apple-converted-space"> </span><i>len</i><span class="apple-converted-space"> </span>from
 1 to 2.5, the x-axis changes from 100 to 250). The coherence is no more on 10 Hz, but on 25 Hz. I must have missed something simple, but I do not understand why the results (& frequency axis) depend on the duration of the signal ? Did I miss a normalization
 somewhere ?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Any help would be greatly appreciated !<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks in advance !<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="FR" style="font-family:"Times New Roman",serif">-----------------------------<br>
Dr. Laurent Sheybani, Ph.D</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="FR" style="font-family:"Times New Roman",serif">Médecin interne en Neurologie Clinique</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="FR" style="font-family:"Times New Roman",serif">Clinique de Neurologie</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="FR" style="font-family:"Times New Roman",serif">Hôpitaux Universitaires de Genève</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="FR" style="font-family:"Times New Roman",serif">Rue Gabrielle-Perret-Gentil, 4</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="FR" style="font-family:"Times New Roman",serif">1205 Genève</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="FR" style="font-family:"Times New Roman",serif">Switzerland</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="FR-CH"> </span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif">_______________________________________________<br>
fieldtrip mailing list<br>
</span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip"><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#954F72">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</span></a><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif"><br>
</span><a href="https://doi.org/10.1371/journal.pcbi.1002202"><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#954F72">https://doi.org/10.1371/journal.pcbi.1002202</span></a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>