API Documentation¶
API reference for the FOOOF module.
Table of Contents¶
Model Objects¶
Objects that manage data and fit the model to parameterize neural power spectra.
FOOOF Object¶
The FOOOF object is the base object for the model, and can be used to fit individual power spectra.
|
Model a physiological power spectrum as a combination of aperiodic and periodic components. |
FOOOFGroup Object¶
The FOOOFGroup object allows for parameterizing groups of power spectra.
|
Model a group of power spectra as a combination of aperiodic and periodic components. |
Object Utilities¶
Functions to manipulate, examine and analyze FOOOF objects, and related utilities.
|
Compare a specified aspect of FOOOF objects across instances. |
|
Average across model fits in a FOOOFGroup object. |
|
Average across model reconstructions for a group of power spectra. |
|
Combine a group of FOOOF and/or FOOOFGroup objects into a single FOOOFGroup object. |
|
Fit FOOOF models across a 3d array of power spectra. |
Data Objects¶
Objects to manage frequency bands, model information, and simulation parameters.
Bands Object¶
An object to handle frequency band definitions.
|
Frequency band definitions. |
Model Information¶
Objects to store settings, metadata and results for power spectrum models.
|
User defined settings for the fitting algorithm. |
|
Checks performed and errors raised by the model. |
|
Metadata information about a power spectrum. |
|
Model results from parameterizing a power spectrum. |
Simulation Parameters¶
Object to store information about simulated data.
|
Parameters that define a simulated power spectrum. |
Analyze Model Results¶
Functions to analyze power spectrum models and the results parameters / components.
Analyze Model Errors¶
Functions for analyzing the error of model fits.
Object Inputs
The following functions take in FOOOF objects directly, which is the recommended approach.
|
Calculate the frequency by frequency error of a model fit from a FOOOF object. |
|
Calculate the frequency by frequency error of model fits from a FOOOFGroup object. |
Array Inputs
The following functions operate on arrays of models and data, which may be useful for more custom work-flows.
|
Calculate point-wise error between original data and a model fit of that data. |
Analyze Periodic Components¶
Functions for analyzing the periodic components of model fits.
Object Inputs
The following functions take in FOOOF objects directly, which is the typical use case.
|
Extract peaks from a band of interest from a FOOOF object. |
|
Extract peaks from a band of interest from a FOOOFGroup object. |
Array Inputs
The following functions operate on arrays of peak parameters, which may be useful for more custom work-flows.
|
Extract peaks within a given band of interest. |
|
Extract peaks within a given band of interest, from peaks from a group fit. |
|
Extract the highest power peak. |
|
Extract peaks that are above a given threshold value. |
Simulation Code¶
Code & utilities for simulating power spectra.
Generate Power Spectra¶
Functions for simulating neural power spectra.
|
Generate a frequency vector. |
|
Generate a simulated power spectrum. |
|
Generate a group of simulated power spectra. |
Manage Parameters¶
Functions and objects for managing parameters for simulated power spectra.
|
Object for stepping across parameter values. |
|
Create a generator to iterate across parameter ranges. |
|
Create a generator to sample randomly from possible parameters. |
|
Create a generator that adds jitter to parameter definitions. |
|
Update the aperiodic parameter definition in a SimParams object. |
Transform Power Spectra¶
Functions for transforming power spectra.
|
Translate a spectrum, changing the offset value. |
|
Translate a simulated spectrum, updating a SimParams object. |
|
Rotate a power spectrum about a frequency point, changing the aperiodic exponent. |
|
Rotate a simulated power spectrum, updating a SimParams object. |
|
Calculate the change in offset from a given rotation. |
|
Calculate the rotation frequency between two rotated power spectra. |
Simulation Utilities¶
Utilities for simulating power spectra.
|
Set the random seed value. |
Plotting Functions¶
Visualizations.
Plot Power Spectra¶
Plots for visualizing power spectra.
|
Plot one or multiple power spectra. |
Plots for plotting power spectra with shaded regions.
|
Plot one or multiple power spectra with a shaded frequency region (or regions). |
|
Plot standard deviation or error as a shaded region around the mean spectrum. |
Plot Model Properties & Parameters¶
Plots for visualizing periodic parameters and model components.
|
Plot reconstructions of model peak fits. |
|
Plot peak parameters as dots representing center frequency, power and bandwidth. |
Plots for visualizing aperiodic parameters and model components.
|
Plot reconstructions of model aperiodic fits. |
|
Plot aperiodic parameters as dots representing offset and exponent value. |
Plots for visualizing model error.
|
Plot frequency by frequency error values. |
Plot FOOOF Objects¶
Plots for visualizing models from FOOOF objects. Note that these are the same plotting functions that can be called from FOOOF objects directly.
|
Plot the power spectrum and model fit results from a FOOOF object. |
|
Plot a figure with subplots visualizing the parameters from a FOOOFGroup object. |
Annotated Plots¶
Annotated plots that describe the model and fitting process.
|
Plot a an annotated power spectrum and model, from a FOOOF object. |
Plot a series of plots illustrating the peak search from a flattened spectrum. |
Plot Utilities & Styling¶
Plot related utilies for styling and managing plots.
Check the list of valid style arguments that can be passed into plot functions. |
|
Check whether a figure axes object is defined, and define if not. |
|
A utility to recursively plot sets of data. |
|
Save out a figure. |
Utilities¶
Utility functions and objects.
Data Utilities¶
Utilities for working with data.
|
Extract a frequency range from power spectra. |
|
Interpolate a frequency region in a power spectrum. |
|
Interpolate a frequency region across a group of power spectra. |
|
Subsample a group of power spectra. |
Parameter Utilities¶
Utilities for working with parameters
|
Compute the frequency value of the knee given the aperiodic parameter values. |
Input / Output (IO)¶
|
Load a FOOOF file into a FOOOF object. |
|
Load data from file into a FOOOFGroup object. |
Methods Reports¶
Utilities to creating methods reports.
|
Prints out a report of information required for methods reporting. |
|
Prints out a text template of methods reporting information. |