[Eeglablist] PSD problems when using pwelch on plotting spectra and maps

Arnaud Delorme arno at ucsd.edu
Sat Jul 9 15:13:45 PDT 2011


Dear Federico,

yes, the plot you sent have sawtooths curves because of low frequency trends. I am not sure of the mathematical reason this is happening. I think it might be due to numerical inaccuracies and limitation of the size of double precision number. In any case, high passing the data at 0.5 or 1 Hz always solves the problem. We will put a note on the command line in case users experience this problem.

Best regards,

Arno

On Jun 16, 2011, at 7:48 AM, Federico Gabriel Arguissain wrote:

> Dear all,
>  
> I have been trying to plot the spectra of an EEG register (raw data) with “Plot-> Plot spectra and maps”, which uses the pwelch function. The register was sampled at 512 Hz, saved on a cnt file and imported using the ANT plugin (v1.09). I selected a 100% of data to sample and a frequency range of 0 to 256 Hz to plot. For the topoplot() function I used the default options (according to the Command window it uses: windows length  512, fft length 1024, overlap 0)
> I found out that the PSD plot showed a response more similar to the Hamming window than the PSD of the signal. Even changing the overlap the response was the same or even worse.
> It turned out that only when putting the same window length and fft length ( 512 and 512, 1024 and 1024, etc.) the PSD function had the shape of a “realistic” recording. Also removing the DC improved a lot the plot.
> My partner José Biurrun Manresa tried to obtain the PSD without using the EEGLAB interface and I obtained the same results with this register. What really improved the obtained plot was detrending the signal:
>  
> plot(10*log10(pwelch(detrend(EEG.data(1,:)))))
> Probably would be a good idea to suggest detrending the signal or removing the offset before plotting the spectra of raw data. Any suggestion on this would be great. Thanks in advance.
>  
> Best regards,
> Federico Arguissain
>  
>  
> ----------------------------------------------
> Federico Gabriel Arguissain, Ph.D. fellow
>  
> Center for Sensory-Motor Interaction - SMI
> Department of Health Science and Technology - HST
> Aalborg University
>  
> Fredrik Bajers Vej 7E-1, DK-9220 Aalborg E, Denmark
> phone:  +45 9940 9762
> email: fga at hst.aau.dk
> Skype: federico.arguissain
> http://www.smi.hst.aau.dk/
> ----------------------------------------------
>  
> <uploads-2011-06-16_1321.txt><PSD S1S1_cond1b_default_1.png><PSD S1S1_cond1b_default_enlarge.png><PSD S1S1_cond1b_nfft 512 winsize 512.png><PSD S1S1_cond1b_nfft 512 winsize 512_enlarge.png>_______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20110709/672599d9/attachment.html>


More information about the eeglablist mailing list