Effacer les filtres
Effacer les filtres

fourrier analysis pwelch command

1 vue (au cours des 30 derniers jours)
Rune
Rune le 3 Mar 2013
I am creating a signal and storing it as vector data [E] using a sample frequency of Fs=1/0.0005.
I would like to use pwelch to analyse the signal in the frequency domain and also plot a graph with the absolute values instead of in dB and frequencies of 0-200 Hz on the other axis. I have been stumbling around with this for some time, could you tell me the exact command i need?

Réponses (1)

Youssef  Khmou
Youssef Khmou le 3 Mar 2013
Modifié(e) : Youssef Khmou le 3 Mar 2013
hi, Rune, you mean you want to use built-in spectrum , ok try this :
Fs=1000;
t=0:1/Fs:.3;
x=cos(2*pi*t*200)+randn(size(t));
Hs=spectrum.welch
F=psd(Hs,x,'Fs',Fs);
F
figure, plot(F.Frequencies,F.Data)
the dspdata or "object" F is :
F =
Name: 'Power Spectral Density'
Data: [129x1 double]
SpectrumType: 'Onesided'
NormalizedFrequency: false
Fs: 1000
Frequencies: [129x1 double]
The figure is not in dB in this case, but in case you want it as original then use semilogy :
figure, semilogy(F.Frequencies,F.Data)
% this is the same as : >>psd(Hs,x,'Fs',Fs)

Catégories

En savoir plus sur Parametric Spectral Estimation dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by