Raw data accelerometer to velocity

How convert accelerometer data triaxial and timestamp (file Csv) to velocity ?

回答 (1 件)

Bjorn Gustavsson
Bjorn Gustavsson 2022 年 4 月 21 日

0 投票

Acceleration is derivative of velocity, to get velocity from acceleration summation do you must.

8 件のコメント

halidou touré
halidou touré 2022 年 4 月 21 日
can you give a practical example please
Bjorn Gustavsson
Bjorn Gustavsson 2022 年 4 月 21 日
Let's mock something up for you:
w = [5 3 1];
A = [2 1 1/3];
phi = randn(1,3);
t = 0:0.01:10;
v = sum(A.*sin(t'*w+phi),2); % this is our 1-D velocity.
a = gradient(v,t); % this is what an accelerometer would measure
v_1 = cumsum(a.*gradient(t')); % First naive integration of the acceleration
v_2 = cumtrapz(t',a); % Second naive integration of the acceleration
plot(t,v,t,[v_2,v_1])
These worked fine - except the offset because of incorrect initial velocity. These naive methods will be problematic when there is noise in the accelerometer-data.
Adjust and adapt as you see fit. Investigate the effects of different noise-reducing filterings of the accelerometer data.
HTH
halidou touré
halidou touré 2022 年 4 月 21 日
thank you for your response but I don't follow you, where do these data come from, I need a detailed explanation
Bjorn Gustavsson
Bjorn Gustavsson 2022 年 4 月 21 日
You have data of acceleration in 3-D with some time-resolution. You have not shared that data even as a figure in an image. Therefore I can only guess. In order to illustrate how to go about integrating accelerometer data I made a very simple one-dimensional case where I mocked-up a time-evolution of a velocity, v, at times between 0 and 10 in steps of 0.01. For this time-varying velocity I calculated an acceleration (like the output from your accelerometer would give for one of the 3 components). In the last 3rd and 2nd last lines I show how to integrate an acceleration-series to get the corresponding velocity-variation with time. In the last line I plot the mock-up-model-velocity and the 2 integrated-from-acceleration-velocities. You could use these lines for separately for the three components of acceleration.
halidou touré
halidou touré 2022 年 4 月 21 日
The data accelerometer and time stamp
Bjorn Gustavsson
Bjorn Gustavsson 2022 年 4 月 22 日
Exactly. From your data, you use the time-stamp as t and each accelerometer-component as a in my code-snippet above, then you will get something similar to v_1 and v_2 for each separate velocity-component.
halidou touré
halidou touré 2022 年 4 月 22 日
Okay,thanks you so much for your support
halidou touré
halidou touré 2022 年 4 月 23 日
@Bjorn Gustavsson your email please or linkdin profile

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2022 年 4 月 21 日

コメント済み:

2022 年 4 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by