mne_denoise.qa.geometric_mean_psd_ratio#
- mne_denoise.qa.geometric_mean_psd_ratio(freqs: ndarray, psd_before: ndarray, psd_after: ndarray, fmin: float = 1.0, fmax: float = 45.0) ndarray[source]#
Geometric mean of
psd_after / psd_beforeacross broadband.- Parameters:
- Returns:
gm_ratio – Per-channel geometric-mean ratio for 2D PSD input, or a scalar for 1D PSD input.
- Return type:
ndarray | float
Notes
Values near
1indicate small broadband spectral changes. Values below1indicate net broadband attenuation.Examples
>>> import numpy as np >>> from mne_denoise.qa import geometric_mean_psd_ratio >>> freqs = np.arange(0, 100, 0.5) >>> before = np.ones((2, len(freqs))) >>> after = before * 0.5 >>> np.allclose(geometric_mean_psd_ratio(freqs, before, after), 0.5) True