Extraction of Some Relevant Instants from EMG Signal
Sofia Ben Jebara
Research Laboratory COSIM, Higher School of Communications of Tunis,
University of Carthage, Route de Raoued 3.5 Km, Cit
´
e El Ghazala, Ariana, 2088, Tunisia
Keywords:
Pre-motor Onset, Motor Onset, Motor Offset, Muscle Preparation, EMG Signal.
Abstract:
In this paper, an algorithm to estimate key instants in EMG signal during pre-motrice and motrice phases
is developed. It detects automatically i) the onset of muscle activity when an explicite recommendation of
preparation is dictated (pre-motor onset), ii) the onset of effective muscle contraction (motor onset) and iii)
the instant of muscle contraction desactivation (motor offset).
The algorithm is based on statistical thresholding and counting the number of samples exceeding the
threshlold. The counting is ensured by elaborated temporal scanning in forward and backward directions.
The threshold calculus is based on statistics of the EMG signal during muscle activity and muscle rest.
The algorithm is illustrated for the superficial flexor muscle during a handgrip exercice and is validated using
subjective visual inspection and objective evaluation (error rate). The results revealed that relevant instants in
EMG signal are well estimated.
1 INTRODUCTION
Electromyography is the most commonly used tool
for investigating muscle function. For example, the
ElectroMyoGraph signal (EMG) reveals details of the
timing and the magnitude of muscle activation. Re-
garding timing, an EMG signal is composed of differ-
ent kind of time intervals. Fig.1 illustrates an exam-
ple of timing. The preparation duration or pre-motor
activity or foreperiod is the time interval between a
warning signal motivating mental preparation and a
Go signal for motion execution. The pre-motor time
is followed by the motor task which is the effective
muscle activity (sometimes after a short latency time).
The activity generally ends spontaneously or after a
termination signal.
Three important instants characterize the time do-
main evolution. They are: the pre-motor onset which
characterizes the onset of pre-motor activity of the
muscle during the preparation period (initiation and
planification of the motion), the motor onset which
characterizes the muscle activity beginning (motor
program) and the offset which characterizes the end
of the activity (see Fig.1).
Traditionally, the most reliable way to detect on-
set and offset is the visual inspection and decision of
experts like physiological therapists. Although their
accuracy, they are very expensive and time consum-
ing.
Signal processing based algorithms has been intro-
duced to overcome these drawbacks. Common meth-
ods for detecting muscle activity onset and offset were
based on thresholding (Ozgunen et al., 2010), energy
operators (Li and Aruin, 2005), signals decomposi-
tion and transformation such as empirical mode de-
composition (Lee et al., 2009) and many others algo-
rithms.
Although time preparation and its effect on mus-
cle contraction has been investigated since the early
1980 (see for example (Alegria, 1980)), at our knowl-
edge, there is no automatic method to detect the pre-
motor onset. In fact, this task seems difficult since
EMG signal during preparation has low level and can
be confused to background noise.
In this work, we aim developing a signal process-
ing based algorithm to detect the three most important
instants of muscle activity which are the pre-motor
onset, the motor onset and the motor offset.The al-
gorithm is inspired from (Abbink, 1999), originally
conceived to detect muscle onset which is extended
here to estimate the three mentioned instants.
The paper is organized as follows. Section 2 de-
scribes some pre-processing tasks useful to prepare
the algorithm, such as: i) signal smoothing and recti-
fying, ii) muscle activity detection to separate muscle
contraction from muscle rest, iii) analysis windows
choice centered on muscle contraction. Section 3 de-
tails the different steps of the proposed algorithm: i)
Jebara, S..
Extraction of Some Relevant Instants from EMG Signal.
In Proceedings of the 3rd International Congress on Sport Sciences Research and Technology Support (icSPORTS 2015), pages 37-40
ISBN: 978-989-758-159-5
Copyright
c
2015 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
37
Figure 1: Instants of interest definition.
threshold calculus based on histograms, ii) counting
of samples exceeding the threshold by adopting a par-
ticular manner to scan the analysis window, iii) de-
tection of the instants of pre-motor onset, motor onset
and offset, iv) and finally corrections and adjustments
in case of burst or noise. Section 4 presents the results
using subjective comparison and quantitative evalua-
tion based on error rates calculus. Finally some con-
clusions and perspectives are given.
2 PRELIMINARY PROCESSING
After EMG recording, some preliminary tasks are car-
ried in order to prepare data for pre-motor onset, mo-
tor onset and motor offset detection.
The DC component and very low frequency com-
ponents due to movement and other artifacts are
eliminated thanks to a high-pass filtering whose
cutoff frequency is 10 Hz. Fig.2.a shows an ex-
ample of a pre-processed EMG signal composed
of 3 contractions of the superficial flexor of the
forearm during a handgrip exercice. The contrac-
tions last 4.4 s and are alterned with rest intervals
of 44s.
The EMG signal is smoothed so that the steep
spikes are cut away and the signal looks like an
envelope (see Fig. 2.b). The Root Mean Square
(RMS), which reflects the mean power is used:
RMS(n) =
v
u
u
t
1
N + 1
N/2
k=N/2
x(n + k)
2
, (1)
where N is the sliding windows size on which
each EMG sample x(n) is smoothed. It is chosen
equal to 512 samples for a sampling frequency of
1 kHz.
A preliminary Muscle Activity Detector (MAD)
is estimated by comparing each amplitude to a
threshold (see Fig.2.c):
MAD(n) =
1 ifRMS(n) > τ
0 otherwise,
(2)
Figure 2: EMG signal, RMS signal and associated MAD
flag.
Figure 3: Histogram of the RMS signal.
Where τ is the threshold. It is obtained using the
following approach.
A long RMS signal composed of 15 contractions
is used. It is composed of 4.4 15 = 66 seconds
of activity and 44 15 = 660 seconds of inactivity.
The ratio between these two durations is ten.
The histogram of this long RMS signal is cal-
culated and illustrated in Fig. 3. It contains one
significant peak which represents samples with
low values occurring mainly during rest interval.
The small peak situated for higher RMS values
reflects muscle activity.
From the histogram, the position of the maximum
is estimated and is denoted µ and the standard de-
viation is denoted σ. The threshold τ is estimated
as follows:
τ = µ + γ.σ, (3)
where γ is a regulation parameter adjusted empir-
ically. For muscle activity detection, the experi-
ment showed that it can be chosen equal to 0.5.
icSPORTS 2015 - International Congress on Sport Sciences Research and Technology Support
38
3 KEY INSTANTS DETECTION
According to the MAD, each contraction is cen-
tered on a window composed of the half of the
rest interval preceding it and the half of the rest
interval following it. It is called the search inter-
val (see Fig.2.b).
The work begins in the center of the search inter-
val. Traveling in the direction of the beginning of
the interval, a counter index is associated to each
position i of the selected window:
C(i) = n
h
(i) + n
l
(i), (4)
where n
l
(i) (resp. n
h
(i)) is the accumulated
number of RMS values under (resp. above) the
threshold τ from position 1 to i (resp. from
position i to the end). Experimentally and in this
part of the work, the threshold is obtained for
γ = 3 in Eq. 3.
The same process is done by coming back to the
center of the search interval and traveling in the
direction of the end of the search interval.
Fig.4 (resp. 5) illustrates the counter index and its
first order derivative in the case of a contraction
without (resp. with) preparation. One can notice
from Fig. 5 that the counter index increases un-
til the contraction preparation begins, it then de-
creases until the effective contraction begins. It
remains constant until the end of the contraction
and finally, it increases again.
The decision to detect the instants of preparation
(pre-motor), onset and motor offset are based on
the derivative of the counter index (lower parts in
the previous figures). The rule is straightforward:
if the derivative changes from +1 to -1, the pre-
motor onset is detected. If the derivative changes
from -1 to 0, the motor onset is detected and fi-
nally, if the derivative changes from +1 to 0, the
motor offset is detected.
Unfortunately, some undesirable short contrac-
tions and bursts can arise during EMG acquisi-
tion (see for example Fig. 6). They generate, in
the counter index, some local deviations from the
right way. To avoid them, a smoothing, using for
example the median filter, is applied on counter
index.
Moreover, if many onset and offset candidates ap-
pear in one analysis window, only one effective
onset and only one effective offset must be re-
tained, they are those who correspond to the maxi-
mum area in the RMS signal. In fact, the effective
contraction lasts more and have more energy than
local burst due to noise or undesirable short con-
tractions.
Figure 4: The RMS signal, the counter index and its deriva-
tive for a contraction without muscle preparation.
Figure 5: The RMS signal, the counter index and its deriva-
tive for a contraction with muscle preparation.
Figure 6: The RMS signal, the counter index and its deriva-
tive for a contraction with short contractions and bursts.
4 RESULTS
To conduct the study, a particular experimental proto-
col was defined. 24 young motivated adults (12 male
and 12 female) performed a hand grip motor perfor-
mance. We chose the superficial flexor to validate the
method.
Two separate guidelines were presented to the par-
ticipants:
an auto-initiated (self-made) mode: the start and the
end of the contraction are managed by the subject it-
self, without preparation set-point.
an external triggered mode: a preparation directive
is given (”get ready”) followed by an execution direc-
tive (”Go”) after 6.6 seconds.
For each mode, 5 consecutive hand-grip contrac-
tions are carried. Each one lasts 4.4 seconds and is
followed by a long period of rest (44 seconds).
Extraction of Some Relevant Instants from EMG Signal
39
Table 1: Error rate of instants estimation.
Instant pre-motor onset motor onset offset
Total error rate (%) 17 3.3 2
Figure 7: Illustration of relevant instants detection.
The EMG signals are recorded using EL508 system
which is produced by the BioPac company. Signals
are sampled at 1kHz.
Fig. 7 shows an example of muscle contraction
and the detected instants. From visual inspection, one
can see that pre-motor onset, motor onset and offset
are well detected.
From the database of the 240 contractions, we cal-
culate the relative error as the difference, in absolute
sense, between the estimated instant and the one de-
termined by visual inspection. The error rate is re-
sumed in Tab. 1. One can see that error rate is very
low for motor onset and offset (3.3% and 2% respec-
tively). It is however, slightly higher for pre-motor
onset (17 %). This last result is predictable since pre-
motor phase is characterized by low level signal and
can be confused to acquisition noise and muscle rest.
When they are non null,the values of errors, in mil-
liseconds, are:
motor onset: 36, 260, 344, 383, 1002, 1633 and
1708,
: offset: 112, 114, 115, 119 and 167,
pre-motor onset: the number of errors is higher,
thats why their histogram is used for illustration (Fig.
Figure 8: Histogram of pre-motor onset estimation error.
8). One can see that the error range value is quite
large (from 0 to 6500 ms). It means that when an er-
ror occurs, the estimation can be either quite precise
or quiet wrong.
5 CONCLUSION
In this paper, an automatic algorithm to detect some
important instants in EMG signal has been developed.
It is based on the entire EMG signal (including rest in-
terval) to estimate a threshold and to count, in a par-
ticular manner, the number of samples exceeding it.
The results are very satisfactory in terms of motor on-
set and offset and present slight errors for pre-motor
onset detection.
REFERENCES
K. T. Ozgunen, U. Celik and S. S. Kurdak, “Determination
of an optimal threshold value for muscle activity de-
tection in EMG analysis, Journal of Sports Science
and Medicine N9, pp. 620–628, 2010.
X. Li and A. S. Aruin, “Muscle activity onset time detec-
tion using Teager-Kaiser energy operator, Proc. of
the IEEE Engineering in Medicine and Biology, Sept.
2005.
J. Lee, H. Ko, S. Lee, H. Lee, Y. Yoon, “Detection technique
of muscle activation intervals for sEMG signals based
on the Empirical Mode Decomposition, Proc. of the
IEEE Engineering in Medicine and Biology Society
EMBC, 2009.
J. Alegria, “Contr
ˆ
ole strat
´
egique du choix d’un instant pour
se pr
´
eparer
`
a r
´
eagir,”. Requin, Anticipation et Com-
portement, Editions du CNRS, Paris, pp. 95–105,1980.
J. H. Abbink“Muscle response to loading during rythmic
open-close movements of the jaw, PhD thesis,Utrecht
university- the Netherlands, Sept. 1999.
icSPORTS 2015 - International Congress on Sport Sciences Research and Technology Support
40