User Tools

Site Tools


visual3d:documentation:pipeline:signal_commands:shift_frames

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:documentation:pipeline:signal_commands:shift_frames [2024/06/19 12:53] sgrangervisual3d:documentation:pipeline:signal_commands:shift_frames [2024/11/15 21:10] (current) – Brought page up to pipeline command format. wikisysop
Line 1: Line 1:
-{{||+===== Shift Frames =====
  
-in some cases, the 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 "delayedbecause the emg system is wireless).+In some cases, [[visual3d:documentation:emg:emg_overview|EMG]] data and [[visual3d:documentation:definitions:motion_capture_mocap|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 collectione.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.png+<code> 
 +Shift_Frames 
 +/SIGNAL_TYPES=TARGET 
 +! /SIGNAL_NAMES= 
 +! /SIGNAL_FOLDER=ORIGINAL  
 +! /RESULT_SUFFIX=  
 +! /RESULT_FOLDER=PROCESSED  
 +/FRAME_SHIFT= 5 
 +/REPLACEMENT_VALUE=DATA_NOT_FOUND 
 +
 +</code>
  
-the command **shift_frames** shifts a signal forward/backward in time by a number of frames. the command is below:+==== 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 [[visual3d:documentation:pipeline:expressions:expressions_overview|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 **[[visual3d:documentation:c3d_signal_types:data_not_found|DATA_NOT_FOUND]]** (e.g. unreliable value) is used. | 
 + 
 +==== Dialog ==== 
 + 
 +The Shift_Frames command can be edited interactively using the following dialog. 
 + 
 +{{:Shift_Frames.png}} 
 + 
 +==== 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 value of 0 except when the **Signal_Type** parameter is a **TARGET** and value of **[[visual3d:documentation:c3d_signal_types:data_not_found|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 1Shift a single signal === 
 + 
 +Shift the signal 1FX by one analog frame and to replace the first frame with the value -99
  
 <code> <code>
-shift_frames +Shift_Frames 
-/signal_types=analog +/SIGNAL_TYPES=ANALOG 
-/signal_names+/SIGNAL_NAMES=1FX 
-! /signal_folder=original  +! /SIGNAL_FOLDER=ORIGINAL 
-! /result_suffix=  +! /RESULT_SUFFIX
-! /result_folder=processed  +! /RESULT_FOLDER=PROCESSED 
-/frame_shiftthe number of frames to shift (expression)  +/FRAME_SHIFT=1 
-/replacement_valuethe value to replace the unknown values caused by the shift (expression).+/REPLACEMENT_VALUE=-99
 ; ;
 </code> </code>
  
-  * when a signal is shifted forward in time, the frames at the beginning of the file have unknown values. +=== Example 2: Shift all analog signals using an expression ===
-  * 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.+
  
-for example, 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 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).
  
 <code> <code>
-shift frames - the shift value metric::processed::shift was calculated previously  +Shift Frames - the shift value METRIC::PROCESSED::SHIFT was calculated previously  
-shift_frames +Shift_Frames 
-/signal_types=analog +/SIGNAL_TYPES=ANALOG 
-! /signal_names=  +! /SIGNAL_NAMES=  
-! /signal_folder=original  +! /SIGNAL_FOLDER=ORIGINAL  
-! /result_suffix=  +! /RESULT_SUFFIX=  
-! /result_folder=processed  +! /RESULT_FOLDER=PROCESSED  
-/frame_shiftmetric::processed::shift  +/FRAME_SHIFTMETRIC::PROCESSED::SHIFT  
-/replacement_valuedata_not_found+/REPLACEMENT_VALUEDATA_NOT_FOUND
 ;    ;   
 </code> </code>
  
-**note:** forcecofp, 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. +**NOTE:** [[visual3d:documentation:visual3d_signal_types:force_data_type|FORCE]][[visual3d:documentation:visual3d_signal_types:cofp_data_type|COFP]], and [[visual3d:documentation:visual3d_signal_types:freemoment_data_type|FREEMOMENT]] signals are derived from [[visual3d:documentation:c3d_signal_types:analog_data_type|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.
- +
-for example, to 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 
-**:** 
  
-}} 
visual3d/documentation/pipeline/signal_commands/shift_frames.1718801602.txt.gz · Last modified: 2024/06/19 12:53 by sgranger