Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Graphical interpretation of magnitude (derived from fft)

1 回表示 (過去 30 日間)
Pedro Mateus
Pedro Mateus 2014 年 3 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello to all users of Matlab.
I have 20 years of temperature measurements. Twice a day (max and min) with 12 hours between measurements. To understand which frequencies are more pronounced, I applied the following code:
x = detrend(x);
n = length(x);
nfft = 2^nextpow2(n);
Fs = 1/(12*60*60);
f = 0 : Fs/(nfft-1) : Fs/2;
Y = fft(x, nfft);
Y = Y(1:((nfft+1)/2));
Y = Y/(nfft/2);
Ya = abs(Y);
figure(100)
plot(f, Ya); xlabel('Frequency (Hz)'); ylabel('|Y(f)|'); grid on
I get:
The energy is concentrated in the last frequency (Nyquist, if I'm not mistaken). Is there any error in the code? Not the first time I do this, but never for this type of data and with a sample rate (Fs) so small.
Thanks for the help

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by