Line no 43,44 calculates the derivative along each
particular axis. Derivarive is always wrt to time. So for x-axis it is dx/dt, for y- axis dy/dt for , z it is dz/dt.
For calculating derivative difference between consecutive values of
along that particular axis is 1st calculated. For eg to calculate difference Rift document: Documentation of amplitude statistics This code find out the statistical properties of accelerometer data. From all these properties only few properties are used to predict state is brake or not. between consecutive values along x-axis line no 43. Then these values are divided by dt at line 44. Line no 51 to 58 calculates the amplitude through the fourier transform These properties are max, min, mean, median, variance, standard deviation, total power, median power. and square of it gives the power concentrated in it.