Acceleration to velocity via frequency domain integration
4 views (last 30 days)
Show older comments
Hello everyone,
I'm trying to integrate an acceleration signal in frequency domain, in order to obtain 'velocity vs time' curve.
To verify the frequency-domain integration I apply the method on an ideal acceleration signal that represents a simple linear motion. The same signal is also calculated using time-domain integration via "cumtrapz" command. I attach an image presenting my results for the both methods. As you can see, velocity curves have approximately the same shape however, the major difference is that the FD Integration curve is shifted down along the vertical axis. My results in FD integration are obviously unreasonable, although it should be easy to get proper results for ideal signals.
Any ideas regarding what is wrong and how to proceed?
I attach "Acceleration_Signal.mat" to open in matlab workspace before running the code.
dt=0.005; % sampling every 0.005 sec
fs=1/dt; % sampling frequency in Hz
len=5.995; % signal length in sec
N1=ceil(len/dt); % signal length in number of samples
T=(0:dt:N1*dt); % time series in sec
ax=Acceleration_Signal; %Ideal acceleration signal
%TIME-DOMAIN INTEGRATION
vx=cumtrapz(T,ax);
figure(1)
subplot(2,1,1),plot(T,ax,'LineWidth',1);title('Acceleration in m/s^2','fontsize',14);
subplot(2,1,2),plot(T,vx,'LineWidth',1);title('Velocity in m/s','fontsize',14);
sgtitle('TIME-DOMAIN INTEGRATION');
%FREQUENCY-DOMAIN INTEGRATION
AX = fft(ax); %Fourier transformation of acceleration signal
df = 1/(N1*dt); %Frequency resolution
f = df*(0:N1);
w = 2*pi*f*sqrt(-1); %Calculate omega
for i = 1:length(AX)
if f(i)~=0
VX(i) = AX(i)/w(i);
else
VX(i) = 0;
end
end
v= ifft(VX,'symmetric'); %Inverse Fourier transformation to get velocity signal
figure(2)
subplot(2,1,1),plot(T,ax,'LineWidth',1);title('Acceleration in m/s^2','fontsize',14);
subplot(2,1,2),plot(T,v,'LineWidth',1);title('Velocity in m/s','fontsize',14);
sgtitle('FREQUENCY-DOMAIN INTEGRATION');
Thank you ,
George Papazetis
0 Comments
Answers (0)
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!