# What to do with fooof/specparam results (when peaks are not consistently detected)?

**URL:** <https://mne.discourse.group/t/what-to-do-with-fooof-specparam-results-when-peaks-are-not-consistently-detected/11534>\
**Category:** Support & Discussions\
**Tags:** psd\
**Created:** [October 13, 2025, 10:46am UTC](https://mne.discourse.group/t/what-to-do-with-fooof-specparam-results-when-peaks-are-not-consistently-detected/11534 "2025-10-13T10:46:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![remymasson](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/remymasson/32/3705_2.png) [@remymasson](https://mne.discourse.group/u/remymasson)\
**Post date:** [October 13, 2025, 10:46am UTC](https://mne.discourse.group/t/what-to-do-with-fooof-specparam-results-when-peaks-are-not-consistently-detected/11534/1 "2025-10-13T10:46:35Z")

</div>

> **fooof/specparam version: not particularly relevant but \>1.1 on Python**
> 
> **Prior spectral analyses made with MNE \>1.8**

Hello,

I know this is not directly MNE-related but I believe this community is the most likely to be able to answer.

Our study involves an exploratory “quantitative i/M/EEG” investigation to test if oscillatory power within each canonical frequency band significantly differs between conditions (within a single subject for this example). I am calculating power spectra using MNE and then fooof/specparam to produce periodic and aperiodic metrics without meeting any technical issues.

_Minimal code:_

```python
bands = specparam.Bands({'delta': [1, 4],
                        'theta': [4, 8],
                        'alpha': [8, 13], 
                        'beta' : [13, 30],
                        'gamma1': [30, 70],
                        'gamma2': [70, 120]})

psd = epochs.compute_psd().average()

spectrum, freqs = psd.get_data(return_freqs=True)

fg = specparam.SpectralModel(peak_width_limits=(1, 12), max_n_peaks=8, min_peak_height=0, peak_threshold=2.,aperiodic_mode='knee', verbose=True)
        
fg.fit(freqs, spectrum, [1, 150])
fg.to_df(bands)

```

My real problem is what to do with the results from the periodic components. In some frequency bands (especially when it is not alpha), a peak is not consistently detected in all trials (when below threshold) and no “peak metrics” are calculated. So my dataframe contains a lot of “NA” and I wonder how I can compare periodic peak height between my two conditions when some information is censored/thresholded. What makes it more difficult is that I don’t know the absolute value of the cutoff (in theory, it is supposed to be twice the SD of the noise floor) which prevents me from doing statistical tests tailored to “censored” data. The same problem would arise if I would be to compare conditions across subjects vs. across trials.

Where do I go from there to do meaningful statistics? Have you been in this situation?

Some publications appear to exclude subjects without peaks, or not to have this issue (esp. when focusing on alpha which is usually consistently present in some settings). Should I significantly toggle with the parameters of the specparam model?

---

<div class="post-metadata">

**Author:** ![scott-huberty](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/scott-huberty/32/2715_2.png) [@scott-huberty](https://mne.discourse.group/u/scott-huberty)\
**Post date:** [October 14, 2025, 12:07am UTC](https://mne.discourse.group/t/what-to-do-with-fooof-specparam-results-when-peaks-are-not-consistently-detected/11534/2 "2025-10-14T00:07:23Z")

</div>

> [@remymasson](#):
>
> In some frequency bands (especially when it is not alpha), a peak is not consistently detected in all trials

Hey @remymasson - This seems normal, I would actually expect this : )

The canonical power spectral density captured by EEG features a clear peak in the alpha range (or maybe the Theta range if you are looking at infant data). Thus, I’ve only ever used a tool like FOOOF to quantify an _alpha_ _peak_ (or, again, a theta peak in the case of infant data). If you are new to EEG, just look at [this](https://share.google/QHclUCTWLZP2nf3Nn) to see what I mean
