Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Power spectral density estimation

Subject: Power spectral density estimation

From: Malik Abdul

Date: 8 Jun, 2004 04:41:05

Message: 1 of 5

Hi,

I am applying welch(pwelch) method for power spectral desnity
estimation on a discrete data(complex one).In response I am getting
some 64 values of PSD and 64 values of frequency from 0 to 2pi. For
my analysis ,I need it to be from -pi to pi. Please let me know how
to do it.

In the similar way if I get result in PSD vs frequency in Hz ,i get
only positive values form 0 to 15(total 64).Again I need it be from
- to + .

Actually I want to show doppler spread which is always double
sided(+-fd)

Thanks and regards,
A.M.Malik

Subject: Power spectral density estimation

From: AJ \"no z\" Johnson

Date: 8 Jun, 2004 06:28:07

Message: 2 of 5

"Malik Abdul" <a.malik@gmx.de> wrote in message
news:eedf927.-1@webx.raydaftYaTP...
> Hi,
>
> I am applying welch(pwelch) method for power spectral desnity
> estimation on a discrete data(complex one).In response I am getting
> some 64 values of PSD and 64 values of frequency from 0 to 2pi. For
> my analysis ,I need it to be from -pi to pi. Please let me know how
> to do it.

fftshift both the PSD and frequencies. Of course you'll want to wrap the
frequencies but subtracting 2pi from some of the points:
  f = fftshift(f);
  f = mod(f+pi,2*pi)-pi; % I think that's right

>
> In the similar way if I get result in PSD vs frequency in Hz ,i get
> only positive values form 0 to 15(total 64).Again I need it be from
> - to + .
  f = 2*pi*f/16;
  f = fftshift(f);
  f = mod(f+pi,2*pi)-pi;

>
> Actually I want to show doppler spread which is always double
> sided(+-fd)
>
> Thanks and regards,
> A.M.Malik

HTH,
aj

Subject: Power spectral density estimation

From: Greg Heath

Date: 8 Jun, 2004 06:46:23

Message: 3 of 5


"Malik Abdul" <a.malik@gmx.de> wrote in message
news:eedf927.-1@webx.raydaftYaTP...
> Hi,
>
> I am applying welch(pwelch) method for power spectral desnity
> estimation on a discrete data(complex one).In response I am getting
> some 64 values of PSD and 64 values of frequency from 0 to 2pi. For
> my analysis ,I need it to be from -pi to pi. Please let me know how
> to do it.
>
> In the similar way if I get result in PSD vs frequency in Hz ,i get
> only positive values form 0 to 15(total 64).Again I need it be from
> - to + .
>
> Actually I want to show doppler spread which is always double
> sided(+-fd)
>
> Thanks and regards,
> A.M.Malik

See the thread "fft and Pwelch"

Hope this helps.

Greg

Subject: Power spectral density estimation

From: Tevfik Yucek

Date: 8 Jun, 2004 15:20:43

Message: 4 of 5

On 2004-06-08, Malik Abdul <a.malik@gmx.de> wrote:
> Hi,
>
> I am applying welch(pwelch) method for power spectral desnity
> estimation on a discrete data(complex one).In response I am getting
> some 64 values of PSD and 64 values of frequency from 0 to 2pi. For
> my analysis ,I need it to be from -pi to pi. Please let me know how
> to do it.
>
> In the similar way if I get result in PSD vs frequency in Hz ,i get
> only positive values form 0 to 15(total 64).Again I need it be from
> - to + .
>
> Actually I want to show doppler spread which is always double
> sided(+-fd)
>
> Thanks and regards,
> A.M.Malik

I have written the following function before for the same reasons.
But it does not use welch it uses psd function in matlab which
should do the same job.

Try this, save it as powersd.m

function powersd(signal,fftsize,fs)
% Author : Tevfik Yucek
% Date : Thu Sep 26 22:36:44 2002
% Last Update : Fri Sep 27 10:16:11 2002
%
%
% This fuction plots the power spectrum density of the input signal.
%
% Inputs
% Signal whose power density will be plotted.
%

[P,F]=psd(signal,fftsize,fs);
P=P'; F=F';
% shift the psd around its center.
P=fftshift(P);
% make the x-axis from -1 to +1.
F=F-max(F)/2;

plot(F,10*log10(P));
xlabel('Frequency');
ylabel('Power Specturm Magnitude (dB)');
grid on

+++++++++++++

Hope that helps,

Tevfik

--
Tevfik Yucek <yucek at eng dot usf dot edu>
Are you happy now?

Subject: Power spectral density estimation

From: Scott Seidman

Date: 8 Jun, 2004 16:01:14

Message: 5 of 5

Tevfik Yucek <yucek@nospam.eng.usf.edu> wrote in
news:slrnccbmll.vkm.yucek@yucek.eng.usf.edu:

> On 2004-06-08, Malik Abdul <a.malik@gmx.de> wrote:
>> Hi,
>>
>> I am applying welch(pwelch) method for power spectral desnity
>> estimation on a discrete data(complex one).In response I am getting
>> some 64 values of PSD and 64 values of frequency from 0 to 2pi. For
>> my analysis ,I need it to be from -pi to pi. Please let me know how
>> to do it.
>>
>> In the similar way if I get result in PSD vs frequency in Hz ,i get
>> only positive values form 0 to 15(total 64).Again I need it be from
>> - to + .
>>
>> Actually I want to show doppler spread which is always double
>> sided(+-fd)
>>
>> Thanks and regards,
>> A.M.Malik
>
> I have written the following function before for the same reasons.
> But it does not use welch it uses psd function in matlab which
> should do the same job.
>
> Try this, save it as powersd.m
>
> function powersd(signal,fftsize,fs)
> % Author : Tevfik Yucek
> % Date : Thu Sep 26 22:36:44 2002
> % Last Update : Fri Sep 27 10:16:11 2002
> %
> %
> % This fuction plots the power spectrum density of the input signal.
> %
> % Inputs
> % Signal whose power density will be plotted.
> %
>
> [P,F]=psd(signal,fftsize,fs);
> P=P'; F=F';
> % shift the psd around its center.
> P=fftshift(P);
> % make the x-axis from -1 to +1.
> F=F-max(F)/2;
>
> plot(F,10*log10(P));
> xlabel('Frequency');
> ylabel('Power Specturm Magnitude (dB)');
> grid on
>
> +++++++++++++
>
> Hope that helps,
>
> Tevfik
>
If you invoke psd with NOVERLAP corresponding to 50% of NFFT, that pretty
much is a Welch periodogram.

Scott

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us