Raw data accelerometer to velocity

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

回答(1 个)

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

8 个评论

can you give a practical example please
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
thank you for your response but I don't follow you, where do these data come from, I need a detailed explanation
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.
The data accelerometer and time stamp
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.
Okay,thanks you so much for your support
@Bjorn Gustavsson your email please or linkdin profile

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by