<div dir="ltr"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>Yes, you made a mistake in the (assumptions underlying) the implementation: the cfg.toi that you supply before ft_freqanalysis is not going to have any effect if you use ‘mtmfft’ as a method, since this method just provides a single estimate of the spectrum using the whole ’trial’ for the estimation.</div></blockquote><div><br></div>Oh, that makes perfect sense. Cheers Jan! Really appreciate it. <div><b><br clear="all"></b><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Sergio.</b><div><div><br><div></div><div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié, 15 sept 2021 a las 14:29, Schoffelen, J.M. (Jan Mathijs) via fieldtrip (<<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Sergio,<br>
> <br>
> 1) Regardless of whether I use my full time window of interest (0-1.5 s) or whether I estimate wPLI for two separate shorter time windows (0-.7 s and .7-1.5 s), the results are always identical to one another. Is this normal behaviour in wPLI analyses or is there something potentially wrong with how I've implemented it? <br>
<br>
Yes, you made a mistake in the (assumptions underlying) the implementation: the cfg.toi that you supply before ft_freqanalysis is not going to have any effect if you use ‘mtmfft’ as a method, since this method just provides a single estimate of the spectrum using the whole ’trial’ for the estimation.<br>
<br>
> 2) I notice that wPLI values are way lower for low-frequencies (4-7hz) than for higher-frequencies (8-12hz and 15-30hz). While this could be a real effect associated with my task, the fact that this result is consistent across different conditions makes me wonder whether I've done something wrong in the ft_freqanalysis configuration. <br>
<br>
I think that this is just a property of the data.<br>
<br>
Best wishes,<br>
Jan-Mathijs<br>
<br>
<br>
> <br>
> Thanks a lot in advance for any help anyone can provide! <br>
> <br>
> -----------<br>
> <br>
> cfg = [ ];<br>
> data = ft_preprocessing(cfg,rwdata);<br>
> <br>
> %resample data<br>
> cfg = [ ];<br>
> cfg.resamplefs = 250;<br>
> data = ft_resampledata(cfg, data);<br>
> <br>
> data =<br>
> struct with fields:<br>
> <br>
> fsample: 250<br>
> trial: {1×117 cell}<br>
> time: {1×117 cell}<br>
> label: {100×1 cell}<br>
> cfg: [1×1 struct]<br>
> <br>
> % next, call the ft_freqanalysis function in our source data<br>
> cfg = [ ];<br>
> cfg.output = 'fourier';<br>
> cfg.method = 'mtmfft';<br>
> cfg.taper = 'dpss';<br>
> cfg.foi = linspace(4,30,30);<br>
> cfg.tapsmofrq = 4;<br>
> cfg.toi = 0:.02:1.5; % try 0:.02:.7 and .7:.02:1.5<br>
> tf_data = ft_freqanalysis(cfg,data);<br>
> <br>
> tf_data = <br>
> struct with fields:<br>
> <br>
> label: {100×1 cell}<br>
> dimord: 'rpttap_chan_freq'<br>
> freq: [1×30 double]<br>
> fourierspctrm: [4563×100×30 double]<br>
> cumsumcnt: [117×1 double]<br>
> cumtapcnt: [117×1 double]<br>
> cfg: [1×1 struct]<br>
> <br>
> % estimate wPLI values<br>
> cfg = [ ];<br>
> cfg.method = 'wpli_debiased'; <br>
> connect_data = ft_connectivityanalysis(cfg,tf_data);<br>
> <br>
> connect_data = <br>
> struct with fields:<br>
> <br>
> label: {100×1 cell}<br>
> dimord: 'chan_chan_freq'<br>
> wpli_debiasedspctrm: [100×100×30 double]<br>
> freq: [1×30 double]<br>
> cfg: [1×1 struct]<br>
> <br>
> Best,<br>
> <br>
> Sergio.<br>
> <br>
> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
> <a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!v6GcyYsHF6VUmzXm8BB3M6rFfwWnSYCxD7hg5IzSXjBU2SvnlyfRyykO5BhpyzahCLvCtBzdjU2HPc4$" rel="noreferrer" target="_blank">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!v6GcyYsHF6VUmzXm8BB3M6rFfwWnSYCxD7hg5IzSXjBU2SvnlyfRyykO5BhpyzahCLvCtBzdjU2HPc4$</a> <br>
<br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>