IRASA (Irregular Resampling Auto-Spectral Analysis) offers an alternative to specparam for separating periodic and aperiodic components — but uses a fundamentally different strategy. Instead of fitting a model to the spectrum, IRASA exploits a mathematical property: fractal (aperiodic) signals are invariant to resampling, while oscillatory peaks are not. This makes IRASA model-free and assumption-light.
The Resampling Trick
Fractal Invariance Under Stretching
Consider what happens when you resample a signal by a non-integer factor h:
Oscillatory components (narrow-band peaks) get shifted to different frequencies. A 10 Hz alpha peak resampled by h = 1.1 moves to 10/1.1 ≈ 9.09 Hz. The peak literally slides along the frequency axis.
Fractal (1/f) components follow a power law. Resampling stretches the frequency axis but the power law relationship is preserved — the 1/f shape is self-similar at all scales.
IRASA exploits this by resampling the signal at multiple h values, computing the PSD of each resampled version, and taking the geometric mean across all resampled PSDs. The oscillatory peaks get “smeared out” by the resampling while the fractal component remains stable. The result: a clean estimate of the aperiodic spectrum.
Analogy: Imagine photographing a mountain (fractal) with a flag (oscillation) planted on top. If you take photos from slightly different zoom levels and overlay them, the mountain’s shape stays the same but the flag appears blurred because it’s at a different apparent position in each photo. Averaging the photos removes the flag but preserves the mountain.
Step-by-Step Algorithm
Resample at h and 1/h, Take the Median
For each resampling factor h in a set (e.g., 1.1, 1.15, 1.2, …, 1.9):
1. Resample the signal by h (upsample) → compute PSDup
2. Resample the signal by 1/h (downsample) → compute PSDdown
3. Take the geometric mean: PSDfractal(h) = √(PSDup × PSDdown)
4. Repeat for all h values and take the median across all fractal estimates.
5. Oscillatory component = Original PSD − Fractal PSD
import yasa import numpy as np # Get data from a single channel data = raw.get_data(picks='Oz')[0] sf = raw.info['sfreq'] # Run IRASA freqs, psd_aperiodic, psd_oscillatory = yasa.irasa( data, sf=sf, band=(1, 45), hset=np.arange(1.1, 1.95, 0.05) ) # psd_aperiodic: the fractal (1/f) component # psd_oscillatory: the rhythmic peaks only print(f"Aperiodic shape: {psd_aperiodic.shape}") print(f"Oscillatory shape: {psd_oscillatory.shape}")
IRASA vs. FOOOF
When to Use Which
FOOOF / specparam
• Model-based: fits a parametric curve
• Works on a single PSD (no raw data needed)
• Returns peak parameters (CF, power, BW)
• Assumes specific 1/f functional form
• Mature, widely cited
IRASA
• Model-free: no parametric assumptions
• Needs raw time-domain data
• Returns continuous aperiodic spectrum
• Handles spectral knees naturally
• More robust for non-standard spectra
Practical advice: Use both and compare. If your spectra have clean, well-separated peaks, specparam gives you rich parametric information. If your spectra are messy, have broad humps, or deviate from a simple power-law background, IRASA may be more reliable.
The Fractal Exponent as a Biomarker
Brain State, Aging & Consciousness
The slope of the aperiodic component is increasingly used as a standalone biomarker:
• Sleep: The exponent steepens during deep sleep (more inhibition-dominant).
• Aging: The exponent flattens with age (reduced E/I balance).
• Anaesthesia: Propofol dramatically steepens the slope.
• Cognitive load: The exponent flattens during demanding tasks.
Key references: Wen & Liu (2016) — original IRASA paper. Vallat & Walker (2021) — YASA Python implementation. Schmidt et al. (2024) — PyRASA extended implementation.