필터 지우기
필터 지우기

Displacement from accelerometer data

조회 수: 111 (최근 30일)
Derek Cooper
Derek Cooper 2021년 4월 22일
댓글: William Rose 2023년 6월 28일
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

채택된 답변

Mathieu NOE
Mathieu NOE 2021년 4월 22일
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.
  댓글 수: 10
Mathieu NOE
Mathieu NOE 2023년 6월 28일
it depends of your signal quality and fft spectrum
if you have a loft of drift / ofset and very low frequency noise , then you may need more filtering
with very clean data , you may have to use only detrend but every situation is a special case
William Rose
William Rose 2023년 6월 28일
Excellent advice form @Mathieu NOE, as always.
A good general principle is to avoid detrending and filtering of your raw data as much as possible, so that you preserve the information in the data. Detrend and filter only to the extent that it is required to get reasonable looking results. Even then, consider whether the required detrending and filtering indicates some probelm with the instrumentaiton which you could correct in future experiments. It is not surprising that accelerometer signals need detrending, since even small offsets will grow parabolically when integrated twice. And for this reason, fitting a quadratic to the full length acceleration signal is a reasonable next step, if linear detrending seems to be insufficient.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by