Hello everyone! I’m new to MNE and I meet some difficulties in power analysis across subjects.
My aim is to get the average PSD of a time period across all subjects. For each subject, I applied tfr_morlet to the Epochs object and set " average=True " so it returned the AverageTFR object
containing the average of all TFRs across epochs. To get the average across all subjects, I know I can use the attribute to_data_frame to get the underlying data and manipulate the matrix across all subjects to get the average. But I wonder if there is a better way to do that.
Thanks very much!
Here is the code snippet:
from mne.time_frequency import tfr_morlet
freqs = np.logspace(*np.log10([2, 35]), num=15)
n_cycles = np.linspace(2,6,num=15)
power_induced = tfr_morlet(
epochs_rhy_maintain,
freqs=freqs,
n_cycles=n_cycles,
use_fft=True,
return_itc=False,
average=True #AverageTFR` containing the average of all TFRs across epochs.
)