# Tfr\_morlet temporal resolution

**URL:** <https://mne.discourse.group/t/tfr-morlet-temporal-resolution/2785>\
**Category:** Support & Discussions\
**Tags:** time-frequency, eeg\
**Created:** [March 4, 2021, 4:51am UTC](https://mne.discourse.group/t/tfr-morlet-temporal-resolution/2785 "2021-03-04T04:51:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aka2333](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/aka2333/32/250_2.png) [@aka2333](https://mne.discourse.group/u/aka2333)\
**Post date:** [March 4, 2021, 4:51am UTC](https://mne.discourse.group/t/tfr-morlet-temporal-resolution/2785/1 "2021-03-04T04:51:15Z")

</div>

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:

```python
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

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [March 4, 2021, 8:01am UTC](https://mne.discourse.group/t/tfr-morlet-temporal-resolution/2785/2 "2021-03-04T08:01:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aka2333](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/aka2333/32/250_2.png) [@aka2333](https://mne.discourse.group/u/aka2333)\
**Post date:** [March 4, 2021, 8:21am UTC](https://mne.discourse.group/t/tfr-morlet-temporal-resolution/2785/3 "2021-03-04T08:21:57Z")

</div>

Thanks a lot! That works 🙂

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [March 4, 2021, 8:29am UTC](https://mne.discourse.group/t/tfr-morlet-temporal-resolution/2785/4 "2021-03-04T08:29:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![aka2333](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/aka2333/32/250_2.png) [@aka2333](https://mne.discourse.group/u/aka2333)\
**Post date:** [March 4, 2021, 8:54am UTC](https://mne.discourse.group/t/tfr-morlet-temporal-resolution/2785/5 "2021-03-04T08:54:42Z")

</div>

Yes that was exactly what I did 😳, 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](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. 😳 ([mne.time\_frequency.tfr\_morlet — MNE 0.22.0 documentation](https://mne.tools/stable/generated/mne.time_frequency.tfr_morlet.html#mne.time_frequency.tfr_morlet))

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [March 4, 2021, 9:49am UTC](https://mne.discourse.group/t/tfr-morlet-temporal-resolution/2785/6 "2021-03-04T09:49:15Z")

</div>

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