Tfr_morlet temporal resolution

Dear MNE community,

I’m new to EEG time-frequency analysis using MNE-python and I’m having a problem with the temporal resolution of my data.

So, I have some epoched EEG data from -1000ms (prestimulus) to 1996ms (post-) and at a sampling rate of 250 Hz, i.e. having 750 time-points in the array, precision = 4ms.

However, after applying the mne.time_frequency.tfr_morlet() function, the output time-frequency representation seemed has a lower sampling rate (250/3 Hz), with only 250 time-points, precision = 12 ms. The length of the epoch was unchanged though ([-1000, 1988]).

I’m wondering why this problem happened and how can I fix it, i.e. keep the original temporal resolution in the tfr output.

The parameters used are as following:

import mne
from mne.time_frequency import tfr_morlet

epoched_data = epoched_data
freqs = np.around(np.arange(1, 31, 0.5),1) 
n_cycles = freqs / 3  

power = tfr_morlet(epoched_data, freqs=freqs, n_cycles=n_cycles, use_fft=True, return_itc=False, decim=3, n_jobs=1)

Many thanks,
Yichen

  • MNE-Python version: 0.21.2
  • operating system: Win10

Hello, you simply have to remove the decim parameter, which reduces the number of time points.

1 Like

Thanks a lot! That works :slight_smile:

Awesome! How did you come up with decim=3 in the first place? Did you try to follow one of our tutorials and copied the code that was used there? I’m just asking because maybe we need to clarify things a little in that respective tutorial to avoid such confusion in the future! Thank you very much.

Yes that was exactly what I did :flushed:, I think I followed this one:
https://mne.tools/stable/auto_tutorials/time-freq/plot_sensors_time_frequency.html#sphx-glr-auto-tutorials-time-freq-plot-sensors-time-frequency-py

It should be said though that I also checked the document of the tfr_morlet() function several times about its parameters, but seems I misunderstood the notes on decim and thought it was rounding the power value in the array to a certain decimal place. :flushed: (mne.time_frequency.tfr_morlet — MNE 0.22.0 documentation)

Thank you! We’ll see if this can be improved.