Table of Contents
First Derivative
Overview
The First Derivative command can be used to calculate the first derivative of a signal at each point throughout the signal. This is can be useful when calculating the velocity of a signal that can't already be done using model based data or another rate of change.
Pipeline Command
The pipeline command can be found in the Pipeline Workshop under the Signal Math folder as so:
First_Derivative /Signal_Types /Signal_Names /Signal_Folder /Result_Types /Result_Name /Result_Folder /Result_Suffix
Command Parameters
The parameters that can be modified for this command are as follows:
| Signal Types | The type of signal to be evaluated |
| Signal Name | The name of the signal to be evaluated |
| Signal Folder | The name of the signal folder |
| Result Types | The type of the resulting signal |
| Result Name | The name of the resulting signal |
| Result Folder | The name of the resulting folder |
| Result Suffix | The result is given the same name as the original signal with the suffix added |
Dialog
Notes
Derivatives are calculated using Finite Difference Algorithms.
Given the signal: x(ti) for i=1, 2, ..., n The first derivative is calculated using: xDot(ti)= (x(ti+1)-x(ti-1))/( (ti+1)-(ti-1) )
Example: Joint Angular Acceleration from Joint Angular Velocity
This example shows how the First_Derivative command can be used to compute the angular acceleration of the left ankle from its angular velocity (found using the compute model based data command):
!First we find the left ankle angular velocity using Compute_Model_Based_Data Compute_Model_Based_Data /RESULT_NAME=LAnkeAngVel /SUBJECT_TAG=ALL_SUBJECTS /FUNCTION=JOINT_VELOCITY /SEGMENT=LFT /REFERENCE_SEGMENT=LSK ! /RESOLUTION_COORDINATE_SYSTEM=LAB ! /USE_CARDAN_SEQUENCE=FALSE ! /NORMALIZATION=FALSE ! /NORMALIZATION_METHOD= ! /NORMALIZATION_METRIC= ! /NEGATEX=FALSE ! /NEGATEY=FALSE ! /NEGATEZ=FALSE ! /AXIS1=X ! /AXIS2=Y ! /AXIS3=Z ! /INCLUDE_REMOTE_ANGULAR_MOMENTUM=FALSE ! /TREADMILL_DATA=FALSE ! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0) ! /TREADMILL_SPEED=0.0 ; !Next we can find the angular acceleration using the First_Derivative command First_Derivative /SIGNAL_TYPES=LINK_MODEL_BASED ! /SIGNAL_FOLDER=ORIGINAL /SIGNAL_NAMES=LAnkleAngVel /RESULT_TYPES=LINK_MODEL_BASED ! /RESULT_FOLDERS=PROCESSED /RESULT_NAME=Ankle_Derivative_Acc ! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME= ;
Example: Velocity of the Centre of Mass
The First_Derivative command is useful for calculating the velocity of targets, landmarks, etc. since velocity is the first derivative of position. The following example calculates the velocity of the center of mass using the First_Derivative command.
! Given a signal representing the center of mass's position as follows: Compute_Model_Based_Data /RESULT_NAME=COM /FUNCTION=MODEL_COG /SEGMENT= /REFERENCE_SEGMENT= ! /RESOLUTION_COORDINATE_SYSTEM=LAB ! /USE_CARDAN_SEQUENCE=FALSE ! /NORMALIZATION=FALSE ! /NORMALIZATION_METHOD= ! /NORMALIZATION_METRIC= ! /NEGATEX=FALSE ! /NEGATEY=FALSE ! /NEGATEZ=FALSE ! /AXIS1=X ! /AXIS2=Y ! /AXIS3=Z ; ! The velocity of the center of mass can be computed as follows: First_Derivative /SIGNAL_TYPES=LINK_MODEL_BASED /SIGNAL_NAMES=COM ! /SIGNAL_FOLDER=ORIGINAL /RESULT_NAMES=COM_VELOCITY /RESULT_TYPES=LINK_MODEL_BASED /RESULT_FOLDER=VELOCITY ! /RESULT_SUFFIX= ;

