Displacement from accelerometer data

242 views (last 30 days)
Dear everyone,
I am trying to integrate data from accelerometer measurements to determine velocity and displacement of the system. The velocity looks ok, for which i consider the following approach
acceleration = [nx1]; % Data from accelerometer
dt = [1x1]; % Length of each time-step
velocity = cumtrapz(dt,acceleration);
However, when I try to utilize the same approach once again in the aim of determining displacement of the system i get unrealistic displacements. The following code is considered
displacement = cumtrapz(dt,velocity);
I have also tried other resources and functions available on matlab community, however, no progress yet.
Plotted data

Accepted Answer

Mathieu NOE
Mathieu NOE on 22 Apr 2021
hello
the drift in the displacement is due to the fact that the velocity itself is not a zero mean signal
so if you are interested in the dynamic signal only , before each integration with cumtrapz you have to detrend your input data
help detrend
detrend Remove a polynomial trend.
Y = detrend(X) removes the best straight-line fit linear trend from the data in vector X and returns the residual in vector Y. If X is a matrix, detrend removes the trend from each column of the matrix.
  7 Comments
William Rose
William Rose on 7 Apr 2022
Nice answer by @Mathieu NOE!
We put accelerometers on ice skaters doing their jumps. If we double-integrated the signal, without highpass filtering or detrending, the doubly-integrated signal put them mny miles away by the end of their practice! We observed similar results when measuring cranium acceleration of soccer players doing headers.

Sign in to comment.

More Answers (0)

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!