How we can figure the Fast Fourier Transform of a district time history data?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Bora Eryilmaz
am 15 Dez. 2022
Bearbeitet: Bora Eryilmaz
am 20 Dez. 2022
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 Kommentare
Bora Eryilmaz
am 20 Dez. 2022
Please accept this as the Accepted Answer if it solved your problem so that others can locate the answer in the future.
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!