<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="">
Dear Ruoyi,
<div class=""><br class="">
</div>
<div class="">Yes! It makes sense to use the multitaper method in order to compute your spectral quantities. It is exactly the multitaper property - that it does ’spectral concentration’, or ‘controlled leakage’, or ‘variance reduction on the spectral estimates’
 (all just different wordings for the same thing) - which boosts your sensitivity to detect band-limited effects, both in power or phase-difference-consistency metrics. Long story short: if the bandwidth of your spectral component is larger than the nominal
 spectral resolution that’s provided by your single taper spectral decomposition method, then there will be a benefit of multitapering.</div>
<div class=""><br class="">
</div>
<div class="">Below is some simulation code that demonstrates this (on purpose I titrated the parameters of the simulation to show the effect). The bottom line is, that I simulate a band-limited effect of connectivity (and power) in the ‘beta’ band, between
 15 and 25 Hz. If I do a spectral decomposition using a single Hanning taper on one-second long epochs, my nominal frequency resolution will be 1 Hz per frequency bin, which means that I don’t optimally capture the whole signal (bandwidth = 10 Hz) with the
 individual frequency bins. When I use multitapers, the ‘point estimates’ of the individual frequency bins are now somewhat less precise in frequency (because of the spectral smoothing of - in this case - +/- 4 Hz), but this is compensated for by more robust
 phase difference estimates, and thus by peaks in the plv spectrum that are more convincing to the eye (and eventually also more convincing to the inferential statistical machinery).</div>
<div class=""><br class="">
</div>
<div class="">If you are convinced by this little simulation, could I ask you to consider to make this a FAQ or example script on the fieldtrip website? This will yield a more persistent record of our efforts to enlighten one another than the volatile e-mail
 discussion list. </div>
<div class=""><br class="">
</div>
<div class="">Best wishes and keep up the good work,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(34, 139, 34);" class="">
% create some dummy data</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
fsample = 1000;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(34, 139, 34);" class="">
<span style="color: #000000" class="">N       = 100000; </span>% number of samples for 100 s</div>
<p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(34, 139, 34); min-height: 12px;" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
noise(1,:) = cumsum(randn(1,N));</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
noise(2,:) = cumsum(randn(1,N));</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
noise   = noise - mean(noise,2);</div>
<p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
dat     = ft_preproc_bandpassfilter(randn(2,N), 1000, [15 25], [], <span style="color: #a020f0" class="">
'firws'</span>);</div>
<p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
 <br class="webkit-block-placeholder">
</p>
<p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
data = [];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
data.label = {<span style="color: #a020f0" class="">'chan01'</span>;<span style="color: #a020f0" class="">'chan02'</span>};</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
data.trial = {noise/8 + [0.7 0.3;0.3 0.7]*dat};</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
data.time  = {(0:(N-1))./fsample};</div>
<p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(34, 139, 34);" class="">
% chop in 1 second epochs</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg.length = 1;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
data = ft_redefinetrial(cfg, data);</div>
<p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(34, 139, 34);" class="">
% spectral analysis</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg.method = <span style="color: #a020f0" class="">'mtmfft'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg.output = <span style="color: #a020f0" class="">'fourier'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg.taper  = <span style="color: #a020f0" class="">'hanning'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg.foilim = [0 60];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
freqH = ft_freqanalysis(cfg, data);</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg.taper  = <span style="color: #a020f0" class="">'dpss'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg.tapsmofrq = 4;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
freqM = ft_freqanalysis(cfg, data);</div>
<p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(34, 139, 34);" class="">
% connectivity analysis</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg.method = <span style="color: #a020f0" class="">'plv'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
plvH = ft_connectivityanalysis(cfg, freqH);</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
plvM = ft_connectivityanalysis(cfg, freqM);</div>
<p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class="">
 <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(34, 139, 34);" class="">
% visualization</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
cfg.parameter = <span style="color: #a020f0" class="">'plvspctrm'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">
ft_connectivityplot(cfg, plvH, plvM);</div>
<div style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; min-height: 14px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; min-height: 14px;" class="">
<br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 5 Apr 2021, at 17:23, Ruoyi Cao <<a href="mailto:ruoyi.cao@mail.huji.ac.il" class="">ruoyi.cao@mail.huji.ac.il</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Dear Community: 
<div class="">My name is Ruoyi.Cao and I am a PhD student in Leon Deouell lab in Hebrew University of Jerusalem. I am currently working on Functional connectivity data during working memory delay. In the experiment, I compared 2 PLV value between two conditions. </div>
<div class="">The analysis followed the tutorial </div>
<div class=""><a href="https://www.fieldtriptoolbox.org/tutorial/connectivity/" class="">https://www.fieldtriptoolbox.org/tutorial/connectivity/</a> </div>
<div class="">For the functional connectivity, Instead of coherence, I computed the PLV value. <br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Here is the step : </div>
<div class="">1: I first get fourier coefficient of the data by </div>
<div class="">cfg           = [];<br class="">
cfg.method    =  'mtmfft';<br class="">
cfg.taper     = 'dpss';% <br class="">
cfg.output    = 'fourier';<br class="">
cfg.tapsmofrq =3<br class="">
cfg.foi          = 1:2:60<br class="">
Tapper3freqB2{1}  = ft_freqanalysis(cfg, DataB2);<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">2:Then I put this output </div>
<div class="">cfg           = [];<br class="">
</div>
<div class="">cfg.method    = 'plv';<br class="">
plvfreqB2 {P}          = ft_connectivityanalysis(cfg, Tapper3freqB2{1} );<br class="">
<br class="">
</div>
<div class="">Finally, I compared the plv value between conditions and found a robust cluster through cluster-based permutation test.  However, I cannot replicate the significant contrast between conditions if I used hanning window with standard fft for calculating
 fourier coefficient.  </div>
<div class=""><br class="">
</div>
<div class="">I am writing to ask whether it makes sense to use all the output of multi-tapper method, which is 3 times (taper number is 3) the original trial number to compute the PLV value. What is the influence of the phase estimation that muti-tapper analysis
 could cause. If the above procedure is not wrong,  why the same results can not be replicated with hanning window using one tapper. </div>
<div class=""><br class="">
</div>
<div class="">Thank you so much </div>
<div class="">Best</div>
<div class="">Ruoyi</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>