yasa.bandpower_from_psd_ndarray¶

yasa.
bandpower_from_psd_ndarray
(psd, freqs, bands=[0.5, 4, 'Delta', 4, 8, 'Theta', 8, 12, 'Alpha', 12, 16, 'Sigma', 16, 30, 'Beta', 30, 40, 'Gamma'], relative=True)[source]¶ Compute bandpowers in Ndimensional PSD.
This is a NumPyonly implementation of the
yasa.bandpower_from_psd()
function, which supports 1D arrays of shape (n_freqs), or Ndimensional arays (e.g. 2D (n_chan, n_freqs) or 3D (n_chan, n_epochs, n_freqs))New in version 0.2.0.
 Parameters
 psd
numpy.ndarray
Power spectral density of data, in uV^2/Hz. Must be a ND array of shape (…, n_freqs). See
scipy.signal.welch()
for more details. freqs
numpy.ndarray
Array of frequencies. Must be a 1D array of shape (n_freqs,)
 bandslist of tuples
List of frequency bands of interests. Each tuple must contain the lower and upper frequencies, as well as the band name (e.g. (0.5, 4, ‘Delta’)).
 relativeboolean
If True, bandpower is divided by the total power between the min and max frequencies defined in
band
(default 0.5 to 40 Hz).
 psd
 Returns
 bandpowers
numpy.ndarray
Bandpower array of shape (n_bands, …).
 bandpowers