Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2012 Sep 6.
Published in final edited form as: IEEE Trans Neural Syst Rehabil Eng. 2010 Jul 15;19(1):54–63. doi: 10.1109/TNSRE.2010.2056390

Rigorous A-Posteriori Assessment of Accuracy in EMG Decomposition

Kevin C McGill 1, Hamid R Marateb 2
PMCID: PMC3434971  NIHMSID: NIHMS256849  PMID: 20639182

Abstract

If EMG decomposition is to be a useful tool for scientific investigation, it is essential to know that the results are accurate. Because of background noise, waveform variability, motor-unit action potential (MUAP) indistinguishability, and perplexing superpositions, accuracy assessment is not straightforward. This paper presents a rigorous statistical method for assessing decomposition accuracy based only on evidence from the signal itself. The method uses statistical decision theory in a Bayesian framework to integrate all the shape- and firing-time-related information in the signal to compute an objective a-posteriori measure of confidence in the accuracy of each discharge in the decomposition. The assessment is based on the estimated statistical properties of the MUAPs and noise and takes into account the relative likelihood of every other possible decomposition. The method was tested on 3 pairs of real EMG signals containing 4–7 active MUAP trains per signal that had been decomposed by a human expert. It rated 97% of the identified MUAP discharges as accurate to within ±0.5 ms with a confidence level of 99%, and detected 6 decomposition errors. Cross-checking between signal pairs verified all but 2 of these assertions. These results demonstrate that the approach is reliable and practical for real EMG signals.

Index Terms: electromyography, EMG decomposition, motor units, Bayesian analysis, a-posteriori probability

I. Introduction

The process of estimating the firing patterns of multiple simultaneously active motor units (MUs) from an EMG signal is referred to as EMG decomposition. A number of automatic and computer-aided methods have been developed [1]–[15]. EMG decomposition is used to study the neural control of movement [16]–[25], diagnose neuromuscular disorders [26], [27], and characterize MU architecture [28], [29].

EMG decomposition is possible in signals in which MUs have distinct motor-unit action potentials (MUAPs) and regular firing patterns. However, because of background noise, MUAP shape and firing variability, and obfuscation when MUAPs superimpose, the true composition of the signal is not always obvious. Therefore, in order to know whether the results obtained by decomposition are scientifically valid, it is important to have a way to assess their accuracy.

The accuracy that can be achieved in decomposing a particular signal depends both on the characteristics of the signal and on the capability of the algorithm. If a signal is too complex, or if the MUAPs are too similar, it might not be possible to determine the true composition with complete certainty. Algorithmic performance can be tested using signals whose true composition is already known [30]. However, there is no way to be sure that the same performance seen with test signals can necessarily be expected for new signals with different characteristics.

Assessment of decomposition accuracy for a signal whose true composition is not already known must be based on evidence provided by the signal itself. Is the decomposition self consistent? Is it physiologically plausible? Does it fully account for all the activity in the signal? Many decomposition algorithms provide indices or graphical representations in this regard to characterize the consistency of the MUAP waveforms, the regularity of the firing patterns, and the fit between the estimated MUAP trains and the signal [1], [6], [9], [14], [31]. These representations can provide convincing evidence that the decomposition is plausible, but they do not constitute a rigorous proof that it is correct and complete.

In this paper we use statistical decision theory in a Bayesian framework to integrate all the evidence provided by the signal into a rigorous statistical assessment of decomposition accuracy. The approach involves computing the posterior probability that the given decomposition is correct, based on the estimated statistical properties of the MUAPs and noise and taking into account the relative likelihood of every other possible decomposition. The analysis is tolerant of a certain amount of abnormal or anomalous activity, which often occurs in real signals. If it is very unlikely that any other set of firing patterns could have produced the signal, then the given decomposition can be accepted as correct with a high degree of confidence. Otherwise it cannot. The final result of this aposteriori (AP) analysis is an objective measure of confidence in the accuracy of each discharge in the decomposition.

In this paper, we consider only single-channel, time-invariant signals of limited complexity, which includes many signals recorded with millimeter-sized electrodes during low-force, constant, isometric contractions. For signals with clearly distinguishable, regularly firing MUAPs and few anomalies, the AP analysis can provide a statistically sound estimate of decomposition accuracy. We refer to these as “good” signals—signals that an experienced human operator would be able to decompose with a high degree of subjective confidence. The AP analysis now provides a way to document that confidence objectively. Of equal importance, if the MUAPs or firing patterns are ambiguous, the AP analysis will indicate that ambiguity. The analysis thus serves a similar function for EMG decomposition that confidence intervals and tests of statistical significance do for other measurements: to provide a solid justification for further inferences where there is reasonable certainty and a safeguard against faulty inferences where there is reasonable doubt.

II. Overview

A. Notation

Waveforms are represented as continuous functions of time: s(t). Each waveform is defined over a particular interval and is assumed to equal zero outside that interval. The interval is indicated when the waveform is first introduced using the notation s(t0 : t1). In particular, the equation s(t0 : t1) = f (t) means that s(t) = f (t) for t0t < t1 and s(t) = 0 otherwise. Although equations involving waveforms are given in continuous time, it is assumed that computations involving them are actually done in discrete time with sampling rate fs, that sampling-theoretic interpolation is used for time shifts that are non-integer multiples of the sampling interval 1/fs [32], and that the waveform energy ||s||2 is calculated as a sum of squared sample values. The use of continuous-time notation merely simplifies the presentation by hiding the bookkeeping details associated with discrete indexing. The equations and pseudocode are not necessarily optimized for computational efficiency. In general, variables associated with the given decomposition are marked with a tilde: tij, variables estimated by the algorithm are marked with a hat: t^ij, and the corresponding true values are unmarked: tij.

B. Problem statement and assumptions

We are given an EMG signal s(0 : ls) and a set of estimated firing times T˜:

T={tij:j=1,,ni,i=1,,nu} (2.1)

where ls is the length of the signal, tij is the jth estimated firing time of MU i, ñi is the estimated number of firings of MU i, and ñu is the estimated number of active MUs. We refer to such a set of firing times as an annotation of s(t).

We assume that T provides a reasonably accurate description of the true composition of s(t). Specifically, we assume that the ñu MUs specified by T are all valid, and that therefore the true composition of s(t) can be written as follows:

s(0:ls)=i=1nuj=1niwij(ttij)+z(t) (2.2)

where tij, j = 1, …, ni are the true firing times of MU i, wij (−lw : lw) is the MUAP waveform of the jth discharge of MU i, lw is the MUAP half width, which, for simplicity, we assume is the same for all MUAPs and is known a-priori, z(0 : ls) is the background noise, and any other MUAP trains that are present in s(t) but not included in T are treated as part of the background noise.

The problem is to determine how accurately the firing times specified in T correspond to the true firing times. The true firing times are not known, and will be treated, in a Bayesian sense, as random variables. We assume that T is accurate enough to provide reasonably accurate estimates of the statistical characteristics of the MUAP waveforms, firing behavior, and noise.

C. Posterior probability

Our assessment of the accuracy of T will be based on the posterior probability P(T|s). This is the probability that the times in T are the true firing times, given all the evidence contained in s(t). By Bayes’ rule, P(T|s) can be written as follows:

P(Ts)=P(sT)P(T)TP(sT)P(T) (2.3)

where T is an arbitrary annotation, P(s|T) is the probability that if the MUs discharged as in T they would have produced s(t), and P(T) is the probability that the MUs would have discharged as in T in the first place [33]. The former factor depends on the statistical characteristics of the MUAP waveforms and background noise, and the latter on the statistical characteristics of the MU firing behavior.

An essential component of (2.3) is the normalization, which involves summing over all possible annotations T. This is challenging because of the large number of possible annotations. One approach is to consider that each MU can either discharge or not discharge in each discrete sampling interval [34]. This gives2ñulsfspossible annotations, where fs is the sampling rate. This is too many possibilities to consider in a practical algorithm.

We take a more pragmatic approach and partition s(t) into active and inactive segments. An active segment is a segment in which the signal rises significantly above the level of the background noise. Based on our experience with “good” EMG signals that have been adequately high-pass filtered, we assume that every true MU discharge results in an active segment—in other words, that there is a negligible chance of two or more MUAPs superimposing in a such a way that their sum cannot be distinguished from the background noise. We further assume that the active segments are short enough, and the MU interdischarge intervals long enough, that each active segment contains at most only one discharge of any given MU. Under these assumptions, MU discharges only occur during the active segments, and in a particular active segment each MU can either discharge or not discharge. This gives a total of 2ñuna possible “segment-wise” annotations, where na is the number of active segments. This number is still quite large, but, as we will show, the problem can be factored in such a way that each annotation does not have to be considered in its entirety.

We represent a segment-wise annotation by the set X = {x1,...,xna}, where xk=[xk1,,xknu][0,1]nu denotes the MU combination that discharges in active segment k, with xki = 1 if MU i discharges in the segment and 0 if it doesn’t. Analogous to P(T|s), the posterior probability of the segment-wise annotation X˜ that corresponds to T is

P(Xs)=P(sX)P(X)XP(sX)P(X) (2.4)

where P(s|X) and P(X) are the shape- and firing-time related probabilities analogous to P(s|T ) and P(T). To compute P(X|s) rigorously would still require consideration of all the different possible firing times within each active segment. Again we take a pragmatic approach. For computing P(X|s) we assume that within each active segment the firing times for a particular MUAP combination are those that give the best fit between the MUAPs and the signal. Then we separately estimate how likely those times are to be correct.

By itself, the value of P(X|s) does not convey what one generally thinks of as the accuracy of the annotation. For example, if there is uncertainty about only one active segment, then P(X|s) could be close to 0.5, even though the rest of the annotation is highly confident. We will therefore also use the AP framework to compute the marginal posterior probabilities of the individual discharges, i.e., P(xki|s). This is the probability that the annotation of active segment k is correct with respect to MU i, given all the evidence in the signal. It can be thought of as a level of confidence in the accuracy of this particular annotation.

III. Estimation of Statistical Parameters

We assume that the given annotation T is accurate enough to provide reliable estimates of the statistical properties of the true MUAP waveforms, firing behavior, and background noise. This is not unreasonable if s(t) is a “good” signal as described in the Introduction and if T is the result of a reasonably competent decomposition. If T does not provide good statistical estimates, then the mismatch between the signal and the statistical model will tend to undermine confidence in T, discouraging overestimation of its accuracy.

We assume that the statistical characteristics of the MUAPs and noise are time invariant and follow known distributions. We typically analyze signals in 5 second intervals because this is long enough to obtain reasonably accurate estimates of the statistical parameters, but short enough that the parameters are not likely to change significantly during the interval. Since any errors in T are likely to produce outlying sample values that could bias the estimates, we use robust methods to exclude outliers.

A. Firing statistics

The intervals between the successive discharges of a steadily firing MU during a constant force contraction have a stationary probability distribution that is very close to normal, with a standard deviation between about 10 and 25% of the mean [35]. If the true distribution is not exactly normal, the differences are not likely to be statistically distinguishable over relatively short signals (≤ 5 s.). For the sake of simplicity we assume that the intervals are independent both within and between trains. Therefore the probability density that successive discharges of MU i occur at times t1 and t2 is approximated by

pIi(t1,t2)12πσ^Iiexp(t2t1μ^Ii)22σ^Ii2 (3.1)

where ûIi and σ^Ii2 are the estimated mean and variance. The probability density of the first and last partial intervals at the beginning and end of the signal are given by hazard functions [36]. For convenience we also use the notation pIi to refer to these intervals by defining

pIi(t1,t2)12μ^Iierfct2t1μ^Ii2σ^Ii (3.2)

when t1 = 0 or t2 = ls.

For each MU i, ûIi and σ^Ii2 are estimated as the mean and variance of the intervals tij+1tij,j=1,,ni1, with intervals lying outside 0.5 to 1.5 times the median value excluded as likely outliers, based on the expected regularity of MUs in “good” signals.

B. MUAP waveforms

Under the assumption of stationarity, each MU has a mean MUAP waveform that does not change throughout the signal. These mean waveforms are estimated as follows:

w^i(lw:lw)=medj=1,,nis(ttij),i=1,,nu (3.3)

where lw is the MUAP half-width and med is the ensemble median.

C. MUAP variability and background noise

In the AP analysis, we will assess the probability that a particular combination of MUAPs x = [x1,...,xñu] produced a given active segment sk (t) in terms of the energy of the residual signal:

e2=sk(t)i=1nuxiw^i(tai)2 (3.4)

where xi indicates the occurrence of MUAP i and ai indicates its offset within the segment. The background noise contributes to the residual energy at each sampling interval. By the central limit theorem, the net contribution is approximately normally distributed, with a mean and variance proportional to the length of the segment. Each MUAP also contributes to the residual energy due to its shape variability. We assume that this contribution also has an approximately normal distribution, with a mean and variance that depend on the MUAP, but not on the length of the segment. Thus the probability density of the residual noise is approximated as

pEx(e2)12πσ^Exexp(e2μ^Ex)22σ^Ex2 (3.5)

where

μ^Ex=lkμ^z+i=1nuxiμ^Ei,andσ^Ex2=lkσ^z2+i=1nuxiσ^Ei2 (3.6)

with μ̂z and σ^z2 being the mean and variance of the energy of the background noise per unit time, lk the length of the active segment, and μ̂Ei and σ^Ei2 the mean and variance of the residual energy contributed by MUAP i.

The parameters of the background noise are estimated by finding all the segments of the signal that lie at least lw away from any estimated firing time tij and then computing

μ^Ez=meankek2lk,andσ^Ez2=meank(ek2lkμ^Ez)2lk (3.7)

where ek2 is the energy of the kth such segment, lk is its length, segments with energy greater than 3 times the median value are excluded, and it is assumed that there are enough segments to obtain reliable estimates.

The MUAP variability parameters are estimated by first computing the residual over the entire signal based on T˜:

r(0:ls)=s(t)i=1nuj=1niw^i(ttij). (3.8)

Then for each MU i, all the residual segments of length 2lw that contain only a single discharge of MU i and no discharges of any other MUs are found, and the parameters are estimated as follows:

μ^Ei=meankek22lwμ^Ez,andσ^Ei2=varkek22lwσ^Ez2 (3.9)

where ek2 is the residual energy of the kth segment, segments with energy greater than 3 times the median value are excluded, each parameter is replaced by 0 if its formula yields a negative value, and it is assumed that there are enough segments to obtain reliable estimates.

D. Anomalous events

Real EMG signals can contain extraneous events such as noise spikes, doublets, recruitment, and de-recruitment that fall outside the expected behavior of the statistical model. Because it is difficult to be certain about the true nature of such events, they will be classified as anomalies and their interpretation left to the investigator. To this end we assume that there is a small probability PA that a given active segment or a given inter-discharge interval involves an anomalous event. PA can also be thought of as the limit beyond which it is safer to assume that an event falls outside the statistical model rather than within it. Since it is difficult to assign a meaningful value to PA a-priori, this value is left as a user-specifiable parameter. Our experience shows that the precise value of PA is not critical for the confident recognition of anomalous events in otherwise “good” signals.

If an active segment involves an anomalous event, we assume that the value of the residual energy is unpredictable and can range as high as the energy of the largest MUAP. Thus the probability density that the residual energy takes on any particular value is

λE=1maxi||w^i(t)||2. (3.10)

Likewise, we assume that the length of an anomalous inter-discharge interval can range as high as the length of the signal. The probability density that the interval takes on any particular value is

λI=1ls. (3.11)

IV. Computing the Posterior Probability

In this section we present an algorithm for computing the segment-wise posterior probability P(X|s) given by (2.4).

A. Segmentation

The threshold for an active segment is based on the size of the smallest MUAP specified in T. Any MUAPs smaller than this are treated as part of the background noise and not included in the analysis. The times of activity are given by Ta={t:tTor|st|>θs} , where θs=0.6minimaxt|w^i(t)| , with the factor 0.6 chosen to allow for some degree of destructive superposition. The signal is partitioned into active segments such that s(t) is in an active segment if mint′ ∈Ta|tt′| ≤ lw.Let sk(lk:lk)=s(tt¯k)be the kth active segment, where t¯k is the midpoint and lk is the half length. Let na be the number of active segments.

B. Firing-related part

To simplify computing the firing-related part of the posterior probability, we approximate the MU firing times by the times of the active segment in which they occur. Thus the approximate firing times of MU i are given by

t^ij=argmint¯kt¯ktij,j=1,,n^i. (4.1)

For convenience, we augment these times with t^i00 and t^in^i+1ls . These approximate times are sufficiently accurate for computing the firing interval probabilities as long as the intervals are relatively long compared to the active segment lengths. Under the assumption that the firing intervals are independent within and between MUAP trains, the firing-dependent terms in the AP probability (2.4) can be written as

P(X)=i=1nuj=0n^iPIi(t^ij,t^ij+1) (4.2)

where

pIi(t1,t2)=(1PA)pIi(t1,t2)+PAλI. (4.3)

Note that PA λI is the probability that the interval is anomalous.

C. Shape-related part

Since the shapes of the active segment are independent of one another, the shape-related terms in the AP probability (2.4) can be written:

P(sX)=k=1naP(skxk). (4.4)

Let a=[a1,,anu], where aitijt¯k[lk,lk], represent the offsets of the MUAPs within active segment k. In theory, P(sk|xk) involves a summation over all possible values of a. To reduce the number of computations, we assume that P(sk|xk) can be approximated using the MUAP alignments that provides the best fit to sk(t):

P(skxk)(1PA)pExk(sk(t)ixkiw^i(ta^i)2)+PAλE (4.5)

where

a^=argminask(t)ixkiw^i(tai)2 (4.6)

which can be computed using the algorithm in [37]. This approximation is generally adequate to distinguish feasible MUAP combinations from ones that are negligibly likely.

D. Normalization factor

If one thinks of each possible value of xk, i.e., each possible combination of MUAPs that could discharge during active segment k, as a node, as in Fig. 1, then each segment-wise annotation X corresponds to a path that connects to one node for each active segment. Each path has an associated likelihood P(s|X)P(X) that corresponds to one term in the denominator of (2.4).

Fig. 1.

Fig. 1

Schematic representation of the factors involved in the calculation of the normalization factor. The signal s(t) is segmented into active segments sk(t). For each active segment there are 2nu possible MUAP combinations xk (sets of circles, each set here showing the 4 possible combinations of 2 different MUAPs). A segment-wise annotation X (heavy line) is equivalent to a path through this trellis and corresponds to a specific firing pattern T. The likelihood of the annotation is the product of shape-dependent factors associated with each active segment and firing-time-dependent factors associated with the firing pattern. Computing the normalization factor requires summing the likelihoods of all possible paths.

For a given path X, let tki denote the most recent discharge time of MU i up to and including active segment k, i.e.,

tki={t¯k:kk,xki=1,xk+1i==xki=0} (4.7)

with tki0 if x1i = ··· = xki = 0. We define the set of the indices of the most recent discharge times of all the MUs at active segment k as the state of path X at active segment k:qk(X)=[qk1,,qknu], where tki=t¯qki for all i. We note that the sum of the likelihoods of all the paths that have the same state q at active segment k can be factored into the product of two terms:

X:qk(X)=qP(sX)P(X)=Qk(q)Qk(q) (4.8)

where Qk (q) involves a summation over all the possible ways to arrive at the state and Qk(q) involves a summation over all possible ways to leave it.

The values of Qk can be computed iteratively in the following way. At active segment k − 1, each element of q can have the possible values 0, …, k − 1. At active segment k, each MU i can either discharge, in which case qki = k, or not discharge, in which case qki = qk−1i. Thus the values of Qk can be computed as follows:

Q0([0,,0])1fork=1,,naforq{0,,k}nuQk(q)0forx{0,1}nuforq{0,,k1}nuq[(1xi)qi+xik]i=1,,nuQk(q)Qk(q)+Qk1(q)P(skx)i=1nuPIixi(t¯qi,t¯qi) (4.9)

The normalization factor D is given by a sum over all the states at the last active segment:

D=q{0,,na}nuQna(q)i=1nuPIi(t¯qi,ls). (4.10)

Note that D can also be computed by starting at the end of the signal and working backwards to the beginning. In this case the path state equals the set of nearest discharge times occurring at or after t¯k. The computation involves a set of factors similar to the Qs, but representing backward sums from the end of the path. Let us call these factors Rk (q).

E. Pruning

The time needed to compute the normalization factor grows exponentially with the number of MUs. This time can be reduced significantly by pruning nodes and paths that have only a negligible probability of being correct. In computing the shape-related probabilities, if a lower bound on the residual energy can be determined for a particular MUAP combination x:

eb2minask(t)ixiw^i(tai)2 (4.11)

and if pEx(eb2)<PAλE, then P(sk|x) can be approximated by PA λE without having to compute the minimum residual energy itself. We do not yet have an efficient way to compute this bound.

In computing the factors Qk (q), it is only necessary to keep track of those states q that make a non-negligible contribution to the overall likelihood. Unfortunately, a state with a relatively small Qk may turn out to be on a path that has a high overall likelihood, but this may not be known until much later along the path. We only keep track of states for which Qk (q) > (PA λE)2 max q′Qk (q′), but there are probably better criteria. The effect of pruning can be checked by comparing the normalization factors computed in the forward and reverse directions. If they are not equal, then some paths with appreciable likelihood must have been pruned. If they are equal, then the pruning was almost certainly benign.

V. Firing Time Accuracy

In determining the shape-related part of the AP probability we assumed that the offsets of the MUAPs within each active segment were those that gave the best fit. In this section we consider the accuracy of that assumption.

For a given active segment sk and a given set of MUs x that includes MU i, the probability density of the offset of MUAP i is

p(a)=apEx(sk(t)ixiw^i(tai)2)δ(aia)da (5.1)

where δ is the Dirac delta function. Note that since pEx is nonlinear, the peaks of p(a) can be much narrower than one sampling interval of s(t). The level of certainty about the accuracy of a particular value ã can be expressed in terms of the likelihood that the true value is within a particular interval ±θt ofã. This probability can be written as:

P(aa<θt)=I1I1+I2 (5.2)

where

I1=aθta+θtp(a)da,andI2=lklkp(a)daI1 (5.3)

with lk being the segment half-width. Calculating this probability involves summation over all possible offsets of all the MUAPs. Instead, we compute a lower bound (see Fig. 2). First we approximate p(a) heuristically by the conditional probability given that all the other MUAPs are at their optimal offsets:

p(a)p^(a)=pEx(f(a)) (5.4)

where

Fig. 2.

Fig. 2

Quantities involved in the bound on the firing-time accuracy.

f(a)=mina:ai=ask(t)ixiw^i(tai)2 (5.5)

For a particular value of a, f (a) can be computed using the algorithm in [37].

The highest peak in (a) occurs at a = âi, where

a^=argminask(t)ixiw^i(tai)2. (5.6)

In the vicinity of âi, f (a) can be approximated by

f(a)f^(a)=f(a^i)+4fs2(f1f(a^i))(aa^i)2 (5.7)

where

f1=max(f(a^i12fs),f(a^i+12fs)) (5.8)

and fs is the sampling rate of s(t). I1 must include at least the mass from this main peak, so

i1I^1=aθta+θtpEx(f^(a))da (5.9)

which can be computed numerically. The smallest value of f (a) outside the region of interest is given by

f2=min(f(aθt),f(a+θt),f3) (5.10)

where

f3=mina:aia>θtaisalocalminimumsk(t)ixiw^i(tai)2. (5.11)

The value of f3 can be found using the algorithm in [37] by presetting the binary array that keeps track of which alignments have already been tried to prevent consideration of alignments in the vicinity of [ã − θt,ã + θt]. Since f2 is the smallest value outside the region of interest,

I2I^2=2pEx(f2)lk. (5.12)

Therefore, the final bound, written in terms of firing times rather than offsets, and explicitly stating the conditioning terms, is

P(titi<θtsk,x)I^1I^1+I^2. (5.13)

VI. Measures of Accuracy

A. Posterior accuracy of a discharge

The AP framework makes it possible to compute the posterior probabilities of individual discharges. Specifically, the joint posterior probability that MU i discharged in sk and that the estimated discharge time ti was within ±θt of the true firing time ti is given by

P(xki=1,titi<θts)=x:xi=1P(xk=xs)P(titi<θtsk,x). (6.1)

P(xk = x|s) is the posterior probability that MUAP combination x fired during segment k given all the evidence in the signal. It can be computed as follows:

P(xk=xs)=q{0,,k}nuq{k,,na+1}nuQk(q)Rk(q)P(skx)i=1nuPIixi(t¯qi,t¯qi)J(xi,qi,qi) (6.2)

where Qk (q) and Rk (q′) are the forward and backward factors of the AP normalization and J(xi,qi,qi)=1 if xik, qi, and qi all equal k or all do not equal k and is 0 otherwise. J selects only those states q and q′ that occur on paths that pass through node xk = x. The posterior probability that MUAP i discharged in active segment k without regard to the precise firing time is given by:

P(xki=1s)=x:xi=1P(xk=xs). (6.3)

B. Rating individual discharges

The accuracy of each discharge in T can be summarized using the rating system shown in Table I. Here xki is the annotation of active segment k with respect to MU i according to T, and P(xki = 1|s) is the posterior probability that MU i discharged during the segment given all the information in the signal. The four corner ratings (Likely True Positive, etc) correspond to the basic contingencies of binary decision theory (True Positive, etc., see [30]), except that, since the true annotation is not known, “true” and “false” can only be understood in a probabilistic sense.

TABLE I.

Accuracy Rating for Annotation of MUi in Active Segment k

AP Probability P(xki = 1|s) Annotation xki
1 0
≥ 0.95 LTP: Likely True Positive LFN: Likely False Negative
≥ 0.05 UP: Uncertain Positive UN: Uncertain Negative
< 0.05 LFP: Likely False Positive LTN: Likely True Negative

The Likely True Positive rating can be subdivided according to the level of certainty and the precision of the firing-time estimate as in Table II. For example, an LTP (0.1 ms) rating means that there is at least a 99% chance that MU i discharged within ± 0.1 ms of the time listed in T. In other words, one can be 99% confident that this annotation is correct at this level of precision. A precision of ±0.5 ms has been suggested as adequate for accurate calculations of instantaneous firing rates [30]. A precision of ±0.1 ms represents a higher firing-time accuracy that is often achievable for MUAPs with high signal-to-noise ratios. A precision of ±5 ms represents a lower accuracy that is achieved when a MUAP is suspected to occur within a particular active segment, but the precise firing time within the segment cannot be determined because of anomalous or residual noise. Different precisions could also be chosen.

TABLE II.

Ratings for Likely True Positives

AP Prob Precision (θt) Rating
≥ 0.99 ± 0.1 ms LTP (0.1 ms)
≥ 0.99 ± 0.5 ms LTP (0.5 ms)
≥ 0.99 ± 5.0 ms LTP (5 ms)
≥ 0.95 ± 5.0 ms LTP (95%)

The LTN and LFP ratings indicate probable annotation errors. The Uncertain ratings correspond to situations in which it is not possible to be certain from the information available in the signal whether the annotation is correct or not.

C. Summarizing the results

The accuracy of the entire estimated firing pattern of MU i can be summarized in terms of the percentage of discharges that are accurate at a certain level of confidence:

Accuracy=nLTP/k=1naP(xki=1s)×100% (6.4)

where nLTP* is the number of estimated discharges that are rated likely true positives at a given level of confidence and precision and the denominator estimates the total number of true discharges. This index would be reported by stating, for example, that X% of the estimated discharge times of MU i are accurate to within ± 0.1 ms at a confidence level of 99%.

D. Unexplained activity

Another measure that reflects on the accuracy of an annotation is the amount of activity that it fails to explain. The total number of events that cannot be explained in terms of the model assumptions can be estimated by

n^A=kPAλEP(skxk)+ijPAλIPIi(tij,tij+1). (6.5)

If this number is small, it means that the annotation plausibly explains all the activity in the signal, except, perhaps, for a few anomalous events. In this case there is no reason to doubt the credibility of the accuracy assessment. On the other hand, a large number points to a serious discrepancy between the signal and the model assumptions and is reason to doubt the credibility of the assessment.

This number is also useful for judging whether or not the given annotation includes all the active MUs in the signal. If n^A is small, then one can be confident that all the MUAP trains in the signal with amplitudes > θs were included in the annotation. Otherwise, some MUAP trains may have been left out.

VII. Experimental Results

A. Methods

We have implemented a proof-of-concept version of the AP algorithm in Matlab and tested it on three pairs of “good” EMG signals collected during different experiments in our laboratory. The two signals in each pair were recorded from nearby sites in the same muscle, making it possible to crosscheck the decomposition results [38], [39]. The signals were recorded using monopolar needle or fine-wire electrodes (1 mm exposed conductor) during 20-second-long, low-force, isometric contractions at a sampling rate of 10 kHz. The signals are summarized in Table III, and segments of the two signals from pair 1 are shown in Fig. 3(a). The analysis software and signals are available at www.emglab.net.

TABLE III.

Summary of EMG signals

Pair Muscle Signal # MUs Mean firing rate (pps) # Common MUs
1 BR 1.1 4 10.2 4
1.2 6 9.4
2 TA 2.1 5 9.3 5
2.2 7 9.2
3 BF 3.1 5 9.3 4
3.2 5 8.7

BR=brachioradialis, TA=tibialis anterior, BF=biceps femoris.

Fig. 3.

Fig. 3

(a) Annotated segments of EMG signals from set 1. The MUAPs of the common MUs are offset in the two signals because of conduction delay between the two electrodes. (b) Estimated MU firing times for the first 5 seconds of signals 1.1 and 1.2. The times for signal 1.1 are plotted upward from the solid lines and those from signal 1.2 are plotted downward (after correction for the mean inter-signal offsets). The length of each line segment indicates the AP accuracy rating: full length = LTP (0.1 ms), 3/4 length = LTP (0.5 ms), etc.

Each signal was digitally high-pass filtered at 1 kHz and independently decomposed using the EMGlab program with manual editing [9]. For each MU that was detected in common in both signals of a pair, every discharge was classified as to whether the two annotations agreed (after mean offset correction) to within ± 0.5 ms, ±5 ms, or did not agree.

Each annotation was also divided into four 5-s intervals, and each of these was analyzed using the AP algorithm, with parameters lw = 2.5 ms and PA = 0.001.

B. Results

The annotations for one interval of signals 1.1 and 1.2 are shown in Fig. 3(b), with the estimated firing times from decomposition 1.1 plotted upward from the solid horizontal lines and the those from decomposition 1.2 plotted downward. MUs 1–4 were detected in both signals, and the two annotations agreed about every discharge time to within ± 0.5 ms, confirming that these times were very probably correct.

The results of the AP analyses are indicated by the lengths of the line segments, as described in the figure caption. Every estimated firing time in annotation 1.1 was rated LTP (0.1 ms). In signal 1.2, several discharges of the smaller MUAPs received LTP (0.5 ms) or LTP (5 ms) ratings.

The overall results are summarized in Table IV. The total number of annotated discharges of all the common MUs was 4678. Of these, 4658 matched the corresponding annotation of the paired signal to within ±0.5 ms. An additional 12 matched to within ±5 ms, and 8 discharges did not match. Upon manual re-inspection, the 8 unmatched discharges were found to be due to 4 decomposition errors involving small or similarly shaped MUAPs. These errors were not corrected prior to AP analysis.

TABLE IV.

Summary of results

Cross-check AP Analysis
LTP** LTP* UP LFP
agree ±0.5 ms 4516 119 22 1
agree ±5 ms 1 6 5 0
disagree 4 0 2 2
UN LFN

not seen 72 3

LTP** = LTP (0.1 or 0.5 ms), LTP* = LTP (5 ms or 95%)

The AP analysis rated 4521 of the annotations as likely correct to within ±0.5 ms, and 125 as likely correct to within ±5 ms. All but 4 of these assertions were confirmed as correct by the cross-checking results. The other 4 corresponded to the decomposition errors, and would have been confirmed if the errors had been corrected. The AP analysis rated 29 annotations as uncertain, and detected 72 uncertain negative events (i.e., possible missed discharges). These all involved very small MUAPs or noise glitches. It also correctly detected 2 false positives and 2 false negatives that resulted from the decomposition errors. Thus the AP analysis detected and correctly assessed all 4 of the decomposition errors.

One LFP and one LFN rating listed in Table IV were contradicted by the cross-checking results and so must be counted as type I errors. They occurred in a single situation that involved two adjacent active segments that both had anomalous noise glitches. The AP analysis incorrectly placed one MU discharge in one segment rather than the other. This was the only case in which confident assertions of the AP analysis were found to be in error.

In summary, the results show that for the “good” signals tested here, the accuracy assessments provided by AP analysis were largely consistent with those of an experienced human operator and comparable to those obtained by cross-checking against a second channel. The analysis was cautious when it came to small MUAPs and noise glitches, but this conservatism resulted in a very low rate of type I errors: 0.04% (2 of 4650). Even though these were admittedly fairly simple signals, it has not previously been possible to “prove” the accuracy of decompositions of even simple signals like these in a statistically rigorous way.

VIII. Discussion

Reliable assessment of the accuracy of scientific measurements is essential for judging whether they are trustworthy and thus whether inferences drawn from them are based on objective reality or only wishful thinking. In the case of EMG decomposition, accuracy assessment is difficult because of the complicated nature of the EMG signal. Many decomposition methods provide numerical or graphical indications of the self-consistency of their results, for example in terms of the regularity of the estimated firing patterns [1], [6], [9], [14], [31]. This type of assessment can provide a convincing demonstration that the results are physiological plausible, but it does not prove that they are correct or complete, and so is less than fully satisfactory for investigations of motor unit firing behavior, in which complete and accurate firing patterns are required.

In a correct decomposition, the estimated MUAP trains not only match the shape of the signal, but they also exhibit regular firing patterns, similar to the way that the pieces of a correctly assembled jigsaw puzzle not only fit together but also contribute to a coherent picture. The interlocking shape and firing-time information in the EMG signal can be conveniently combined using a Bayesian framework (Fig. 1). In this paper we have shown that this framework can be used to determine not only the relative likelihood of one decomposition with respect to another, but also its absolute likelihood with respect to all possible others. This absolute likelihood—the posterior probability—can be interpreted as a level of confidence in the accuracy of the decomposition given all the information available in the signal. We used a dynamic programming approach to normalize the posterior probability, although other approaches such as Markov chain Monte Carlo methods [40] might also be possible.

The posterior probability serves two important purposes. First, it provides an objective confirmation of accuracy where accuracy is warranted. In the most clear-cut cases, it shows that a decomposition accounts for the shape of the signal to a degree consistent with the estimated levels of MUAP variability and background noise, that the estimated firing patterns possess a consistent degree of regularity, and that it is very unlikely that the MUs could have produced the signal by firing in any other way. In such cases the decomposition results can be accepted with a high degree of confidence as an accurate representation of the true MU firing behavior.

Just as importantly, the posterior probability also points out cases in which there is reason to doubt decomposition accuracy. These are cases for which there are more than one plausible explanation and it is not possible, based only on the evidence contained in the signal, to be certain which is correct. Uncertainty can arise because of excessive noise, signal complexity, intra-MUAP shape variability, firing variability, inter-MUAP shape similarity, or deviation from the model assumptions. In such cases one cannot be sure that the decomposition results are accurate.

The AP assessment is based on fairly minimal assumptions about the EMG signal and the given decomposition: the signal should not be too complex, its statistical parameters should not change with time, and the given decomposition should provide reasonably accurate estimates of those parameters. The latter assumption introduces an unfortunate circularity, since the estimated parameters are then used to assess the decomposition from which they were estimated. This should not lead to erroneous overestimation of accuracy, however. If the given decomposition is fairly accurate to begin with, the assumption is not unreasonable. If the given decomposition is not accurate, this will result in an overestimation of the signal variability, and this, in turn, will tend to blur the distinction in relative likelihood between different possible annotations and hence to reduce confidence that any one particular annotation is correct.

To streamline the computations, some conditional probabilities that involve complicated multi-dimensional integrals are approximated by their most likely values (e.g., (4.5)). These approximations preserve the approximate relative likelihoods of the alternative conditions. Within the context of the current problem, and given the robust way that the information from different sources is integrated within the Bayesian framework, these approximations do not impair the ability to reach a confident assessment.

In using the AP assessment, it must be kept in mind that the most any statistical measure can do is report the degree to which the data matches the stated assumptions. The responsibility for making sure that the assumptions are appropriate and for providing the final physiological interpretation of the results must always lie with the investigator.

A proof-of-concept implementation of the AP algorithm written in Matlab is available as an extension for the EMGlab decomposition program at www.emglab.net. It is able to assess the decomposition accuracy of 5-second-long, low-complexity signals containing up to 6 MUAP trains in a matter of minutes. Code optimization and more efficient pruning strategies can be expected to reduce this time, making it practical to analyze signals with at least 8 to 10 MUAP trains. As signal complexity increases, however, so too does the possibility that parts of the signal may fail to have a single unambiguous explanation. Beyond a certain level of signal complexity (which will depend on the strength of the contraction and the selectivity of the electrode) it will probably not be possible theoretically to demonstrate decomposition accuracy in a convincing way based only on evidence provided by the signal itself.

Acknowledgments

We are grateful to Alexander Harris for helpful discussions.

This work was supported by the US Department of Veterans Affairs and grant R01NS051507 from the US National Institute of Neurological Disorders and Stroke.

Biographies

graphic file with name nihms256849b1.gif

Kevin C. McGill (M’84) received the B.S. and M.S. degrees from the University of Notre Dame, Notre Dame, IN, in 1975 and 1979, respectively, and the Ph. D. degree in electrical engineering from Stanford University, Stanford, CA, in 1984.

Since 1984 he has been a Biomedical Engineer with the Rehabilitation Research and Development Center, VA Palo Alto Health Care System. His research interests include neuromuscular physiology, electromyography, and signal processing.

graphic file with name nihms256849b2.gif

Hamid R. Marateb (M’10) received the B.S. and M.S. degrees from Shahid Beheshti University of Medical Science and Amirkabir University of Technology, Tehran, Iran, in 2000 and 2003, respectively.

Since 2008 he has been a Ph.D. candidate in the Laboratory of Engineering of Neuromuscular Systems, Politecnico di Torino, Turin, Italy. He was a visiting researcher at Stanford University in 2009 and at Aalborg University in 2010. His research interests include intra-muscular and surface electromyography, expert-based fuzzy systems, biomedical signal processing, design of electronic systems, and non-convex optimization.

Footnotes

Personal use of this material is permitted. However, permission to use this material for any other purposes must be obtained from the IEEE by sending a request to pubs-permissions@ieee.org.

Contributor Information

Kevin C. McGill, Email: mcgill@va51.stanford.edu, Rehabilitation R&D Center, VA Palo Alto Health Care System, Palo Alto, CA 94304, USA (phone: 1-650-493-5000 ext. 64477;).

Hamid R. Marateb, Laboratory for Engineering of Neuromuscular Systems, Politecnico di Torino, Torino, Italy.

References

  • 1.Lefever RS, De Luca CJ. A procedure for decomposing the myoelectric signal into its constituent action potentials: I. Technique, theory, and implementation. IEEE Trans Biomed Eng. 1982;29:149–157. doi: 10.1109/tbme.1982.324881. [DOI] [PubMed] [Google Scholar]
  • 2.Gerber A, Studer RM, de Figueiredo RJ, Moschytz GS. A new framework and computer program for quantitative EMG signal analysis. IEEE Trans Biomed Eng. 1984;31:857–863. doi: 10.1109/TBME.1984.325248. [DOI] [PubMed] [Google Scholar]
  • 3.McGill KC, Cummins KL, Dorfman LJ. Automatic decomposition of the clinical electromyogram. IEEE Trans Biomed Eng. 1985;32:470–477. doi: 10.1109/TBME.1985.325562. [DOI] [PubMed] [Google Scholar]
  • 4.Stashuk D, de Bruin H. Automatic decomposition of selective needle-detected myoelectric signals. IEEE Trans Biomed Eng. 1988;35:1–10. doi: 10.1109/10.1330. [DOI] [PubMed] [Google Scholar]
  • 5.Haas WF, Meyer M. An automatic EMG decomposition system for routine clinical examination and clinical research—ARTMUP. In: Desmedt JE, editor. Computer-Aided Electromyography and Expert Systems. Amsterdam: Elsevier; 1989. pp. 67–81. [Google Scholar]
  • 6.Stashuk DW. Decomposition and quantitative analysis of clinical electromyographic signals. Med Eng Phys. 1999;21:389–404. doi: 10.1016/s1350-4533(99)00064-8. [DOI] [PubMed] [Google Scholar]
  • 7.Zennaro D, Wellig P, Koch VM, Moschytz GS, Laubli T. A software package for the decomposition of long-term multichannel EMG signals using wavelet coefficients. IEEE Trans Biomed Eng. 2003;50:58–69. doi: 10.1109/TBME.2002.807321. [DOI] [PubMed] [Google Scholar]
  • 8.Holobar A, Zazula D. Correlation-based decomposition of surface electromyograms at low contraction forces. Med Biol Eng Comput. 2004;42:487–495. doi: 10.1007/BF02350989. [DOI] [PubMed] [Google Scholar]
  • 9.McGill KC, Lateva ZC, Marateb HR. EMGLAB: an interactive EMG decomposition program. J Neurosci Methods. 2005;149:121–133. doi: 10.1016/j.jneumeth.2005.05.015. [DOI] [PubMed] [Google Scholar]
  • 10.De Luca CJ, Adam A, Wotiz R, Gilmore LD, Nawab SH. Decomposition of surface EMG signals. J Neurophysiol. 2006;96:1646–1657. doi: 10.1152/jn.00009.2006. [DOI] [PubMed] [Google Scholar]
  • 11.Florestal JR, Mathieu PA, Malanda A. Automated decomposition of intramuscular electromyographic signals. IEEE Trans Biomed Eng. 2006;53:832–839. doi: 10.1109/TBME.2005.863893. [DOI] [PubMed] [Google Scholar]
  • 12.Kleine BU, van Dijk JP, Lapatki BG, Zwarts MJ, Stegeman DF. Using two-dimensional spatial information in decomposition of surface EMG signals. J Electromyogr Kinesiol. 2007;17:535–548. doi: 10.1016/j.jelekin.2006.05.003. [DOI] [PubMed] [Google Scholar]
  • 13.Erim Z, Lin W. Decomposition of intramuscular EMG signals using a heuristic fuzzy expert system. IEEE Trans Biomed Eng. 2008;55:2180–2189. doi: 10.1109/TBME.2008.923915. [DOI] [PubMed] [Google Scholar]
  • 14.Nawab SH, Wotiz RP, De Luca CJ. Decomposition of indwelling EMG signals. J Appl Physiol. 2008;105:700–710. doi: 10.1152/japplphysiol.00170.2007. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Ge D, Le Carpentie E, Farina D. Unsupervised Bayesian decomposition of multi-unit EMG recordings using tabu search. IEEE Trans Biomed Eng. 2010;57:561–571. doi: 10.1109/TBME.2009.2022277. [DOI] [PubMed] [Google Scholar]
  • 16.De Luca CJ, LeFever RS, McCue MP, Xenakis AP. Behaviour of human motor units in different muscles during linearly varying contractions. J Physiol. 1982;329:113–28. doi: 10.1113/jphysiol.1982.sp014293. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Søgaard K. Motor unit recruitment pattern during low-level static and dynamic contractions. Muscle Nerve. 1995;18:292–300. doi: 10.1002/mus.880180305. [DOI] [PubMed] [Google Scholar]
  • 18.Erim Z, De Luca CJ, Mineo K, Aoki T. Rank-ordered regulation of motor units. Muscle Nerve. 1996;19:563–573. doi: 10.1002/(SICI)1097-4598(199605)19:5<563::AID-MUS3>3.0.CO;2-9. [DOI] [PubMed] [Google Scholar]
  • 19.Kamen G, Du DC. Independence of motor unit recruitment and rate modulation during precision force control. Neuroscience. 1999;88:643–653. doi: 10.1016/s0306-4522(98)00248-6. [DOI] [PubMed] [Google Scholar]
  • 20.Patten C, Kamen G, Rowland DM. Adaptations in maximal motor unit discharge rate to strength training in young and older adults. Muscle Nerve. 2001;24:542–550. doi: 10.1002/mus.1038. [DOI] [PubMed] [Google Scholar]
  • 21.Westgaard RH, De Luca CJ. Motor control of low-threshold motor units in the human trapezius muscle. J Neurophysiol. 2001;85:1777–1781. doi: 10.1152/jn.2001.85.4.1777. [DOI] [PubMed] [Google Scholar]
  • 22.Adam A, De Luca CJ. Recruitment order of motor units in human vastus lateralis muscle is maintained during fatiguing contractions. J Neurophysiol. 2003;90:2919–2927. doi: 10.1152/jn.00179.2003. [DOI] [PubMed] [Google Scholar]
  • 23.Falla D, Farina D. Non-uniform adaptation of motor unit discharge rates during sustained static contraction of the upper trapezius muscle. Exp Brain Res. 2008;191:363–370. doi: 10.1007/s00221-008-1530-6. [DOI] [PubMed] [Google Scholar]
  • 24.Oya T, Riek S, Cresswell AG. Recruitment and rate coding organisation for soleus motor units across entire range of voluntary isometric plantar flexions. J Physiol. 2009;587(pt. 19):4737–4748. doi: 10.1113/jphysiol.2009.175695. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Tucker K, Butler J, Graven-Nielsen T, Riek S, Hodges P. Motor unit recruitment strategies are altered during deep-tissue pain. J Neurosci. 2009;29:10820–10826. doi: 10.1523/JNEUROSCI.5211-08.2009. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Nikolic M. PhD Dissertation. University of Copenhagen; 2001. Detailed analysis of clinical electromyography signals. [Google Scholar]
  • 27.Doherty TJ, Stashuk DW. Decomposition-based quantitative electromyography: methods and initial normative data in five muscles. Muscle Nerve. 2003;28:204–211. doi: 10.1002/mus.10427. [DOI] [PubMed] [Google Scholar]
  • 28.Lateva ZC, McGill KC. Estimating motor-unit architectural properties by analyzing motor-unit action potential morphology. Clin Neurophysiol. 2001;112:127–135. doi: 10.1016/s1388-2457(00)00495-8. [DOI] [PubMed] [Google Scholar]
  • 29.Knight CA, Kamen G. Superficial motor units are larger than deeper motor units in human vastus lateralis muscle. Muscle Nerve. 2005;31:475–480. doi: 10.1002/mus.20265. [DOI] [PubMed] [Google Scholar]
  • 30.Farina D, Colombo R, Merletti R, Olsen HB. Evaluation of intra-muscular EMG signal decomposition algorithms. J Electromyogr Kinesiol. 2001;11:175–187. doi: 10.1016/s1050-6411(00)00051-1. [DOI] [PubMed] [Google Scholar]
  • 31.Stashuk D, Paoli GM. Robust supervised classification of motor unit action potentials. Med Biol Eng Comput. 1998;36:75–82. doi: 10.1007/BF02522861. [DOI] [PubMed] [Google Scholar]
  • 32.McGill KC, Dorfman LJ. High-resolution alignment of sampled waveforms. IEEE Trans Biomed Eng. 1984;31:462–468. doi: 10.1109/TBME.1984.325413. [DOI] [PubMed] [Google Scholar]
  • 33.McGill KC. PhD dissertation. Dept. Elec. Eng., Stanford University; Stanford, CA: 1984. Automatic decomposition of the electromyogram. [Google Scholar]
  • 34.Gut R, Moschytz GS. High-precision EMG signal decomposition using communications technique. IEEE Trans Signal Processing. 2000;48:2487–2494. [Google Scholar]
  • 35.Clamann HP. Statistical analysis of motor unit firing patterns in a human skeletal muscle. Biophys J. 1969;9:1233–1251. doi: 10.1016/S0006-3495(69)86448-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Perkel DH, Gerstein GL, Moore GP. Neuronal spike trains and stochastic point processes. I. The single spike train. Biophys J. 1967;7:391–418. doi: 10.1016/S0006-3495(67)86596-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37.McGill KC. Optimal resolution of superimposed action potentials. IEEE Trans Biomed Eng. 2002;49:640–650. doi: 10.1109/TBME.2002.1010847. [DOI] [PubMed] [Google Scholar]
  • 38.Mambrito B, De Luca CJ. A technique for the detection, decomposition and analysis of the EMG signal. Electroencephalogr Clin Neurophysiol. 1984;58:175–88. doi: 10.1016/0013-4694(84)90031-2. [DOI] [PubMed] [Google Scholar]
  • 39.McGill KC, Lateva ZC, Johanson ME. Validation of a computer-aided EMG decomposition method. Proc 26th IEEE Eng Med Biol Soc Conf; 2004. pp. 4744–4747. [DOI] [PubMed] [Google Scholar]
  • 40.Robert CP, Casella G. Monte Carlo Statistical Methods. New York: Springer; 2004. [Google Scholar]

RESOURCES