Table of Contents

Normalize EMG to Generic Global Variable


Normalizing EMG signal to generic GLOBAL Value
Typically the Scaling factors for EMG signals are the result of other data trials (such as MVIC trials). Individual files in Visual3D cannot access the data from other files, so the only way signals can be shared is through the Global Workspace.

This tutorial assumes that a global metric has already been created and that metric is used to normalize the EMG signals.

Sample Files

You can download the sample files here.

The download contains:

Typically EMG signals are normalized after they have been processed (ex. linear envelope). In this example, the original signal is normalized. In reality, you should reference the folder which contains your processed EMG signal (ex. if you calculated a linear envelope, and the resulting EMG signal is stored in a folder called LOWPASS, change ORIGINAL in the script to LOWPASS).

Example Pipeline Script


Assumes there is a previously created GLOBAL metric called METRIC::MVC_MAX::EMG_A_MAX.

! ------------------------------------------------------------- 
!   Normalize
! -------------------------------------------------------------

! Select All Files as Active

Select_Active_File
/File_Name=ALL_FILES
;

! For each EMG signal, divide by it's maximum value

For_Each
/Iteration_Parameter_Name=CURRENT_SIGNAL
/Items=EMG_A+EMG_B+EMG_C
;

 ! Divide the EMG signal by it's maximum value, which was stored in the GLOBAL workspace 

 Evaluate_Expression
 /EXPRESSION= ANALOG::ORIGINAL::&::CURRENT_SIGNAL& / GLOBAL::METRIC::MVC_MAX::&::CURRENT_SIGNAL&_MAX
 ! /SIGNAL_TYPES=
 ! /SIGNAL_FOLDER=ORIGINAL
 ! /SIGNAL_NAMES=
 /RESULT_TYPES=ANALOG
 /RESULT_FOLDERS=NORMALIZED
 /RESULT_NAME=::CURRENT_SIGNAL
 ! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
 ;

End_For_Each
/Iteration_Parameter_Name= CURRENT_SIGNAL
;

Calling Example Meta-Command

Once the example Meta-Command from the download is placed in your Meta-Command folder, you can call the command using the following syntax:

EMG_Norm_Global_Variable
/EMG_INPUT_FOLDER=ORIGINAL
/EMG_OUTPUT_FOLDER=NORMALIZED
/EMG_SIGNAL_LIST=EMG_A+EMG_B+EMG_C
/GLOBAL_METRIC_FOLDER=MVC_MAX
/GLOBAL_METRIC_SUFFIX=_MAX
;