<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
Hi all,</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
<br>
</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
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.</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
<br>
</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
Best wishes, and happy fooof’ing,</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
JM</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
<br>
</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
Issue:</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
<br>
</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
Hi,</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
I’m exploring the FOOOF example in FieldTrip (<a href="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" originalsrc="https://www.fieldtriptoolbox.org/example/spectral/fooof/" rel="nofollow" style="box-sizing: border-box; color: rgb(31, 35, 40); text-underline-offset: 0.2rem;">https://www.fieldtriptoolbox.org/example/spectral/fooof/</a>)
 and had a few questions.</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
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?</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
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?</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
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.</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
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.</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
Thanks a lot for your help.</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-bottom: 0px !important;">
Caren</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-bottom: 0px !important;">
<br>
</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-bottom: 0px !important;">
===============================================================</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-bottom: 0px !important;">
This is what was replied in the GH-issue:</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-bottom: 0px !important;">
<br>
</p>
<p dir="auto" style="box-sizing: border-box; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-top: 0px !important;">
Hi Caren, welcome to the FieldTrip community!</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
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.</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
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.</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
With respect to the analysis of spectral peaks etc, some nice reading material can be found here: <a href="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" originalsrc="https://www.biorxiv.org/content/10.1101/2024.09.15.613114v1" rel="nofollow" style="box-sizing: border-box; color: rgb(31, 35, 40); text-underline-offset: 0.2rem;">https://www.biorxiv.org/content/10.1101/2024.09.15.613114v1</a></p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; margin-bottom: var(--base-size-16); caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";">
++++++++++++</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-bottom: 0px !important;">
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.</p>
<p dir="auto" style="box-sizing: border-box; margin-top: 0px; caret-color: rgb(31, 35, 40); color: rgb(31, 35, 40); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin-bottom: 0px !important;">
<br>
</p>
</body>
</html>