visual3d:documentation:emg:processing:detecting_muscle_onset
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:emg:processing:detecting_muscle_onset [2024/06/14 17:11] – created sgranger | visual3d:documentation:emg:processing:detecting_muscle_onset [2024/07/17 15:45] (current) – created sgranger | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |**Language: | + | ====== |
- | |===== Contents =====\\ \\ \\ \\ * [[# | + | || |
- | ===== Introduction ===== | + | Surface EMG signals typically have a frequency content between 50 and 500 Hz. These signals may have a DC bias. It is common to apply a high pass filter with a cutoff frequency of 50 Hz to EMG signals prior to any other processing to remove the DC bias. |
- | To determine when a muscle is activated a threshold needs to be chosen from a period of inactivity. When the signal surpasses the threshold, the muscle is turned on. There are three different ways to do so. | + | **Note: Many laboratories assume |
- | - EMG Onset using Event_Threshold | + | **Note: Applying |
- | - EMG Onset based on TKEO | + | |
- | - EMG Onset based on automatic detection | + | |
- | + | ||
- | ===== EMG Onset using Event_Threshold ===== | + | |
- | + | ||
- | Computing the onset of an EMG signal can be quite tricky. In this example, we describe a pipeline for a straightforward estimation of EMG onset based on the EMG envelope and [[Event_Threshold|Event Threshold]]. This is not a definitive definition, but simply a starting point for the user. Two events should be created at the start and beginning of the rest period. Three event labels are identified on this figure. The yellow and red events specify the "rest period" | + | |
- | + | ||
- | [[File:Emg2.jpg|{{/ | + | |
- | ==== Pipeline ==== | + | |
- | + | ||
- | The following pipeline first includes a low pass filter, | + | |
< | < | ||
- | !Apply a high pass and low pass filter assuming that the surface emg signal contains information | + | ! By default, Visual3D uses a second order Butterworth Bidirectional Filter (resulting in a |
- | !from 20 to 500 Hz | + | ! fourth order filter) for Lowpass/ |
- | Highpass_Filter | + | ! High pass filter |
- | /SIGNAL_TYPES=ANALOG | + | Highpass_Filter |
- | /SIGNAL_NAMES=EMG2 | + | /Signal_Types= ANALOG |
- | ! /SIGNAL_FOLDER=ORIGINAL | + | /SIgnal_Names= EMG1+EMG2+EMG3 |
- | ! /RESULT_SUFFIX= | + | /Signal_Folder= ORIGINAL |
- | / | + | ! /Result_Suffix= |
- | ! /FILTER_CLASS=BUTTERWORTH | + | ! /Result_Folder=PROCESSED |
- | / | + | ! /Filter_Class=BUTTERWORTH |
- | / | + | /Frequency_Cutoff= 50 |
- | / | + | /Num_Reflected= 0 |
- | ! / | + | /Total_Buffer_Size=100 |
- | ; | + | /Num_Bidirectional_Passes=1 |
- | + | ||
- | Lowpass_Filter | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! /FILTER_CLASS=BUTTERWORTH | + | |
- | /FREQUENCY_CUTOFF=500 | + | |
- | /NUM_REFLECTED=0 | + | |
- | /TOTAL_BUFFER_SIZE=100 | + | |
- | ! / | + | |
- | ; | + | |
- | + | ||
- | !Compute the RMS of the emg signal based on a 100 ms window | + | |
- | + | ||
- | Moving_RMS | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | / | + | |
- | ; | + | |
- | + | ||
- | !Create events that define the resting baseline of the muscle | + | |
- | + | ||
- | Event_Explicit | + | |
- | / | + | |
- | /FRAME=1 | + | |
- | ! /TIME= | + | |
- | ; | + | |
- | + | ||
- | Event_Explicit | + | |
- | / | + | |
- | / | + | |
- | ! /TIME= | + | |
- | ; | + | |
- | + | ||
- | !Compute the median and standard deviation of the EMG envelope during rest | + | |
- | + | ||
- | Metric_Median | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | ; | + | |
- | + | ||
- | Metric_StdDev | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | ; | + | |
- | + | ||
- | !Identify the event EMG2_ON based on a threshold crossing | + | |
- | !of the median + 3 * standard deviation | + | |
- | + | ||
- | Event_Threshold | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | ! / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | ! / | + | |
- | /EVENT_INSTANCE=1 | + | |
; | ; | ||
</ | </ | ||
- | ==== Pipeline for computing the number of frames the signal is on ==== | ||
- | |||
- | To calculate how long a signal is on or how long a muscle is active, a signal will be created to be set as zero when below the threshold, and one when the signal is above the threshold. | ||
- | |||
- | < | ||
- | ! Create a signal that is zero when the EMG is off, and one when it is ON | ||
- | |||
- | ! Start with creating a signal that is zero at all frames | ||
- | Evaluate_Expression | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | ! / | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | ; | ||
- | |||
- | ! Set all frames between the ON/OFF events to one | ||
- | Set_Data_To_New_Values | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | ! / | ||
- | ! /END_FRAME= | ||
- | ! / | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | ! / | ||
- | ; | ||
- | |||
- | ! Add the signal during the gait cycle | ||
- | ! The result will be the number of frames the signal is ON during the gait cycle | ||
- | Metric_Sum | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | ; | ||
- | </ | ||
- | |||
- | ===== EMG Onset based on TKEO ===== | ||
- | |||
- | Computing the onset of an EMG signal can be quite tricky. In this example, we describe a pipeline for a straightforward estimation of EMG onset based on the the [[Teager_Kaiser_Energy|Teager-Kaiser Energy Operator]] and [[Event_Threshold|Event_Threshold]]. This is not a definitive definition, but simply a starting point for the user. The following figure shows an EMG signal before and after the Teager Kaiser Energy Operator is implemented. | ||
- | |||
- | [[File: | ||
- | ==== Pipeline ==== | ||
- | |||
- | The following pipeline follows the same general format as above, yet at the beginning there is a Highpass Filter and a Teager Kaiser Energy Operator instead of a Lowpass filter and a HighPass Filter. | ||
- | |||
- | < | ||
- | !Apply a high pass and low pass filter assuming that the surface emg signal contains information | ||
- | !from 20 to 500 Hz | ||
- | |||
- | Highpass_Filter | ||
- | / | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | / | ||
- | ! / | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | ; | ||
- | |||
- | !Apply the Teager-Kaiser Operator | ||
- | |||
- | Teager_Kaiser_Energy | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | ! / | ||
- | ! / | ||
- | ; | ||
- | |||
- | !Create events that define the resting baseline of the muscle | ||
- | |||
- | Event_Explicit | ||
- | / | ||
- | /FRAME=1 | ||
- | ! /TIME= | ||
- | ; | ||
- | |||
- | Event_Explicit | ||
- | / | ||
- | /FRAME=150 | ||
- | ! /TIME= | ||
- | ; | ||
- | |||
- | !Compute the median and standard deviation of the TKO envelope during rest | ||
- | |||
- | Metric_Median | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | ; | ||
- | |||
- | Metric_StdDev | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | ; | ||
- | |||
- | !Identify the event EMG_C_ON based on a threshold crossing | ||
- | !of the median + 3 * standard deviation | ||
- | |||
- | Event_Threshold | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | ! / | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | / | ||
- | ! / | ||
- | ! / | ||
- | / | ||
- | ; | ||
- | </ | ||
- | |||
- | ===== EMG Onset based on Automatic Detection ===== | ||
- | |||
- | The following meta-command may be used to process EMG analog signals to find " | ||
- | |||
- | **Meta-Command**: | ||
- | |||
- | **Tutorial page**: [[Visual3D: | ||
- | |||
- | |||
- | Retrieved from "" | ||
visual3d/documentation/emg/processing/detecting_muscle_onset.1718385096.txt.gz · Last modified: 2024/06/14 17:11 by sgranger