top of page
Wind Turbines

CUMULATIVE SUM

The technique for electromyography sensor

In order to activate the motors in our prosthetic arm, we have to be able to detect change in our EMG data. To do that we are utilizing change detection algorithms. The goal of change detection is to detect a change in the change parameter 𝜽, the mean of an independent gaussian sequence. 

 

For a sequence of independent random variables with probability distribution function P𝜽(y) that depends only on one scalar parameter, 𝜽, we say, before the unknown change time the parameter 𝜽 is equal to 𝜽0 and after it is equal to 𝜽1 which would not equal to 𝜽0.

 

Before unknown change time ts→  𝜃 = 𝜃0

After unknown change time →  𝜃 = 𝜃1≠ 𝜃0

The change detection algorithm is based on the concept of the log-likelihood ratio when calculating the sufficient statistic, si; 

 

SI copy.png

This ratio takes the natural log of the ratio of the probability distribution functions after and before change respectively. Let E𝜽0 and E𝜽1 denote the expectations of the random variable under the two distributions P𝜽0 and P𝜽1 respectively then,

 A change in the change parameter 𝜽  reflects a change in the sign of the mean value of the log-likelihood ratio, which is the key statistical property of change detection. 

 

The CUSUM function is the sum of all sufficient statistics for each element in the signal. From, Detection of Abrupt Changes: Theory and Applications by V. Nikiforov, the following figures shows the typical behavior of the CUSUM function on raw data. The typical behavior shows a negative drift before change and a positive drift after change.

A decision function, gk, is used to classify a significant change. It works by taking the current CUSUM function value and subtracting the current minimum value, mk. 

The figure below shows the typical behavior of the decision function. gk stays around zero in the negative drift phase until the minimum value of the CUSUM function becomes fixed at the time of change, then gk increases during the positive drift phase.

The stopping time is just the time that the decision function is greater than some chosen threshold h. If gk>h we say a change has happened.

In order to detect a change in our EMG data, we will be using an adaptive approach for change detection in EMG recordings, based on this CUSUM algorithm. Since  𝜽0 and  𝜽1 are unknown, we cannot use the CUSUM directly. In order to calculate our change parameter in the EMG data, we base the CUSUM algorithm on two adaptive sliding windows W0 and W1 used to estimate 𝜽0 and  𝜽1 at each time t. The figure below shows the Adaptive CUSUM window, as depicted in, Adaptive approach for change detection in EMG recordings by Falou, Khalil, and Duchene

The sufficient statistic now utilizes X(t) the series of independent observations and The adaptive CUSUM function and new decision function are based on this new sufficient statistic.

The new idea is to use two threshold values that are h (the threshold) and hs (the subthreshold). hs is used to stop the estimation of 𝜽0 when change begins.

 

The idea of our adaptive CUSUM algorithm is as follows and a flow chart representation is below: first, we start the program and compute the means, standard deviations, and all other information of the two sections. If the decision function is greater than the threshold, then a flex has been detected and the motors will be updated. If the decision function is not greater than the threshold and subthreshold the signal is not a candidate for flex and the program recomputes. Otherwise, the signal is a candidate. If it was not already marked as a candidate, mark the time and begin computing a new mean and standard deviation. Go back and check if the decision function is greater than the threshold as before. 

In biomedical applications, the changes can affect signal energy and frequency. Because of this, we took two different approaches when implementing the Adaptive CUSUM algorithm described above: detection of energy changes and detection of frequency changes. We first started with the detection of energy we assumed samples are independent and that the probability distribution functions are:

The log-likelihood ratio st can then be represented as follows, where the sigma variables are estimated using W0 and W1:

 

We then looked at the frequency. For this situation, since the samples of the signal are dependent, the use of autoregression (AR) modeling is needed. The new windows for this AR modeling are:

Where for parameters a1,...,ap:, 

 

The probability density function of the signal for this AR modeling is as follows:

Where εt is a Gaussian white noise sequence with variance (𝝈2). Additionally, the log-likelihood ratio is modified as follows:

Where the value of st is:

  • Facebook
  • Twitter
  • LinkedIn

©2020 by Prosthetic Arm Design. Proudly created with Wix.com

bottom of page