visual3d:documentation:emg:processing:normalize_emg_to_mvc
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:emg:processing:normalize_emg_to_mvc [2024/07/03 17:25] – removed sgranger | visual3d:documentation:emg:processing:normalize_emg_to_mvc [2024/07/17 15:45] (current) – created sgranger | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Normalize EMG to MVC ====== | ||
+ | |||
+ | **Normalize EMG Signal to Maximum Within Gait Cycle** | ||
+ | |||
+ | For this example, the goal is as follows: | ||
+ | |||
+ | * Process the raw EMG signal | ||
+ | * In this example, a simple linear envelope was done and saved in ANALOG:: | ||
+ | * Compute the maximum of the EMG signal during each gait cycle | ||
+ | * Normalize the EMG signal to the maximum during each gait cycle | ||
+ | |||
+ | ===== Sample Files ===== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | The download contains: | ||
+ | |||
+ | * Sample_Workspace.cmz with - | ||
+ | * 2 Dynamic Trials | ||
+ | * Processed EMG signals (ANALOG:: | ||
+ | * EMG_Norm_Gait_Cycle.v3s (Example Pipeline Script) | ||
+ | * EMG_Norm_Gait_Cycle.v3m (Example Meta-Command) | ||
+ | * Call_EMG_Norm_Gait_Cycle_Meta.v3s (Example Pipeline Script calling Meta-Command) | ||
+ | |||
+ | ===== Script Explanation ===== | ||
+ | |||
+ | |The image on the right corresponds to four steps in the pipeline below. As a general outline, the procedure has the following checkpoints: | ||
+ | |||
+ | ===== Example Pipeline Script ===== | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Set_Pipeline_Parameter | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Select_Active_File | ||
+ | / | ||
+ | ! /QUERY= | ||
+ | ; | ||
+ | |||
+ | Event_Define_Event_Sequence | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Event_Define_Event_Sequence | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | For_Each | ||
+ | / | ||
+ | ! / | ||
+ | /ITEMS=R+L | ||
+ | ; | ||
+ | |||
+ | | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ! --------------------------------------------------------------------- | ||
+ | ! Get the maximum number of cycles in a trial the entire CMZ file | ||
+ | ! --------------------------------------------------------------------- | ||
+ | |||
+ | ! We're going to loop over every sequence in the trial, | ||
+ | ! so first calculate the maximum number of sequences in the longest trial | ||
+ | |||
+ | ! Count the number of cycles in each trial | ||
+ | |||
+ | | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ! Calculate the maximum number of cycles across all trials | ||
+ | | ||
+ | | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ; | ||
+ | | ||
+ | ! Create a list from 1 to the maximum event sequence in steps of 1 | ||
+ | |||
+ | | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ! --------------------------------------------------------------------- | ||
+ | ! Create Normalize Signal | ||
+ | ! --------------------------------------------------------------------- | ||
+ | |||
+ | ! Create a temporary signal which contains zeros at all frames | ||
+ | |||
+ | | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ! Loop over every sequence | ||
+ | |||
+ | | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ! Define the " | ||
+ | |||
+ | Event_Define_Event_Sequence | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ! Loop over every EMG Signal | ||
+ | |||
+ | For_Each | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ; | ||
+ | | ||
+ | ! For all frames during the current cycle, | ||
+ | ! set the values to the maximum of the EMG signal | ||
+ | | ||
+ | | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! /END_FRAME= | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | | ||
+ | End_For_Each | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ! --------------------------------------------------------------------- | ||
+ | ! Normalize EMG Signal | ||
+ | ! --------------------------------------------------------------------- | ||
+ | |||
+ | ! Divide the EMG signals by the temporary signal above | ||
+ | |||
+ | | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | End_For_Each | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | ===== Calling Example Meta-Command ===== | ||
+ | |||
+ | Once the example Meta-Command from the download is placed in your [[Visual3D: | ||
+ | |||
+ | < | ||
+ | EMG_Norm_Gait_Cycle | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | * **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 | ||
+ | * **R_EMG_SIGNAL_LIST** the list of right side EMG signals to normalize to the right gait cycle | ||
+ | * **R_EVENT_SEQUENCE** events which indicate the right gait cycle (this example normalizes to stance, but you probably want to normalize to the entire gait cycle) | ||
+ | * **L_EMG_SIGNAL_LIST** the list of left side EMG signals to normalize to the left gait cycle | ||
+ | * **R_EVENT_SEQUENCE** events which indicate the left gait cycle (this example normalizes to stance, but you probably want to normalize to the entire gait cycle) | ||
+ | |||
+ | |||
visual3d/documentation/emg/processing/normalize_emg_to_mvc.1720027521.txt.gz · Last modified: 2024/07/03 17:25 by sgranger