Acceleration to Displacement
<p>I'm doing an experimental program. I've a smartphone fixed on the car dashboard with a support, during the travel I read from an application some value from inertial sensor.</p>

<p>Precisely I read, Accelerometer Data Time (at fixed interval) of each registration in seconds.</p>

<p>So now I would want to pass from vertical acceleration to vertical displacement, to do this I should do a double integration.</p>

<p>I tried the Euler method. From initial condition like:</p>

<p><code>v0=0.v0=0</code> this is initial velocity at time zero.</p>

<p><code>x0=0.x0=0</code> this is initial position at time zero.</p>

<p>define,</p>

<p><code>deltaT=registrationinterval.deltaT=registrationinterval</code> (in my case 0,04s)</p>

<p>then for each registration made, I do:</p>

<p><code>vi=vi−1+ayi∗deltaT.vi=vi−1+ayi∗deltaT</code></p>

<p><code>xi=xi−1+vi∗deltaT.xi=xi−1+vi∗deltaT</code></p>

<p>where <code>i</code> represents the current, and <code>i-1</code> precedent.</p>

<p>But the chart that I get is not very realistic, in fact both the speed and the displacement are only grow, instead the effect that I had to get is that the vertical displacement came out as something similar to the acceleration graph.</p>

<p>Given that applying this procedure, I also a high error, it is possible that the graph is only growing, and I do not see any kind of vertical oscillation?</p>

<p>I also read the Kalman filter can be applied in advance to clean the signal, could be a solution?</p>

<p>Or should I change the method of integration and switch to the Euler from Runge Kutta? (The last, however, I have not the slightest idea of ​​how it could be set).</p>

<p>Or someone know an algorithm that can be help me?</p>

<p>Here there is an <a href="https://www.dropbox.com/s/3ztcoscfmqyktgf/Data.xlsx?dl=0" rel="nofollow noreferrer">example</a> of the data registered if can be helpful: </p>