FFT plot accuracy & Scaling

19 ビュー (過去 30 日間)
Bledar Ferati
Bledar Ferati 2020 年 12 月 8 日
編集済み: VBBV 2020 年 12 月 9 日
Currently struggling on knowing whether my fft plot is entirely accurate. Trying to also achieve the correct scaling as well. I have looked at a lot of posts regarding this but still not achieving the same sort of scale. I am trying to achieve this:
But I am getting this:
Fs = 5000/157
data = x
L = length(data)
Y = fft(data)/L
f = Fs/2*linspace(0,1,L/2+1);
plot(f,2*abs(Y(1:L/2+1)))
xlim([0.08 0.78])
set(gca, 'YScale', 'log')
title('Duffing')
xlabel('f (Hz)')
ylabel('Amplitude')
Any help would be much appreciated
  9 件のコメント
Bledar Ferati
Bledar Ferati 2020 年 12 月 8 日
Yeah thats what I was thinking as well, in terms of accuracy its pretty much there anyways. Thank you all for the help!
VBBV
VBBV 2020 年 12 月 9 日
編集済み: VBBV 2020 年 12 月 9 日
%true
L = max(data)
f = (Fs/2)*linspace(0,1,L)
plot(f(1:L:end), 2*abs(Y(1:L:end)))
Use max value of data instead of length

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by