Compute Norm Jerk

j = njerk(A,fs) % Matlab & Octave
j <- njerk(A, fs) #R  

Compute the norm-jerk from triaxial acceleration data. The norm-jerk is ||dA/dt||, where ||x|| is the 2-norm of x, i.e., the square-root of the sum of the squares of each axis.

Input var Description Units Default value
A is a nx3 acceleration matrix with columns [ax ay az]. Acceleration can be in any consistent unit, e.g., g or m/s2. g or m/s2 N/A
fs is the sampling rate in Hz of the acceleration signals. This is used to estimate the differential by a first-order difference. N/A N/A
Output var Description Units
j is a column vector with the same number of rows as in A. If the unit of A is m/s2, the norm-jerk has unit m/s3. If the unit of A is g, the norm-jerk has unit g/s. As j is the norm of the jerk, it is always positive or zero (if the acceleration is constant). The final value in j is always 0 because the last finite difference cannot be calculated. m/s3 or g/s
• A can be in any frame as the norm-jerk is rotation independent. A must have at least 2 rows (i.e., n>=2)
• As j is the norm of the jerk, it is always positive or zero (if the acceleration is constant). The final value in j is always 0 because the last finite difference cannot be calculated.

### Matlab & Octave

j = njerk([1,2,3;2,2,4;1,-2,4;4,4,4],5)
j = [7.0711;20.6155;33.541;0]

### R

sampleMatrix = matrix(c(1, 2, 3, 2, 2, 4, 1, -2, 4, 4, 4, 4), byrow = TRUE, nrow = 4, ncol = 3)
j <- njerk(A=sampleMatrix, fs=5)
j <- c(7.0711, 20.6155, 33.541, 0)