visual3d:documentation:emg:processing:normalize_emg_signal_to_maximum_within_gait_cycle
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_signal_to_maximum_within_gait_cycle [2024/06/14 17:11] – created sgranger | visual3d:documentation:emg:processing:normalize_emg_signal_to_maximum_within_gait_cycle [2024/07/17 15:45] (current) – created sgranger | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |**Language: | + | ====== |
- | |===== Contents | + | ===== Integrate EMG ===== |
- | **Normalize | + | === Integrating an EMG envelope between events === |
- | For this example, the goal is as follows: | + | The result of integrating a signal is a single metric value per event range. |
- | + | ||
- | * Process the raw EMG signal | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | ====== Sample Files ====== | + | |
- | + | ||
- | [[https:// | + | |
- | + | ||
- | The download contains: | + | |
- | + | ||
- | | + | |
- | * 2 Dynamic Trials | + | |
- | * Processed EMG signals (ANALOG:: | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | ====== 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 | + | ! Apply high pass filter with 50 hz cutoff |
- | /PARAMETER_NAME=R_EMG_SIGNAL_LIST | + | Highpass_Filter |
- | /PARAMETER_VALUE=EMG_A+EMG_B+EMG_C | + | /Signal_Types=ANALOG |
- | ! /PARAMETER_VALUE_SEARCH_FOR= | + | /SIgnal_Names=EMG1+EMG2+EMG3 |
- | ! /PARAMETER_VALUE_REPLACE_WITH= | + | /Signal_Folder=ORIGINAL |
- | ! /PARAMETER_VALUE_PREFIX= | + | ! /Result_Suffix= |
- | ! /PARAMETER_VALUE_APPEND= | + | ! /Result_Folder=PROCESSED |
- | ! /MULTI_PASS=FALSE | + | ! /Filter_Class=BUTTERWORTH |
- | ; | + | / |
+ | / | ||
+ | / | ||
+ | /Num_Bidirectional_Passes=1 | ||
+ | ; | ||
- | Set_Pipeline_Parameter | + | ! Apply low pass filter with 500 hz cutoff |
- | /PARAMETER_NAME=L_EMG_SIGNAL_LIST | + | Lowpass_Filter |
- | /PARAMETER_VALUE=EMG_A+EMG_B+EMG_C | + | /Signal_Types=ANALOG |
- | ! /PARAMETER_VALUE_SEARCH_FOR= | + | /SIgnal_Names=EMG1+EMG2+EMG3 |
- | ! /PARAMETER_VALUE_REPLACE_WITH= | + | /Signal_Folder=PROCESSED |
- | ! /PARAMETER_VALUE_PREFIX= | + | ! /Result_Suffix= |
- | ! /PARAMETER_VALUE_APPEND= | + | ! /Result_Folder=PROCESSED |
- | ! /MULTI_PASS=FALSE | + | ! /Filter_Class=BUTTERWORTH |
+ | / | ||
+ | / | ||
+ | / | ||
+ | /Num_Bidirectional_Passes=1 | ||
; | ; | ||
- | Select_Active_File | + | ! RMS moving average with a 100ms window |
- | /FILE_NAME=ALL_FILES | + | Moving_RMS |
- | ! /QUERY= | + | /SIGNAL_TYPES=ANALOG |
- | ; | + | / |
+ | / | ||
+ | ! /RESULT_SUFFIX= | ||
+ | / | ||
+ | / | ||
+ | ; | ||
- | Event_Define_Event_Sequence | + | ! Integrates an EMG signal between events from Start to End |
- | / | + | Metric_Integrate |
- | / | + | / |
- | ! / | + | / |
- | ! / | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | ! / | + | / |
- | ! / | + | / |
- | ! / | + | / |
- | / | + | ! / |
- | ; | + | / |
- | + | / | |
- | Event_Define_Event_Sequence | + | /GENERATE_MEAN_AND_STDDEV=FALSE |
- | / | + | /APPEND_TO_EXISTING_VALUES=FALSE |
- | / | + | |
- | ! / | + | |
- | ! / | + | |
- | ! / | + | |
- | ! / | + | |
- | ! / | + | |
- | / | + | |
- | ; | + | |
- | + | ||
- | For_Each | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ; | + | |
- | + | ||
- | | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | ! / | + | |
- | ! / | + | |
- | ! / | + | |
- | / | + | |
- | ; | + | |
- | + | ||
- | ! --------------------------------------------------------------------- | + | |
- | ! 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 | + | |
- | + | ||
- | Metric_Event_Sequence_Count | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ; | + | |
- | + | ||
- | ! Calculate the maximum number of cycles across all trials | + | |
- | + | ||
- | | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ; | + | |
- | | + | |
- | ! Create a list from 1 to the maximum event sequence in steps of 1 | + | |
- | + | ||
- | | + | |
- | /PARAMETER_NAME=SEQUENCE_COUNT | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ; | + | |
- | + | ||
- | ! --------------------------------------------------------------------- | + | |
- | ! 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_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 [[Pipeline_Commands: | ||
- | |||
- | < | ||
- | 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) | ||
- | |||
- | |||
- | Retrieved from "" | ||
visual3d/documentation/emg/processing/normalize_emg_signal_to_maximum_within_gait_cycle.1718385098.txt.gz · Last modified: 2024/06/14 17:11 by sgranger