EMG Example 2

From Software Product Documentation
Jump to navigation Jump to search
Language:  English  • français • italiano • português • español 

Normalizing an EMG signal to Maximum

EMG signals are often normalized by dividing the EMG signal by the maximum value of the EMG signal from a separate trial (e.g. a trial that elicits a maximum voluntary contraction (MVC) from the muscle).

In Visual3D, you must calculate the maximum value and store it in the GLOBAL workspace, then normalize the EMG signals by referencing the GLOBAL metric.

Sample Files

You can download the sample files here.

The download contains:

  • MVC_Example.cmz with -
    • 3 MVC trial
    • 2 Dynamic Trials
  • EMG_Norm_MVC.v3s (Example Pipeline Script)
  • EMG_Norm_MVC.v3m (Example Meta-Command)
  • Call_EMG_Norm_MVC_Max_Meta.v3s (Example Pipeline Script calling Meta-Command)

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

The following pipeline script commands can be pasted into a text file and saved as a .v3s file.

! ------------------------------------------------------------- 
!   Assign tags to identify MVC vs. Movement trials
! -------------------------------------------------------------

! Assign tag MVC to any trial with "mvc_" in the name

Assign_Tags_To_Files
/MOTION_FILE_NAMES=*mvc_*
! /QUERY=
/TAGS=MVC
;

! ------------------------------------------------------------- 
!   Calculate MVC Maximum
! -------------------------------------------------------------

! Calculate Maximum value from MVC Trial

Select_Active_File
/File_Name=MVC
;

! Compute the Overall Maximum of the EMG Signals over all the MVC trials

Metric_Maximum
/RESULT_METRIC_FOLDER=MVC_MAX
/RESULT_METRIC_NAME=
/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
/Signal_Types=ANALOG
/Signal_Names=EMG_A+EMG_B+EMG_C
/Signal_Folder=ORIGINAL
! /COMPONENT_SEQUENCE=
/EVENT_SEQUENCE=
/EXCLUDE_EVENTS=
/GENERATE_MEAN_AND_STDDEV=FALSE
! /APPEND_TO_EXISTING_VALUES=FALSE
/CREATE_GLOBAL_MAXIMUM=TRUE
;

! ------------------------------------------------------------- 
!   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 automatically 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_MVC_Max
! /MVC_TRIALS=*mvc_*
! /EMG_INPUT_FOLDER=ORIGINAL
! /EMG_OUTPUT_FOLDER=NORMALIZED
! /EMG_SIGNAL_LIST=EMG_A+EMG_B+EMG_C
;
  • MVC_TRIALS should contain the text in the MVC trials which identifies it from the dynamic trials
  • EMG_INPUT_FOLDER should be the EMG signals you want to normalized
  • EMG_OUTPUT_FOLDER should be the resulting EMG folder for the normalized signals
  • EMG_SIGNAL_LIST the list of EMG signals to normalize
Retrieved from ""