# mne.time\_frequency.psd\_array\_multitaper resolution

**URL:** <https://mne.discourse.group/t/mne-time-frequency-psd-array-multitaper-resolution/9072>\
**Category:** Support & Discussions\
**Tags:** visualization\
**Created:** [July 15, 2024, 2:58pm UTC](https://mne.discourse.group/t/mne-time-frequency-psd-array-multitaper-resolution/9072 "2024-07-15T14:58:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![clgdx](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@clgdx](https://mne.discourse.group/u/clgdx)\
**Post date:** [July 15, 2024, 2:58pm UTC](https://mne.discourse.group/t/mne-time-frequency-psd-array-multitaper-resolution/9072/1 "2024-07-15T14:58:54Z")

</div>

macOS 14.5

Hi, i’m a begginer in ephy and i’m trying to find a way to change the resoluton of my psd with mne.time\_frequency.psd\_array\_multitaper() function.

My signal is 10 minutes of preproced data 1kHz (raw 30kHz). And i wanted to have a psd with one point per frequence (freq min = 0 and max =100). Actually i’ve 60001 point that i’m not very understanding why…?

There is my code :  
pp2\_psd2, frequencies\_pp2 = mne.time\_frequency.psd\_array\_multitaper(pp2.get\_data()[ch\_indices], sfreq=pp2.info[‘sfreq’], fmin=0, fmax=100)

Do you have ideas of what is my probelme come from ?

Thanks very much

---

<div class="post-metadata">

**Author:** ![SBeumer](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@SBeumer](https://mne.discourse.group/u/SBeumer)\
**Post date:** [July 16, 2024, 9:11am UTC](https://mne.discourse.group/t/mne-time-frequency-psd-array-multitaper-resolution/9072/2 "2024-07-16T09:11:23Z")

</div>

Dear Clemence,

With this function, you are not calculating a single PSD, but a time-frequency decomposition, which is giving you the frequency content over time.

It makes sense that the routine returns 60001 points since that is your time axis ( 10 minutes sampled at 1 KHz). However, there should also be a second dimension to your output such that the two-dimensional matrix returned is time \* frequency. It might help to have a look at the outputs of the function you are calling ([mne.time\_frequency.psd\_array\_multitaper — MNE 1.7.1 documentation](https://mne.tools/stable/generated/mne.time_frequency.psd_array_multitaper.html))

Have a look at the following tutorial on creating a single PSD  
[https://www.nmr.mgh.harvard.edu/mne/0.14/auto\_examples/time\_frequency/plot\_compute\_raw\_data\_spectrum.html#sphx-glr-auto-examples-time-frequency-plot-compute-raw-data-spectrum-py](https://www.nmr.mgh.harvard.edu/mne/0.14/auto_examples/time_frequency/plot_compute_raw_data_spectrum.html#sphx-glr-auto-examples-time-frequency-plot-compute-raw-data-spectrum-py)

Kind regards,  
Steven

---

<div class="post-metadata">

**Author:** ![clgdx](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@clgdx](https://mne.discourse.group/u/clgdx)\
**Post date:** [July 17, 2024, 10:03am UTC](https://mne.discourse.group/t/mne-time-frequency-psd-array-multitaper-resolution/9072/3 "2024-07-17T10:03:52Z")

</div>

Dear Steven,  
Thanks you very much for your answer.  
I was copy past the wrong function in my message but i talk about the psd\_array\_multitaper function and not tfr one.

but if i well understand the multitaper method is not adapted to compute single psd ? when i’m using the function “compute\_psd(method=‘multitaper’, fmin=0, fmax=100, tmin=None, tmax=None)” and the same with method=‘welch’, i’ve differents outputs:  
Multitaper : \<Power Spectrum (from Raw, multitaper method) | 64 channels × 60001 freqs, 0.0-100.0 Hz\>  
Welch : \<Power Spectrum (from Raw, welch method) | 64 channels × 205 freqs, 0.0-99.6 Hz\>

I don’t really understand why and the difference

Best regards  
Clémence

---

<div class="post-metadata">

**Author:** ![SBeumer](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@SBeumer](https://mne.discourse.group/u/SBeumer)\
**Post date:** [July 17, 2024, 10:24am UTC](https://mne.discourse.group/t/mne-time-frequency-psd-array-multitaper-resolution/9072/4 "2024-07-17T10:24:25Z")

</div>

Dear Clémence,

That makes sense indeed. The difference between Welch and Multitaper is that the Welch method uses a sliding window over the data, for which the calculated PSDs are averaged. This sliding window defines the maximum frequency resolution. The multitaper method does not use a sliding window but instead uses multiple tapers on the data, from which the PSD results are averaged in one PSD, giving a higher frequency resolution. Especially for this length of data with the amount of samples, the differences in resolution can thus be quite severe.

If you want to read a bit more on the frequency resolution, I think this page explains it quite well with MNE examples: [Bandpower of an EEG signal](https://raphaelvallat.com/bandpower.html)

Kind regards,  
Steven
