I have list of epochs and would like to calculate the univariate feature using the compute_energy_freq_bands available from the mne-feature module.
However, the function only accept ndarray type
as an input.
def compute_energy_freq_bands(sfreq, data, freq_bands=np.array([0.5, 4., 8.,
13., 30.,
100.]),
deriv_filt=True):
ββ"Band energy (per channel).
Parameters
----------
sfreq : float
Sampling rate of the data.
data : ndarray, shape (n_channels, n_times)
To transform from epoch to ndarray representation, one of the approach I can think is by first transforming the epoch into DF using the to_data_frame
and subsequentyly converting it into numpy array. Finally, feed the final ndarray as an input into the compute_energy_freq_bands function.
But, Im curious whether there exist more straightforward or build in approach that I am not aware of to achieve similar objective