# TIME FREQUENCY ANALYSIS: power spectral density	using Welch's method

**URL:** https://mne.discourse.group/t/time-frequency-analysis-power-spectral-density-using-welchs-method/1685
**Category:** Mailing List Archive (read-only)
**Tags:** list-archive
**Created:** [December 12, 2018, 3:38pm UTC](https://mne.discourse.group/t/time-frequency-analysis-power-spectral-density-using-welchs-method/1685 "2018-12-12T15:38:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)
#### Post date: [December 12, 2018, 3:38pm UTC](https://mne.discourse.group/t/time-frequency-analysis-power-spectral-density-using-welchs-method/1685/1 "2018-12-12T15:38:26Z")

</div>

External Email - Use Caution

Hi everybody!  
I've just started using MNE and I would like to do a time frequency  
analysis (mne.time\_frequency.psd\_welch) for all frequency bands with EEG  
and MEG data: delta 1-4 Hz, theta 4-7 Hz, lower and upper alpha in 7-13 Hz  
range and lower and faster beta in 13-30Hz range.  
Using the script here below I can compute the psd for each frequency needed  
changing the fmin and the fmax, \*except for the theta\*. The script allows  
to analyse one recorded Run on EEG and MEG channels with open eyes (YO)  
and closed eyes (YF). More precisely, this script runs well and I don't  
have any error message, but in the end the final file .mat is empty. I  
tried to change the n\_fft, using 128 or 64, but nothing has changed. So I  
couldn't find out where I'm going wrong and I can't understand where is the  
difference between the theta band script and the other ones.  
Any suggestion or comments are really welcome!  
Thank you very much!  
Best,  
Jasmina

This is the script that I used :

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)
#### Post date: [December 13, 2018, 5:52am UTC](https://mne.discourse.group/t/time-frequency-analysis-power-spectral-density-using-welchs-method/1685/2 "2018-12-13T05:52:52Z")

</div>

External Email - Use Caution

hi Jasmina,

can you send us a script that uses some mne dataset eg sample?  
it's much easier for us to test and identify quickly what may go wrong  
when we can run the code.

thanks  
Alex
