Unit of FFT in matlab
28 次查看(过去 30 天)
显示 更早的评论
I am working on simulation of modal analysis using Impulse hammer method testing.
I have the output of the simulation in time domain in mm.
Upon conversion to frequency domain using FFT in matlab , the amplitude of FRF is not in the range expected.
I want the FRF Amplitude to be in mm.
Please help.
0 个评论
回答(1 个)
Star Strider
2020-10-17
The fft function does not change the units of the time-domain argument it is given.
The fft function produces a double-sided Fourier transform, and that divides the energy in the signal equally between each half of the output, so it is necessary to mulitply the amplitude by 2 to approximate the amplitude of the time-domain signal in each half.
If ‘s’ is your signal vector and ‘t’ is your ttime vector (of eaually-spaced correspondiing smapling instants), this will produce an accurate representation of the single-sided Fourier transform of your signal:
Fs = 1/mean(diff(t)); % Sampling Frequency
Fn = Fs/2; % Nyquiat Frequency
L = size(D,1);
FTs = fft(s)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
plot(Fv, abs(FTs(Iv))*2) % Multiply By ‘2’ To Correct For Double-Sided Initial ‘fft’ Output
grid
xlabel('Frequency (Hz)')
ylabel('Power (dB)')
xlim([min(Fv) max(Fv)])
if you want the output to be plotted in decibels (logarithmic power) instead:
plot(Fv, mag2db(abs(FTs(Iv))*2)) % Multiply By ‘2’ To Corredt For Double-Sided Initial ‘fft’ Output
If your signal has a significant D-C (constant) offset, it will likely be necessary to subttract the mean of the signal from the rest of the signal in order to see the other peaks:
FTs = fft(s - mean(s))/L;
.
2 个评论
Nathan Batta
2021-1-31
@Star Strider In the third line of your code you use a variable D. Where does this come from? Thanks!
Star Strider
2021-1-31
The ‘D’ most likely is the data vector or matrix that was imported using readmatrix.
That information may have been in the original post, along with the file itself. (I do not remember the details of the original post, so those details and related references may have been removed in the interim. This occasionally occurs.)
另请参阅
类别
在 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!