[FieldTrip] A shifting power peak artefact

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Mon Dec 12 08:59:18 CET 2022


Hi Ivo,

In general, I think one should realise that the length of the data should be chosen long enough so that spectral components-of-interest can be reliably estimated. For low frequency bins this indeed would mean that the segments should be defined long enough. I don’t think that something that you call a ‘baseline’ is the correct way forward. One should not add any random (sub)segment of data to make it longer. Ideally, the signal component-of-interest should be switched on for the duration of the whole data segment for optimal sensitivity. Adding data with absent signal may increase your spectral resolution, but does not necessarily increase the sensitivity.

Good luck discussing this with your colleagues,

Jan-Mathijs


Begin forwarded message:

From: Ivaylo Iotchev <ivaylo.iotchev at gmail.com<mailto:ivaylo.iotchev at gmail.com>>
Subject: Re: [FieldTrip] A shifting power peak artefact
Date: 12 December 2022 at 08:51:43 CET
To: "Schoffelen, J.M. (Jan Mathijs)" <janmathijs.schoffelen at donders.ru.nl<mailto:janmathijs.schoffelen at donders.ru.nl>>

Dear Jan,

thank you, indeed I discovered we made a more stupid mistake, since I followed my colleagues' suggestion to not define prestimulus for the segments (set to zero), but our demeaning and dentrending actually use/need that prestimulus-baseline. Now with the baseline back in and long enough epochs, the peaks of the 1/f and what seems our signal of interest separate from each other :) Let me know if this is something the forum should know, maybe such things get overlooked by others, my colleagues argument when we dived into the mistake was: This is not ERP, maybe we don't need the baseline. And I overlooked what the baseline was used for, because I am working on a different part of the same script... anyway, thank you!!

Bests,

Ivo

Am Mo., 12. Dez. 2022 um 08:46 Uhr schrieb Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen at donders.ru.nl<mailto:janmathijs.schoffelen at donders.ru.nl>>:
Hi Ivo,

Zero padding does not add information to your data, it only ensures that the frequency bins of the FFT’ed signals end up at different locations of the frequency axis. I don’t see why padding would affect the first energy dense peak in the spectrum after DC correction.

Multitapering implicitly assumes the spectrum to be locally white, if it isn’t - i.e. most of the time - it’s not a big problem. However, it leads to shifts in the peaks of truly bandlimited processes in the data, if those band limited signal components are living on top of 1/f. Multitapering does not minimize 1/f noise.

Jan-Mathijs


On 10 Dec 2022, at 18:06, Ivaylo Iotchev <ivaylo.iotchev at gmail.com<mailto:ivaylo.iotchev at gmail.com>> wrote:

Although, dear Jan (anyone), if I can follow up with a secondary question to your helpful answer.

Reading the link you offered me I realized it is written with an approach in mind, which I don't use. I saw on some examples of Fieldtrip scripts on the official Fieldtrip pages, that you often define the cfg.foi relative to an unpadded segment, e.g. 0.5 second long time-window is analyzed in steps of 2 Hz and starting with 2 Hz. Would your text still explain my problem if I use zero-padding to increase my resolution? More crucially, the position of the main frequency being 1/segment length behaves as if my padding plays no role, i.e. the segment length which determines the peak frequency is the unpadded length.

Finally, only if you have an idea, is the slepian sequence a legit way to minimize 1/f noise? It seems to flatten the peak, but it also spreads out the energy, and I wonder if that spread is itself noise or real signal that was otherwise not visible.

Thank you and sorry if I over-engage you on this one.

Bests,

Ivo

Am Do., 8. Dez. 2022 um 10:04 Uhr schrieb Ivaylo Iotchev <ivaylo.iotchev at gmail.com<mailto:ivaylo.iotchev at gmail.com>>:
Dankje wel!

Am Do., 8. Dez. 2022 um 10:00 Uhr schrieb Schoffelen, J.M. (Jan Mathijs) via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>:
Hi Ivo,

See: https://www.fieldtriptoolbox.org/faq/why_largest_peak_spectrum/<https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/faq/why_largest_peak_spectrum/__;!!HJOPV4FYYWzcc1jazlU!7hS8wc9fh7HjMyX-oGXc37ch6gH-QD6v1W_bkBQ-Tu4mHq5X1MMYl224IBtNAx3oFcIlBd77xBICILm6IAWPglCADnVGyZlJAvpwloM$>, and https://www.fieldtriptoolbox.org/faq/why_does_my_tfr_look_strange/<https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/faq/why_does_my_tfr_look_strange/__;!!HJOPV4FYYWzcc1jazlU!7hS8wc9fh7HjMyX-oGXc37ch6gH-QD6v1W_bkBQ-Tu4mHq5X1MMYl224IBtNAx3oFcIlBd77xBICILm6IAWPglCADnVGyZlJ39orNSw$>

Best wishes,
Jan-Mathijs




On 7 Dec 2022, at 14:40, Ivaylo Iotchev via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear community,

I want to rephrase one of my questions without first emphasizing my own theory of what is going on this time... what could cause the largest peak in the data to invariantly be at the frequency which is 1/segment length? That is, the peak is at 2 Hz when the segments are 0.5 seconds long... at 1 Hz when the segment is 1 second long etc. ...

I previously hypothesized that something might be preventing Fieldtrip from reading the sampling rate out of our data, but feel free to think outside the box I offer you, much appreciated, thanks in advance!

Bests,

Dr. Ivaylo (Ivo) Iotchev
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9LhzA8TB3KE7n_eWe9D5PTqi5pVPMGBPv--HGNKtZG-6MCON-5NxvsMQXKI22KxcwEEcVPyAFMDyqUuYK1eg5x5RlsfCYk6CSCAeLQ$

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202<https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!7hS8wc9fh7HjMyX-oGXc37ch6gH-QD6v1W_bkBQ-Tu4mHq5X1MMYl224IBtNAx3oFcIlBd77xBICILm6IAWPglCADnVGyZlJYMebXnA$>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20221212/79057aa4/attachment.htm>


More information about the fieldtrip mailing list