fooof.fit_fooof_3d¶
- fooof.fit_fooof_3d(fg, freqs, power_spectra, freq_range=None, n_jobs=1)[source]¶
Fit FOOOF models across a 3d array of power spectra.
- Parameters
- fgFOOOFGroup
Object to fit with, initialized with desired settings.
- freqs1d array
Frequency values for the power spectra, in linear space.
- power_spectra3d array
Power values, in linear space, with shape as: [n_conditions, n_power_spectra, n_freqs].
- freq_rangelist of [float, float], optional
Desired frequency range to fit. If not provided, fits the entire given range.
- n_jobsint, optional, default: 1
Number of jobs to run in parallel. 1 is no parallelization. -1 uses all available cores.
- Returns
- fgslist of FOOOFGroups
Collected FOOOFGroups after fitting across power spectra, length of n_conditions.
Examples
Fit a 3d array of power spectra, assuming freqs and spectra are already defined:
>>> from fooof import FOOOFGroup >>> fg = FOOOFGroup(peak_width_limits=[1, 6], min_peak_height=0.1) >>> fgs = fit_fooof_3d(fg, freqs, power_spectra, freq_range=[3, 30])
Examples using fooof.fit_fooof_3d
¶
Fitting Power Spectrum Models Across 3D Arrays
Fitting Power Spectrum Models Across 3D Arrays