fourrier analysis pwelch command
3 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Youssef Khmou
2013-3-3
编辑:Youssef Khmou
2013-3-3
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)
1 个评论
Youssef Khmou
2013-3-3
if you want to use several instructions with FFT , then you can try my submission : http://www.mathworks.com/matlabcentral/fileexchange/40002-psd-power-spectral-density-and-amplitude-spectrum-with-adjusted-fft
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!