API Reference#

IRASA#

pyrasa.irasa

Functions to compute IRASA.

irasa(data, fs, band, psd_kwargs[, ...])

Computes the aperiodic and periodic components of the power spectrum from a time series using the Irregular Resampling Autocorrelation (IRASA) algorithm.

irasa_sprint(data, fs[, ch_names, band, ...])

Computes time-resolved aperiodic and periodic components of the power spectrum from a time series using the Irregular Resampling Autocorrelation (IRASA) algorithm.

IRASA MNE#

pyrasa.irasa_mne

Interface to use the IRASA algorithm with MNE objects.

irasa_raw(data[, band, duration, overlap, ...])

Separate aperiodic from periodic power spectra using the IRASA algorithm.

irasa_epochs(data[, band, hset_info])

Separate aperiodic from periodic power spectra using the IRASA algorithm for Epochs data.

Aperiodic Utilities#

pyrasa.utils.aperiodic_utils

Utilities for slope fitting.

compute_aperiodic_model(aperiodic_spectrum, ...)

Computes aperiodic parameters from the aperiodic spectrum using scipy's curve fitting function.

compute_aperiodic_model_sprint(...[, ...])

Extracts aperiodic parameters from the aperiodic spectrogram using scipy's curve fitting function.

Aperiodic Model Fitting#

pyrasa.utils.fit_funcs

Classes used to model aperiodic spectra

AbstractFitFun(freq, aperiodic_spectrum, ...)

Abstract base class for fitting functions used to model aperiodic spectra.

FixedFitFun(freq, aperiodic_spectrum, ...)

A model for fitting aperiodic activity in power spectra.

KneeFitFun(freq, aperiodic_spectrum, ...)

A model for fitting aperiodic activity in power spectra with a spectral knee.

Periodic Feature Extraction#

pyrasa.utils.peak_utils

Utilities for extracting peak parameters.

get_peak_params(periodic_spectrum, freqs[, ...])

Extracts peak parameters from the periodic spectrum obtained via IRASA.

get_peak_params_sprint(periodic_spectrum, ...)

Extracts peak parameters from a periodic spectrogram obtained via IRASA.

get_band_info(df_peaks, freq_range, ch_names)

Extract peak information within a specified frequency range from a DataFrame of peak parameters.