<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<font size="4" class="">Dear Laurent,</font>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">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.</font></div>
<div class=""><font size="4" class="">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.</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">Best wishes,</font></div>
<div class=""><font size="4" class="">Jan-Mathijs</font></div>
<div class=""><br class="">
</div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class=""><br class="">
</font>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 8 Jun 2020, at 14:27, Laurent Sheybani <<a href="mailto:Laurent.Sheybani@unige.ch" class="">Laurent.Sheybani@unige.ch</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR-CH" class="">Dear Fieldtrippers,<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR-CH" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
I am trying to implement the example provided here (<a href="http://www.fieldtriptoolbox.org/tutorial/fourier/" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">http://www.fieldtriptoolbox.org/tutorial/fourier/</a>) to measure the phase
 synchronization between two signals. I followed the paragraph starting by “The coherence spectrum”.<o:p class=""></o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
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 class="">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 class=""></o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
However, when I changed the length of the signal (argument “<i class="">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 class="">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 class=""></o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Any help would be greatly appreciated !<o:p class=""></o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Thanks in advance !<o:p class=""></o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR" style="font-family: "Times New Roman", serif;" class="">-----------------------------<br class="">
Dr. Laurent Sheybani, Ph.D<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR" style="font-family: "Times New Roman", serif;" class="">Médecin interne en Neurologie Clinique<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR" style="font-family: "Times New Roman", serif;" class="">Clinique de Neurologie<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR" style="font-family: "Times New Roman", serif;" class="">Hôpitaux Universitaires de Genève<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR" style="font-family: "Times New Roman", serif;" class="">Rue Gabrielle-Perret-Gentil, 4<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR" style="font-family: "Times New Roman", serif;" class="">1205 Genève<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR" style="font-family: "Times New Roman", serif;" class="">Switzerland<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="FR-CH" class=""><o:p class=""> </o:p></span></div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>