Calculations

EMG Threshold

This script performs a baseline estimation threshold on an EMG data channel. Prior to performing the threshold, if specified by the user, the RMS of the data will be calculated and used at the threshold input. 

 

In order for Baseline Estimation to work properly the RMS of the input needs to be calculated.  If you do not wish to use the RMS that is built into this script (i.e. uncheck the RMS Input parameter), the RMS calculation needs to be performed prior to running this script.  If the RMS is not calculated, the baseline estimation threshold will not work.

 

The baseline of the data is calculated by calculating the mean of randomly scattered windows throughout the data and selecting the smallest one. The threshold value is then calculated by multiplying this value times the Baseline Level parameter.  The length and number of randomly scattered windows are determined by the user specified parameters Window Length and Number of Windows, respectively.  To set the threshold level to a multiple n of the standard deviation of the baseline EMG signal, set the Baseline Level parameter equal to n and be sure to RMS the input.

 

For example:

These parameters dictate a threshold level that is approximately two times the standard deviation of the baseline EMG signal:

Here is an output example (showing the raw signal, RMS, and active periods):

 

The Suppress Spikes and Gaps feature will take out any activate or deactive periods in the output that are less than the user specified parameter Suppression Time.  It works smartly, combining spikes/gaps with nearby similar features if necessary.  See below illustrations for all detailed cases.

 

(for reference, a gap is a deactivation period that is too short and a spike is an activation period that is too short)

A spike followed by a gap will be merged into the following activation period.

    

Before Suppression:

After Suppression:


 

Similarly a gap followed by a spike will be merged into the previous activation period.

Before Suppression:

                         

After Suppression:        

More:

Parameters

Validation

Output