pyrasa.irasa_mne.irasa_raw#

pyrasa.irasa_mne.irasa_raw(data: Raw, band: tuple[float, float] = (1.0, 100.0), duration: float | None = None, overlap: float | int = 50, hset_info: tuple[float, float, float] = (1.05, 2.0, 0.05)) IrasaRaw[source]#

Separate aperiodic from periodic power spectra using the IRASA algorithm.

This function applies the Irregular Resampling Auto-Spectral Analysis (IRASA) algorithm as described by Wen & Liu (2016) to decompose the power spectrum of neurophysiological signals into aperiodic (fractal) and periodic (oscillatory) components. This function is essentially a wrapper function for pyrasa.irasa

Parameters:
  • data (mne.io.Raw) – The time-series data from which the aperiodic and periodic power spectra are extracted. This should be an instance of mne.io.Raw. The function will automatically extract relevant parameters such as sampling frequency (sfreq) and filtering settings from the mne object to make sure the model is specified correctly.

  • band (tuple of (float, float), optional, default: (1.0, 100.0)) – A tuple specifying the lower and upper bounds of the frequency range (in Hz) used for extracting the aperiodic and periodic spectra.

  • duration (float, required) – The duration (in seconds) of each segment used to calculate the power spectral density (PSD). This must be less than the total duration of the data.

  • overlap (float or int, optional, default: 50) – The overlap between segments, specified as a percentage (0-100).

  • hset_info (tuple of (float, float, float), optional, default: (1.05, 2.0, 0.05)) – Contains the range of up/downsampling factors used in the IRASA algorithm. This should be a tuple specifying the (min, max, step) values for the resampling.

Returns:

A custom object containing the separated aperiodic and periodic components of the data: - periodic: An instance of PeriodicSpectrumArray, which includes the periodic

(oscillatory) component of the power spectrum.

  • aperiodic: An instance of AperiodicSpectrumArray, which includes the aperiodic (fractal) component of the power spectrum.

Return type:

IrasaRaw

References

Wen, H., & Liu, Z. (2016). Separating Fractal and Oscillatory Components in the Power Spectrum of Neurophysiological Signal. Brain Topography, 29(1), 13–26. https://doi.org/10.1007/s10548-015-0448-0

Notes

  • Ensure that data does not contain any bad channels (data.info[‘bads’] should be empty), as this could affect the results.

  • The overlap percentage should be carefully chosen to balance between segment independence and sufficient data for analysis. A value between 0 and 100% is valid.

  • The function will raise assertions if the input parameters are not consistent with the expected formats or if the provided duration exceeds the length of the data.