Physically correct Normalization of fft + Implementing Parseval's Theorem
显示 更早的评论
Hi. I've read endless amounts of similar stated questions on this forum, but I can't seem to find the answer to my specific question.
I would like to tranform a timesignal recorded by an accelerometer into the frequency domain. The accellerometer measured the acceleration of a hammer during impact with a floor. The Idea is to use the acceleration to calculate the force of the impact and then use the results to perform a FEM modelling of a floor. To save computation time in the FEM-model I wish to do the calculations in the frequency domain, since I'm not interested in the transient. Now, my question is as follows:
How should I scale the frequency amplitudes resulting from the fft, to get physically correct amplitudes in the frequency domain? After searching the forum and elsewhere for days I've come up with the following script:
%FFT
[x,Fs] = audioread('acceleration-file.WAV'); %x = Signal, Fs = samplingfrequency
T=1/Fs; %Sample period
L=length(x); %Signal length
df=2*Fs/L;
% FFT
NFFT=2^nextpow2(L);
Y = fft(x,NFFT)*T; %FFT of signal--> Will the multiplication with T result in a physically correct amplitude?
Ya = abs(Y); % Normalization of amplitude
f = Fs/2*linspace(0,1,L/2+1); %Frequency vector, only positive frequencies
YA= 2*Ya(1:L/2+1); %Frequency amplitudes, times two for one-sided spectrum
YA(1)=YA(1)/2; %Correction for the fact that DC doesn't occur twice
%Plot one-sided amplitude spectrum
figure
plot(f,YA)
title('Onesided amplitude spectrum')
xlabel('Frequency [Hz]')
ylabel('|y(t)|')
grid on
%Checking Parseval's Theorem
energy_x=sum(x.*conj(x)*T);
energy_YA=sum(YA.*conj(YA)*df);
diff=energy_x-energy_YA %Doesn't return 0.
Is this normalization correct? Also, is the implementation of Parseval's Theorem correct? To be clear, it's the following lines I'm really curious about(since parseval's theorem doesn't seem to hold):
%Normalizing amplitudes
Y = fft(x,NFFT)*T;
%Checking Parseval's Theorem
energy_x=sum(x.*conj(x)*T);
energy_YA=sum(YA.*conj(YA)*df);
diff=energy_x-energy_YA
Any help would be greatly appreciated, as satisfactory explanations are hard to come by out there.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!