PSD differences between MNE and EEGLAB

Dear all,

I recently compared the spectrum (PSD) results of my SEEG data between EEGLAB and MNE. I noticed that there are minor differences between them.

Environment

  • MNE version: 1.7.1
  • OS: Windows 11

Relevant code

I use the default setup for PSD plots in both MNE and EEGLAB.

# python
import mne
raw = mne.io.read_raw_edf(sub_seeg_path, preload=True)
raw.resample(500, n_jobs=32)
raw.compute_psd(fmax=200, n_jobs=32).plot()
% matlab
EEG = pop_biosig('D:\OneDrive\working_data\sEEG_data\seeg\xxx\seeg\xxx.edf');
EEG = pop_resample( EEG, 500);
figure; pop_spectopo(EEG, 1, [0  2252998], 'EEG' , 'freqrange',[0.1 200],'electrodes','off');'

The MNE PSD plot shows multiple spikes (highlighted within the orange rectangles), while the EEGLAB plot does not. I would like to know why they are different and what these spikes mean for my data.

the default frequency resolution of MNE is higher. You should reduce the value of the n_fft parameter.

eg

raw.compute_psd(n_fft=128)

Alex

1 Like

Thanks you Alex. I checked the document about n_fft in compute_psd and psd_array_welch, but the description is quite simple. Can you tell me more about its usage/function?

Have a look at the **method_kw section of compute_psd. You can pass n_fft=X with X matching what EEGLAB uses.

thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.