I've tracked the movement of an input method resulting in this dataset. All data is tracked with equal intervals of $100 \, \mathrm{ms}$. For example an iteration value of 4 means that this is the position of the input device at $400 \, \mathrm{ms}$ from starting the exercise.

Now I want to verify the smoothness of this input by calculating its mean jerk, but I'm not sure if this is allowed, and my algorithm is ok.

Based on $v=\frac{s}{t}$, I can calculate the mean velocity between every succeeding points in space. I would use a $t$ value of $0.1 \, \mathrm{s}$ here.

Based on these average speeds between points I'm able to calculate the acceleration in each point by using$$ a=\frac{v_2-v_1}{\mathrm{d}t} \,,$$but I'm not sure about what $\mathrm{d}t$ value to use here.

Next steps would be to calculate the jerk between 2 points using the formula of $j=\frac{\mathrm{d}a}{\mathrm{d}t}$ but I'm pretty stuck.

Would this algorithm be correct, and even give logical values. Does calculating the mean jerk actually say anything about the smoothness of an input method? What $t$ value should I use for the calculation of the acceleration?


1 Answer 1


There are various ways of calculating acceleration and jerk from your data set.

The value of $\mathrm{d}t$ you want is the time step generally, in your case $100 \, \mathrm{ms}.$

The method that you suggest $$a=\frac{v_2-v_1}{\mathrm{d}t}$$ will give you an answer and is reasonable, but it will not give you the best value I expect. It might be better to use something like Savitsky-Golay fitting of the data set, which you can do to get derivatives.

The formula you suggest can be used for jerk, just put in two accelerations instead of two velocities. The only problem with this is that at each step you are getting further and further from the data, so any experimental errors in position will get magnified in each step of calculation for velocity, acceleration and the worst would be jerk.

I would be tempted to use two different methods and finding velocity (+ acceleration and jerk if possible) and then compare the velocities from different methods and it may give an indication of how reliable your analysis is.

The Wikipedia page on Savitsky-Golay fitting has parameters for finding 1st 2nd 3rd... derivatives at the bottom.

Note that in reply to your question I would draw up a table in each dimension like this:

$$ \begin{array}{c|c|c|c|c} \text{time,}~t & \text{position,}~x & v=\frac{\mathrm{d}x}{\mathrm{d}t} & a=\frac{\mathrm{d}^2x}{{\mathrm{d}t}^2} & \text{jerk}=\frac{\mathrm{d}^3x}{{\mathrm{d}t}^3} \\ \hline 0 & 0 & 10 & 5 & 4 \\ 1 & 10 & 15 & 9 & 3 \\ 2 & 25 & 24 & 12 & 2 \\ 3 & 49 & 36 & 14 & 1 \\ 4 & 85 & 50 & 15 & \vdots \\ 5 & 135 & 65 & \vdots \\ 6 & 200 & \vdots \\ \vdots & \vdots \end{array}_{\Large{.}} $$

Hope this is helpful – of course the velocities should have times in between the times for $x$ and the accelerations times between the times of the velocities etc. etc. – but it is not so easy to figure out how to indicate that in a table in an answer here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.