neurodsp.spectral.compute_band_ratio¶
- neurodsp.spectral.compute_band_ratio(freqs, powers, low_band, high_band, method='mean')[source]¶
Calculate band ratio measure between two predefined frequency ranges.
- Parameters
- freqs1d array
Frequency values.
- powers1d array
Power spectrum power values.
- low_bandlist of [float, float]
Band definition for the lower band.
- high_bandlist of [float, float]
Band definition for the upper band.
- method{‘mean’, ‘median’, ‘sum’}, optional
Method to use to compute power across the band.
Notes
This function is provided as a convenience function, for computing band ratio measures in order to, for example, compare to other measures. In general, band ratio measures are not recommended, as they conflate aperiodic and periodic features (see [1] for more).
References
- 1
Donoghue, T., Dominguez, J., & Voytek, B. (2020). Electrophysiological Frequency Band Ratio Measures Conflate Periodic and Aperiodic Neural Activity. ENeuro, 7(6), ENEURO.0192-20.2020. DOI: https://doi.org/10.1523/ENEURO.0192-20.2020
Examples
Compute theta/beta band ratio in a simulated signal:
>>> from neurodsp.sim import sim_combined >>> from neurodsp.spectral import compute_spectrum >>> sig = sim_combined(10, 500, {'sim_powerlaw': {}, 'sim_oscillation': {'freq': 10}}) >>> freqs, powers = compute_spectrum(sig, fs=500) >>> abs_power = compute_band_ratio(freqs, powers, [4, 8], [13, 30])