How we can figure the Fast Fourier Transform of a district time history data?
5 ビュー (過去 30 日間)
古いコメントを表示
Hello,
Actually, I have a discrite data set related to the acceleration time history response of a system for three consecutive harmonics. when I want to transform the data set from time doman to frequency domain using function of fft() in matlab, the amplitude of the each harmonics is really high since I have already tried this function for the simplest version below, however, the results are not true.
clc
close all
t = 0:0.01:10;
y = 10*sin(5*t);
plot(t,y)
f = [0:1:1000]/10;
plot(f, abs(fft(y)))
According to the form of the function 'f', the FFT graf should have an amplitude of 10, in the frequency of 5 Hz, however, the amplitude and the frequency of the graph extracted from FFT function is something different. Accordingly, when I want to transform my district data set to frequency domain, I encounter with the same issue.
0 件のコメント
回答 (1 件)
Bora Eryilmaz
2022 年 12 月 15 日
編集済み: Bora Eryilmaz
2022 年 12 月 20 日
Your sine function's frequency is not 5 Hz, it is 5 rad/sec. To get the frequency in Hz, multiply the argument to the sine function by 2*pi:
t = 0:0.01:10;
y = 10*sin(2*pi*5*t); % Note 2*pi.
plot(t,y)
To get the correct amplitude when using FFT, you need to scale the FFT values by N/2, where N is the number of frequency points and 2 is needed since a two-sided FFT halves the signal amplitude and distributes it at two locations:
f = [0:1:1000]/10;
N = numel(f); % Length of FFT.
plot(f, abs(fft(y))/N*2)
xlim([0 20])
3 件のコメント
Bora Eryilmaz
2022 年 12 月 20 日
Please accept this as the Accepted Answer if it solved your problem so that others can locate the answer in the future.
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!