From: Mehmet Demirtas on
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...
From: Mehmet Demirtas on
"Mehmet Demirtas" <karakartal2000(a)hotmail.com> wrote in message <hr1vnk$78f$1(a)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?