Compute acceleration from position or velocity data
Source:R/ops-derivatives.R
computeAcceleration.RdComputes acceleration (second derivative) from position or velocity assays. If velocity assays already exist, differentiates those (first derivative of velocity). Otherwise, computes the second derivative of position directly.
Arguments
- pe
A PhysioExperiment object.
- assay_names
Character vector of assay names to differentiate. If NULL (default), auto-detects velocity_x/y/z (preferred) or position_x/y/z assays.
- method
Finite difference method: "central" (default), "forward", or "backward".
- sampling_rate
Sampling rate in Hz. If NULL (default), uses
samplingRate(pe).
References
Winter DA (2009). "Biomechanics and Motor Control of Human Movement." 4th ed. John Wiley & Sons.
See also
computeVelocity() for first-order derivatives,
computeJerk() for third-order derivatives,
differentiate() for general-purpose numerical differentiation.
Examples
demo <- demoMoCapData(seed = 1)
pe_acc <- computeAcceleration(demo$mocap)
SummarizedExperiment::assayNames(pe_acc)
#> [1] "position_x" "position_y" "position_z" "accel_x" "accel_y"
#> [6] "accel_z"