User Tools

Site Tools


visual3d:documentation:pipeline:signal_commands:shift_frames

Shift Frames

In some cases, EMG data and motion capture data may be out of sync with each other. This can occur because of a physiological issue known as electromechanical delay (EMD), or because of technical issues with data collection, e.g. the saved EMG signal might be delayed because the EMG system is wireless. The command Shift_Frames shifts a signal forward/backward in time by a number of frames to accommodate this issue.

Shift_Frames
/SIGNAL_TYPES=TARGET
! /SIGNAL_NAMES=
! /SIGNAL_FOLDER=ORIGINAL 
! /RESULT_SUFFIX= 
! /RESULT_FOLDER=PROCESSED 
/FRAME_SHIFT= 5
/REPLACEMENT_VALUE=DATA_NOT_FOUND
;

Parameters

Parameter Description
SIGNAL_TYPES The Type(s) of the signal to be shifted.
SIGNAL_NAMES The Name(s) of the signal to be shifted.
SIGNAL_FOLDER The Folder(s) of the signal to be shifted.
RESULT_SUFFIX The suffix to append to the signal's name after it has been shifted.
RESULT_FOLDER The folder in which to store the shifted signal.
FRAME_SHIFT The number of frames to shift. Can be an expression.
REPLACEMENT_VALUE The value to replace any unknown values caused by the shift. The default value is 0, except when the Signal_Type parameter is a TARGET in which case DATA_NOT_FOUND (e.g. unreliable value) is used.

Dialog

The Shift_Frames command can be edited interactively using the following dialog.

Notes

  • When a signal is shifted forward in time, the frames at the beginning of the file have unknown values.
  • When a signal is shifted backward in time, the frames at the end of the file have unknown values.
  • These unknown values can be specified by the /Replacement_Value parameter.
  • If no /Replacement_Value is specified Visual 3D uses a value of 0 except when the Signal_Type parameter is a TARGET and value of DATA_NOT_FOUND (e.g. unreliable value) is used.

Examples

With Visual3D's flexible signal specification syntax and the power of expressions, it is possible to precisely specify how any signals should be shifted.

Example 1: Shift a single signal

Shift the signal 1FX by one analog frame and to replace the first frame with the value -99

Shift_Frames
/SIGNAL_TYPES=ANALOG
/SIGNAL_NAMES=1FX
! /SIGNAL_FOLDER=ORIGINAL
! /RESULT_SUFFIX=
! /RESULT_FOLDER=PROCESSED
/FRAME_SHIFT=1
/REPLACEMENT_VALUE=-99
;

Example 2: Shift all analog signals using an expression

Shift all analog signals in time based on the value of a Metric signal and replace the unknown values with DATA_NOT_FOUND (e.g. no value).

! Shift Frames - the shift value METRIC::PROCESSED::SHIFT was calculated previously 
Shift_Frames
/SIGNAL_TYPES=ANALOG
! /SIGNAL_NAMES= 
! /SIGNAL_FOLDER=ORIGINAL 
! /RESULT_SUFFIX= 
! /RESULT_FOLDER=PROCESSED 
/FRAME_SHIFT= METRIC::PROCESSED::SHIFT 
/REPLACEMENT_VALUE= DATA_NOT_FOUND
;   

NOTE: FORCE, COFP, and FREEMOMENT signals are derived from ANALOG signals, so these values cannot be shifted; the ANALOG signals should be shifted, and the option to use PROCESSED analog signals for computing forces should be set to true.

visual3d/documentation/pipeline/signal_commands/shift_frames.txt · Last modified: 2024/11/15 16:10 by wikisysop