COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

how to obtain frequency and power/frequency vectors using Hpsd(...) function

• Follow

```Hi all,

I have a signal vector (Fase1vuoto1) with length(Fase1vuoto1). I would like to obtain power/frequency values of each frequency component. I used Hpsd=dspdata.psd(...) function and i can obtain the Frequency versus Power/frequency plot. But, i need them in two different vectors. How can i obtain such vectors one for frequency, one for power/frequency.

Fs=5000;

nfft=2^nextpow2(length(Fase1vuoto1));
Pxx=abs(fft(Fase1vuoto1,nfft)).^2/length(Fase1vuoto1)/Fs;

% Create a one-sided spectrum
Hpsd=dspdata.psd(Pxx(1:length(Pxx)/2),'SpectrumType','Onesided','Fs',Fs);

figure(1)
plot(Hpsd)

I need to obtain all frequency values in a vector and Power/frequency values in another vector...
```
 0

```"Mehmet Demirtas" <karakartal2000@hotmail.com> wrote in message <hr1vnk\$78f\$1@fred.mathworks.com>...
> Hi all,
>
> I have a signal vector (Fase1vuoto1) with length(Fase1vuoto1). I would like to obtain power/frequency values of each frequency component. I used Hpsd=dspdata.psd(...) function and i can obtain the Frequency versus Power/frequency plot. But, i need them in two different vectors. How can i obtain such vectors one for frequency, one for power/frequency.
>
> Fs=5000;
>
> nfft=2^nextpow2(length(Fase1vuoto1));
> Pxx=abs(fft(Fase1vuoto1,nfft)).^2/length(Fase1vuoto1)/Fs;
>
> % Create a one-sided spectrum
> Hpsd=dspdata.psd(Pxx(1:length(Pxx)/2),'SpectrumType','Onesided','Fs',Fs);
>
> figure(1)
> plot(Hpsd)
>
> I need to obtain all frequency values in a vector and Power/frequency values in another vector...

No ideas at all?
```
 0

1 Replies
383 Views

Similiar Articles:

7/25/2012 2:39:50 AM