[FieldTrip] question about TTFKAFOOOF (The Technique Formerly Known As FOOOF)
Schoffelen, J.M. (Jan Mathijs)
janmathijs.schoffelen at donders.ru.nl
Mon Sep 15 09:24:13 CEST 2025
Hi all,
For reference, somebody asked a question on the FieldTrip github repo, but since this is not widely read (and commented on), I decided to post it here, for future reference.
Best wishes, and happy fooof’ing,
JM
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Issue:
Hi,
I’m exploring the FOOOF example in FieldTrip (https://www.fieldtriptoolbox.org/example/spectral/fooof/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Fexample%2Fspectral%2Ffooof%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C17274ce619e94051513708ddf428df46%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638935178551993122%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=22pmVWDD5af3uwKT4IAE7TDVNaUEJSqUbhC%2BO2slX5c%3D&reserved=0>) and had a few questions.
My understanding is that in the official FOOOF (specparam) implementation, the algorithm identifies and removes peaks as part of the workflow. The FieldTrip documentation mentions it uses a reimplementation of FOOOF, but I don’t see an explicit description of the peak removal step. Could you clarify whether the FieldTrip implementation follows this full sequence, including peak removal, or if peaks are handled differently?
Additionally, would you consider the FieldTrip implementation sufficient for typical analyses of aperiodic components, or would it be better to use the MATLAB wrapper in the fooof_mat repository or the Python FOOOF implementation for more accurate peak handling?
Most previous papers I’ve seen have used the Python toolbox, but I’m not very familiar with Python and was hoping to understand if FieldTrip’s MATLAB approach could be a reliable alternative.
I wasn’t sure if this is the right place to ask, as I couldn’t find a direct way to reach out to FieldTrip developers of FOOOF, but I’d greatly appreciate any guidance anyone can provide.
Thanks a lot for your help.
Caren
===============================================================
This is what was replied in the GH-issue:
Hi Caren, welcome to the FieldTrip community!
The FOOOF implementation that is 'accessible' in FieldTrip was taken from the Brainstorm software, so perhaps details can be found on their documentation, or by studying the code directly (in fieldtrip/external/brainstorm I think). Not sure how actively this MATLAB version is being developed/maintained. The main advocates/developers of the technique formerly known as FOOOF (these days: specparam) are doing their development in Python mostly I believe, so their bleeding edge code / peak detection heuristics are probably only implemented there. Whether or not these are needed to answer your scientific questions, or whether the heuristics in older version of the code are good enough, I don't know.
With all this being said, FieldTrip also supports the 'irasa' method, which aims at separating band-limited periodic signal components from 'aperiodic' (1/f-type) background components from the signals' power spectra. The output of this algorithm can subsequently also be used to fit peaks/slopes etc.
With respect to the analysis of spectral peaks etc, some nice reading material can be found here: https://www.biorxiv.org/content/10.1101/2024.09.15.613114v1<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.biorxiv.org%2Fcontent%2F10.1101%2F2024.09.15.613114v1&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C17274ce619e94051513708ddf428df46%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638935178552031736%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=06bCLrwZduwQbWgfS7isFkjsgGB1qL0iPmHOdeWZpS4%3D&reserved=0>
++++++++++++
For future reference, indeed we'd rather have people posting these types of questions on our FieldTrip discussion e-mail list. The github issues are not really intended for one-to-one Q&A, because it's our philosophy that we can all learn from each other, many eyes reading along is good for more efficient knowledge transfer. So, if you don't mind and have a few minutes to spare, please consider signing up there and send an e-mail with a compilation of your question and my answer. This is for future reference, and allows others to chime in as well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250915/ea6ea0c7/attachment.htm>
More information about the fieldtrip
mailing list