mne_features.univariate.compute_pow_freq_bands

mne_features.univariate.compute_pow_freq_bands(sfreq, data, freq_bands=array([0.5, 4., 8., 13., 30., 100.]), normalize=True, ratios=None, ratios_triu=False, psd_method='welch', log=False, psd_params=None)

Power Spectrum (computed by frequency bands).

Parameters
sfreqfloat

Sampling rate of the data.

datandarray, shape (n_channels, n_times)
freq_bandsndarray or dict (default: np.array([.5, 4, 8, 13, 30, 100]))

The parameter freq_bands should be either a ndarray with shape (n_freq_bands + 1,) or (n_freq_bands, 2) or a dict. If ndarray with shape (n_freq_bands + 1,), the entries define contiguous frequency bands as follows: the i-th frequency band is defined as: [freq_bands[i], freq_bands[i + 1]] (0 <= i <= n_freq_bands - 1). If ndarray with shape (n_freq_bands, 2), the rows of freq_bands define non-contiguous frequency bands. If dict, the keys should be strings (names of the frequency bands) and the values, the corresponding bands (as ndarray with shape (2,) or list of length 2). When freq_bands is of type dict, the keys are used to generate the feature names (only used when features are extracted with return_as_df=True). The values of freq_bands should be between 0 and sfreq / 2 (the Nyquist frequency) as the function uses the one-sided PSD.

normalizebool (default: True)

If True, the average power in each frequency band is normalized by the total power.

ratiosstr or None (default: None)

If not None, the possible values for the parameter ratios are: all or only. If all, the function will return the power (computed in the given frequency bands) as well as the ratios between power in different frequency bands. Depending on the value of ratios_triu, either all possible pairs of distinct frequency bands are considered, or only the upper triangle of the matrix of pairs. If only, the function returns only the ratios of power in bands. If None, no ratio is computed.

ratios_triubool (default: False)

If False, include all possible pairs when computing ratios (e.g., alpha/beta and beta/alpha) yielding n_freq_bands * (n_freq_bands - 1) ratios. If True, only include the (upper) triangle of the square matrix, yielding n_freq_bands * (n_freq_bans - 1) / 2 ratios. Ignored if ratios is None.

psd_methodstr (default: ‘welch’)

Method used for the estimation of the Power Spectral Density (PSD). Valid methods are: 'welch', 'multitaper' or 'fft'.

logbool (default: False)

If True, the average power in each frequency band is transformed with a base-10 logaritm. Ratios (computed if ratios is specified) will be computed as log-ratios, i.e., the ratio of bands A and B will be log(pow_band_A / pow_band_B) = log_pow_band_A - log_pow_band_B.

psd_paramsdict or None (default: None)

If not None, dict with optional parameters (welch_n_fft, welch_n_per_seg, welch_n_overlap) to be passed to mne_features.utils.power_spectrum(). If None, default parameters are used (see doc for mne_features.utils.power_spectrum()).

Returns
outputndarray, shape (n_channels * (n_freqs - 1),)

Notes

Alias of the feature function: pow_freq_bands. See [1].

References

1

Teixeira, C. A. et al. (2011). EPILAB: A software package for studies on the prediction of epileptic seizures. Journal of Neuroscience Methods, 200(2), 257-271.

Fork me on GitHub