Power spectral analysis

Dear MNE experts,

I’m trying analyze a clinical EEG data. The goal is to indicate reduction of the 8-15 Hz activity (maybe delta waves as well).

First, the bandpass filter is set at 0.1-70 Hz. Then, 2 seconds EEG data from each channels are detrended as one series by using mne.Evoked.detrend function.

Here, I have two questions.

  1. How can I apply a Hanning window to reduce the effect of spectral leakage and then transform each series into a frequency domain by FFT, from which the power spectrum at 8–15 Hz bandwidth can obtain?

  2. How can I smooth the 2 seconds power spectra with Welch’s method through averaging 10 series?

I would be grateful if anyone can help me how properly perform this analysis with MNE.

Thank you!!

Kutlu Kaya

Hello @kkaya and welcome to the forum!

I’m not very knowledgable re filters and FFT, but I suspect @larsoner might be able to help!

Best wishes,
Richard

1 Like

How can I apply a Hanning window to reduce the effect of spectral leakage and then transform each series into a frequency domain by FFT, from which the power spectrum at 8–15 Hz bandwidth can obtain?

You can always get the data yourself using epochs.get_data(), then multiply by numpy.hanning(data.shape[-1]), then call scipy.fft.rfft and use scipy.fft.rfftfreq to get the frequencies associated with the FFT.

However, for a simpler approach (and also more robust via using multitaper estimation rather than just a Hanning window) you could use https://mne.tools/dev/generated/mne.time_frequency.psd_multitaper.html. Either way, after this, you could average over the 8-15 Hz band.

How can I smooth the 2 seconds power spectra with Welch’s method through averaging 10 series?

I would use psd_multitaper as above to get single-epoch multitaper estimates, then average across epochs (which makes it Welch-like), then average over the frequencies in the 8-15 Hz range. At least I think this will get you what you’re looking for…

2 Likes

Thank you so much Richard and Eric for your responses.

Eric, I will work on your suggestions. All is very useful. Much appreciated!

Kutlu