Fitting oscillations and one-over-F (FOOOF) enquiry

Hello. I have a question about the FOOOF models on Welch's Power Spectral Density (PSD), described here:

My objective is to compute the power spectrum density for a selection of electrodes using the Welch estimation density and determine the discrete frequency with the highest power magnitude within the alpha range (e.g., see:

I've followed the tutorial, but I'm not sure how to extract the single value I need. Where is it in the Matlab structure? (see "accessing FOOOF model parameters" in the tutorial)

Thank you very much!

If you are only interested in the frequency that has the maximum power between 8 and 12 Hz, you don't need any model to your spectrum, and you probably don't need FOOOF.

You can get this directly from the PSD file:

Example based on the EEG/epilepsy tutorial:

PsdMat = in_bst_timefreq('sepi01/@rawtutorial_eeg/timefreq_psd_230117_1242.mat');
for iChannel = 1:size(PsdMat.TF,1)
    % Find the indices of the frequency bins of the alpha band
    iFreqs = find((PsdMat.Freqs >= 8) & (PsdMat.Freqs <= 12));
    % Find the maximum power
    [maxPower, maxIndex] = max(squeeze(PsdMat.TF(iChannel, :, iFreqs)));
    % Get the frequency value that has the max power
    maxFreq = PsdMat.Freqs(iFreqs(maxIndex));
    % Display the result 
    disp(sprintf('Channel %s: maxFreq=%1.2fHz, maxPower=%g', PsdMat.RowNames{iChannel}, maxFreq, maxPower));

You need to some basic skills in Matlab programming, and probably some of the information from the Scripting tutorial:

Thanks. Is there any way to do this using the GUI?

You can do it visually...