Smoothness Analysis Module
The Smoothness module quantifies control using established motor control metrics. Smooth movements are characterized by continuous, coordinated trajectories with minimal abrupt changes.
The module implements two primary metrics validated in motor control research 1:
- Spectral Arc Length (SPARC): frequency domain smoothness measure.
- Jerk Root Mean Square (RMS): time domain measure based on movement derivatives.
Algorithms Details
SPARC Calculation
The Spectral Arc Length (SPARC) quantifies movement smoothness by measuring the arc length of the normalized Fourier magnitude spectrum of the signal.
- Compute the Fourier magnitude spectrum
Take the Fast Fourier Transform (FFT) of the input signal \( s(t) \) and keep only the positive frequencies:
-
Normalize the spectrum
Normalize the magnitude by its maximum value:
-
Calculate arc length
Compute the total Euclidean arc length of the normalized spectrum:
-
Return negative arc length
Define SPARC as:
Tip
SPARC values are negative, where more negative values indicate smoother movement.
Constant signals or signals with no variation return NaN (undefined smoothness).
Jerk RMS Calculation
The Jerk Root Mean Square (RMS) measures smoothness as the average magnitude of the finite-difference derivative of the signal.
- Compute discrete derivative
Approximate the first derivative using finite differences with sampling rate \( f_s \):
-
Compute RMS of derivative (jerk) values:
For N samples,
Tip
Lower RMS jerk values indicate smoother motion.
In this implementation, the function directly differentiates the provided signal once.
Hence, the algorithm expects to receive accelerations as input; if you input position, you get velocity RMS.
References
-
TODO ↩