Raw data accelerometer to velocity

Respuestas (1)

Bjorn Gustavsson
Bjorn Gustavsson el 21 de Abr. de 2022

0 votos

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

8 comentarios

halidou touré
halidou touré el 21 de Abr. de 2022
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
halidou touré
halidou touré el 21 de Abr. de 2022
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 el 21 de Abr. de 2022
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é el 21 de Abr. de 2022
The data accelerometer and time stamp
Bjorn Gustavsson
Bjorn Gustavsson el 22 de Abr. de 2022
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é el 22 de Abr. de 2022
Okay,thanks you so much for your support
halidou touré
halidou touré el 23 de Abr. de 2022
@Bjorn Gustavsson your email please or linkdin profile

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 21 de Abr. de 2022

Comentada:

el 23 de Abr. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by