visual3d:documentation:emg:processing_tools
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:emg:processing_tools [2024/06/14 17:11] – created sgranger | visual3d:documentation:emg:processing_tools [2024/07/17 15:45] (current) – created sgranger | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |===== Contents | + | ====== Processing Tools ====== |
- | ===== General Processing Steps ===== | + | ==== Introduction |
- | Processing | + | The purpose is to offset trial data to accommodate for any DC shift. Quantifying the EMG background noise based on a " |
- | 1. High Pass Filter | + | Find overall mean of trial: |
- | 2. Low Pass Filter | + | |
- | 3. Rectify Data | + | |
- | 4. Filter Noise | + | |
- | 5. Normalize and Scale Data | + | |
- | It should be noted that within both this page and external literature, the term " | + | |
- | Visual3D has a number of helpful pipeline functions (linked below) that can automate the general processing steps. | + | if positive, subtract mean from all values to offset overall average to zero |
+ | if negative, add mean to all values to offset overall average to zero. | ||
+ | Rectify trial around the zero baselines | ||
- | ===== Helpful Pipeline Functions ===== | + | Calculate threshold values for each channel of EMG (level of digitized baseline noise). |
- | The following links will redirect you to pages detailing | + | Determine noise threshold (i.e., |
+ | ==== EMG_Resting_Background ==== | ||
- | * [[Visual3D: | + | You can remove the background using a Meta-Command (as described below), or you can see [[Visual3D: |
- | * [[Lowpass_Filter|Lowpass Filter]] | + | |
- | * [[Rectify|Rectify]] | + | |
- | * [[Moving_RMS|Moving RMS]] | + | |
- | * [[Teager_Kaiser_Energy|Teager Kaiser Energy Operator]] | + | |
- | * [[Assign_Tags_To_File|Assign Tags To File]] | + | |
- | ===== Meta Commands ===== | + | ==== EMG_Resting_Background |
- | This page deals with several examples of using Visual3D [[Pipeline_Commands: | + | The following |
- | ===== Removing Noise from EMG Signals ===== | + | < |
+ | ! BEGIN_META | ||
+ | ! META_CMD_NAME=EMG_Resting_Background | ||
+ | ! META_PARAM= SIGNAL_NAMES: | ||
+ | ! META_PARAM= SIGNAL_FOLDER: | ||
+ | ! META_PARAM= RESULT_FOLDER: | ||
+ | ! END_META | ||
- | **Download the [[https://www.has-motion.com/download/examples/EMG/EMG_NoiseReduction_Example.zip|EMG_NoiseReductionExample]] here.** | + | Set_Pipeline_Parameter |
+ | /PARAMETER_NAME=FOLDER | ||
+ | /PARAMETER_VALUE=:: | ||
+ | ! /PARAMETER_VALUE_SEARCH_FOR= | ||
+ | ! /PARAMETER_VALUE_REPLACE_WITH= | ||
+ | ! /PARAMETER_VALUE_PREFIX= | ||
+ | ! /PARAMETER_VALUE_APPEND= | ||
+ | ; | ||
- | The text below describes two common methods of removing noise from EMG signals. Before using these methods, ensure you have performed a high and low pass filter on the raw data. You do not need to rectify your data to use the Root Mean Square method or the Teagan Kaiser Energy Operator method as they will both rectify your signals for you. | + | Set_Pipeline_Parameter |
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
- | **1. Root Mean Square | + | ! --------------------------------------------------------------- |
- | < | + | ! Offset trial data to accommodate for any DC shift |
- | ! Example 1: Use the Moving RMS Command | + | ! (find overall mean of trial& |
- | ! Apply a high pass filter with 50 Hz cutoff | + | ! subtract mean from all values to offset overall average |
- | Highpass_Filter | + | ! if negative, add mean to all values to offset overall average to zero). |
- | / | + | ! Rectify trial around the zero baselines |
- | / | + | ! (all values set to absolute values). |
- | / | + | ! --------------------------------------------------------------- |
- | ! / | + | |
- | ! / | + | For_Each |
- | ! / | + | /ITERATION_PARAMETER_NAME=INDEX |
- | / | + | /ITEMS=:: |
- | / | + | |
- | /Total_Buffer_Size=100 | + | |
- | /Num_Bidirectional_Passes=1 | + | |
; | ; | ||
- | ! Apply a low pass filter with 500 Hz cutoff | + | |
- | Lowpass_Filter | + | Metric_Mean |
- | /Signal_Types=ANALOG | + | /RESULT_METRIC_NAME=_MEAN |
- | /Signal_Names=EMG1+EMG2+EMG3 | + | /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE |
- | /Signal_Folder=PROCESSED | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | ! /Result_Suffix= | + | / |
- | ! /Result_Folder=PROCESSED | + | / |
- | ! /Filter_Class=BUTTERWORTH | + | / |
- | /Frequency_Cutoff= 500 | + | ! /SIGNAL_COMPONENTS=X |
- | /Num_Reflected= 0 | + | / |
- | /Total_Buffer_Size=100 | + | / |
- | /Num_Bidirectional_Passes=1 | + | / |
+ | ! /APPEND_TO_EXISTING_VALUES=FALSE | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | End_For_Each | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ! --------------------------------------------------------------- | ||
+ | ! Calculated threshold values for each channel of EMG | ||
+ | ! (level of digitized baseline noise). | ||
+ | ! Apply noise threshold (i.e., the value determined from the | ||
+ | ! resting EMG values fall below). | ||
+ | ! ceiling through data at successively higher levels until | ||
+ | ! all data values for the 5 second duration fall below the ceiling. | ||
+ | ! --------------------------------------------------------------- | ||
+ | |||
+ | Metric_Maximum | ||
+ | /RESULT_METRIC_NAME=_REST | ||
+ | /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE | ||
+ | /RESULT_METRIC_FOLDER=::RESULT | ||
+ | /SIGNAL_TYPES=ANALOG | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | /CREATE_GLOBAL_MAXIMUM=TRUE | ||
; | ; | ||
- | ! Moving RMS with 100 millisecond window | ||
- | Moving_RMS | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | / | ||
- | / | ||
- | ; | ||
</ | </ | ||
- | **2. Teager Kaiser Energy Operator (TKEO): | + | ==== Madonna EMG Remove Background Meta-Command ==== |
+ | |||
+ | The following Meta Command removes the background noise from the EMG signals | ||
< | < | ||
- | ! Example 2: Use the TKEO Command to Process | + | ! BEGIN_META |
- | Highpass_Filter | + | ! META_CMD_NAME=Madonna EMG Remove Background |
+ | ! META_PARAM= SIGNAL_NAMES:string:: | ||
+ | ! META_PARAM= SIGNAL_FOLDER: | ||
+ | ! META_PARAM= RESULT_FOLDER: | ||
+ | ! META_PARAM= BACKGROUND_FOLDER: | ||
+ | ! END_META | ||
+ | |||
+ | Set_Pipeline_Parameter | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Set_Pipeline_Parameter | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ! --------------------------------------------------------------- | ||
+ | ! Remove | ||
+ | ! --------------------------------------------------------------- | ||
+ | |||
+ | For_Each | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Set_Data_To_New_Values | ||
/ | / | ||
- | /SIGNAL_FOLDER=ORIGINAL | + | /SIGNAL_NAMES=::INDEX |
- | /SIGNAL_NAMES=EMG_C | + | /SIGNAL_FOLDER=::RESULT |
- | /RESULT_FOLDER=PROCESSED | + | ! /SIGNAL_COMPONENTS=ALL_COMPONENTS |
! / | ! / | ||
- | ! /FILTER_CLASS=BUTTERWORTH | + | / |
- | /FREQUENCY_CUTOFF=20 | + | ! /EVENT_SEQUENCE= |
- | /NUM_REFLECTED=0 | + | ! /EXCLUDE_EVENTS= |
- | ! /NUM_EXTRAPOLATED=0 | + | /START_FRAME=1 |
- | /TOTAL_BUFFER_SIZE=100 | + | / |
- | ! /NUM_BIDIRECTIONAL_PASSES=1 | + | ! /USE_POINT_RATE=TRUE |
+ | / | ||
+ | /THRESHOLD_HIGH=DATA_NOT_FOUND | ||
+ | /THRESHOLD_LOW=GLOBAL:: | ||
+ | ; | ||
+ | |||
+ | End_For_Each | ||
+ | / | ||
; | ; | ||
- | Lowpass_Filter | + | </code> |
- | /SIGNAL_TYPES=ANALOG | + | |
- | / | + | ==== An example Visual3D Pipeline Command to call these Meta-Commands ==== |
- | / | + | |
- | / | + | In this example, some files are TAGGED as REST, EMG, and GAIT. |
- | ! / | + | |
- | ! / | + | < |
- | / | + | !Make the Resting Trial the Active File. |
- | / | + | |
- | ! / | + | For_Each |
- | /TOTAL_BUFFER_SIZE=6 | + | /ITERATION_PARAMETER_NAME=TAGS |
- | ! /NUM_BIDIRECTIONAL_PASSES=1 | + | /ITEMS=REST |
; | ; | ||
- | Teager_Kaiser_Energy | + | |
- | / | + | Select_Active_File |
- | / | + | /FILE_NAME=::TAGS |
- | / | + | !/QUERY= |
- | ! / | + | |
- | / | + | |
- | /RESULT_NAME=EMG_C_TKEO | + | |
- | ! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME= | + | |
; | ; | ||
- | </ | ||
- | **3. Integrating EMG Signals:** Integrating EMG signals can be useful for quantifying muscle activity, comparing muscle activity between conditions, and assessing fatigue. The result of integrating an EMG signal (an iEMG) is a single metric value of microvolts or millivolts. While this isn't strictly a noise reduction method, it does have applications once a signal has been filtered. An example of using Visual3D' | + | ! Calculates resting background by calling |
- | **4. Removing Background Noise Example:** The [[Visual3D: | + | EMG_Resting_Background |
- | ===== Normalization and Scaling Methods ===== | + | / |
+ | / | ||
+ | / | ||
+ | ; | ||
- | Normalizing data is a useful transformation for comparing signals across groups of data. This section discusses several methods of using Visual3D' | + | End_For_Each |
+ | / | ||
+ | ; | ||
- | **1. Normalize and Scale EMG Signal to Global Maximum:** One method of normalizing EMG signals is to use the maximum voluntary contraction (MVC) value. MVC values are an EMG signal measuring during a maximal effort task , which is then used as a reference value to normalize EMG signals during all subsequent experimental tasks. What this translates to in Visual3D is first calculating the maximum value of the reference signal and store it in the Global workspace, then normalize your signals | + | ! This loop will remove |
- | **2. Compute Normalization Scale Factors:** Here are two examples of the steps that would be used to compute a normalization factor using MVC data. | + | For_Each |
- | **Example 1: Single MVC Trial:** The process for computing a normalization factor from a single MVC value uses the following general steps: | + | / |
- | - Process | + | /ITEMS=EMG+GAIT |
- | - High pass filter (remove DC offset) | + | ; |
- | - Calculate RMS of predetermined time intervals (example: 0.02 seconds) | + | |
- | - Normalize | + | |
- | - Calculate the average of the processed signal over 30 second intervals | + | |
- | - Get the maximum of the 30 second interval | + | |
- | - Normalize by dividing the average by the maximum | + | |
- | **Example 2: Multiple MVC Trials** | + | Select_Active_File |
- | - Process EMG | + | /FILE_NAME=::TAGS |
- | - High pass filter (remove DC offset) | + | !/QUERY= |
- | - Calculate RMS of predetermined time intervals (example: 0.02 seconds) | + | ; |
- | - Normalize | + | |
- | - Calculate the average of the processed signal over some time interval (in this example: 0.5 seconds) | + | |
- | - Get the maximum of the processed signal | + | |
- | - Calculate the maximum of the average signal | + | |
- | - Normalize by dividing the processed signal by the maximum average over the interval | + | |
- | Sample files and pipelines are available [[Visual3D: | + | ! Call the EMG_Remove_Background Meta-Command |
- | |**3. Normalize to Maximum within Gait Cycle:** The image to the (right) shows four " | + | EMG_Remove_Background |
+ | /SIGNAL_NAMES=LGAS+LGLU+LMED+LTIB+LVAS+RGAS+RGLU+RMED+RTIB+RVAS | ||
+ | /SIGNAL_FOLDER=EMG_FILTERED | ||
+ | /BACKGROUND_FOLDER=EMG_BACKGROUND | ||
+ | /RESULT_FOLDER=EMG_PROCESSED | ||
+ | ; | ||
+ | End_For_Each | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
- | Retrieved from "" | ||
visual3d/documentation/emg/processing_tools.1718385090.txt.gz · Last modified: 2024/06/14 17:11 by sgranger