DSPRelated.com
Forums

PSD, correct shape, wrong frequency and power frequency axes

Started by gjfe...@hotmail.com July 19, 2010
Hi...

i'm using matlab to calculate de PSD using Welch method from a EEG record. I know that the frequencies goes from 0.5 to 15 or 30 Hz (max), as seen in the following image:

http://images.elektroda.net/99_1279418678.jpg

When i calculate in matlab the psd, i'm getting this:

http://images.elektroda.net/99_1279418795.jpg

My signal is sampled at 256 samples/second, 16 bit resolution.

What am i doing wrong?? The "shape" of the spectrum seems right but the Frequency and the power frequency doesn't..

In matlab i'm typing:

h=spectrum.welch;
Hpsd=psd(h,s(:,1),'NormalizedFrequency',false); % s contains the signal
plot(Hpsd) %With this i get the last plot

It is really urgent... i need to deliver this tomorrow morning....

Thanks a lot!!
Actually both plots are similar estimates of the same signal.

As for the last plot it looks like the horizontal axis is the sample number
instead of the frequency, and you have just labeled it "Frequency (mHz)"
right? mHz? ??

If the above assumption is correct you have to create your own frequency
axis.

f=(0:N-1)*(fs/N);

where fs is the sampling frequency and N the signal length, then throw away
half of this vector to adjust to the PSD length.

Arnaldo

From: m... [mailto:m...] On Behalf Of
g...@hotmail.com
Sent: 18 July 2010 03:31
To: m...
Subject: [matlab] PSD, correct shape, wrong frequency and power frequency
axes

Hi...

i'm using matlab to calculate de PSD using Welch method from a EEG record. I
know that the frequencies goes from 0.5 to 15 or 30 Hz (max), as seen in the
following image:

http://images.elektroda.net/99_1279418678.jpg

When i calculate in matlab the psd, i'm getting this:

http://images.elektroda.net/99_1279418795.jpg

My signal is sampled at 256 samples/second, 16 bit resolution.

What am i doing wrong?? The "shape" of the spectrum seems right but the
Frequency and the power frequency doesn't..

In matlab i'm typing:

h=spectrum.welch;
Hpsd=psd(h,s(:,1),'NormalizedFrequency',false); % s contains the signal
plot(Hpsd) %With this i get the last plot

It is really urgent... i need to deliver this tomorrow morning....

Thanks a lot!!