Time Domain Analysis of EMG Signals using KNN and
SVM Techniques
PRAKASH M B1, HARISH H M2, NIRANJANA KUMARA M3
1,2,3Department of Electronics and Communication Engineering
1,3Goverment Engineering College, Hassan, INDIA
2Goverment Engineering College, Haveri, INDIA
Abstract: The EMG signals that have been processed can mimic human movements. For this study, raw
EMG data obtained when the hands are in repose (rest), in a clasp, and when the wrist is buckled and
stretched were used to categorise four distinct forms of hand gestures using a MATLAB-based intelligent
framework (open access data set). Statistical-time-domain features are applied to sort various hand gestures
in this investigation. The K-Nearest-Neighbor (KNN) and Support-Vector-Machine (SVM) classifiers are
used for classification and comparison. Furthermore, our method outperforms a state-of-the-art method on
other data sets of hand gestures.
Keywords: Hand gesture recognition, Support-Vector-Machine, K-Nearest-Neighbour, Electromyography,
Empirical Mode Decomposition, Kaggle Database
Received: April 21, 2021. Revised: March 14, 2022. Accepted: April 15, 2022. Published: May 9, 2022.
1. Introduction
Individuals who have their upper limbs amputated
go through a terrible experience. Limb loss affects
around 0.0017 billion people in the United States,
or about one out of every 200 people. Every year,
50,000 new amputation cases are reported to the
National Center for Health Statistics. The most
prevalent are partial hand amputations, which
result in the loss of one or more fingers.
Amputations can occur for a variety of reasons.
Peripheral arterial disease, or impaired circulation
caused by injury or constriction of the arteries, is
the most common cause. If there isn't enough
blood flow, the human body's cells won't get the
oxygen and nutrition they require. If the damaged
tissue doesn't get enough oxygen, it starts to die,
and infections might develop. Severe injuries are
another factor. Other causes include severe injuries
sustained in traffic accidents, combat, severe
burns, explosions, malignant tumours in the
muscles or bones of the limbs, and infections that
are resistant to treatment.
Human bioelectric signals have been
widely studied and used in a number of therapeutic
and psychological research studies. A bio-
electrical signal is a signal acquired from any
organ that exhibits an important physical property.
A bio-electric signal is a time-dependent signal
that may be characterized in terms of frequency,
amplitude and phase. The EMG has recently been
used in the rehabilitation of individuals who have
had amputations in the form of robotic prostheses.
EMG is a highly helpful instrument since it gives a
natural way of sensing and identifying various
body motions.
Electromyography (EMG) is a biological
signal that is used to evaluate muscle responses or
electrical signals generated by skeletal muscles.
Electrical signals termed impulses are sent from
the nerves to the muscles, and these impulses may
be detected and studied using EMG sensors. The
EMG's amplitude and spectrum are affected by the
skin's temperature and thickness, the fat layer
between the skin and muscles, the rate of blood
flow, and the sensors' placement. Muscle function
and EMG signals deteriorate as a result of fatigue,
ageing, and neuromuscular disorders. Depending
on the type of sensor, there are two types of
EMGs. One is related to the surface, whereas the
other is intramuscular. Electromyography (EMG),
which records electrical activity in muscles, should
be considered an add-on to the clinical exam. It
can differentiate between neurogenic and
WSEAS TRANSACTIONS on SIGNAL PROCESSING
DOI: 10.37394/232014.2022.18.10
Prakash M. B., Harish H. M., Niranjana Kumara M.
E-ISSN: 2224-3488
70
Volume 18, 2022
myopathic muscular weakness. This can detect
abnormalities in clinically normal muscles, such as
chronic denervation and fasciculation. It can
differentiate between focal nerve, plexus, and
radicular diseases and give supporting evidence of
the pathophysiology of peripheral neuropathy,
such as axonal degeneration or demyelination, by
detecting the distribution of neurogenic
abnormalities. In motor neuron disease,
electromyography (EMG) is required to show
widespread denervation and fasciculation, which is
necessary for a correct diagnosis.
2. Problem Formulation
Nikitha Anil [6] employed wavelet decomposition,
a signal processing approach in which signals are
decomposed into wavelet coefficients with spatial
and temporal localization. The dataset is made up
of these coefficients, which are categorized using
Support Vector Machines (an ML technique). In
this study, to reduce the number of features in
EMG data, Principal Component Analysis (PCA)
and Uncorrelated Linear Discriminated Analysis
(ULDA) were used, while SVM was used to
discriminate unique movements in real-time. After
extracting five Eigen values in the temporal
domain, the scientists utilised a Neural Network
(NN) to detect six motions. In their suggested
model, they got 93% accuracy.
Jingxiang Chen, et al. (2019)[4] propose
two methods for combining information from the
Leap Motion and Myo sensors, resulting in
significantly improved hand tracking accuracy for
the operator. They also use the Myo sensor's EMG
data in conjunction with convolution neural
networks to solve Leap Motion's problems of
reliably recognising the active fingers.
Ahsan et al.[9] proposed a study that
combines an EMG signal with an Artificial Neural
Network to recognise motions (ANN). It discusses
a comprehensive investigation of EMG signals and
the development of a human-computer interface
(HCI) to assist the elderly and crippled. With a
success rate of 88.4%, hidden layers of 10 neurons
generated the best result out of a dataset of 204
samples. To categorise the hand motions produced
by the MYO armband, the author employed the k-
nearest neighbour and dynamic temporal warping
methods. They also integrated a muscular activity
detector, which reduces processing time and
increases identification accuracy. Finally, they
calculated an accuracy of 89.5 percent and
concluded that their model surpasses both MYO's
and other systems. They used two hand
movements: a relaxed hand and a closed hand,
according to them. They extracted statistical time
domain characteristics and utilised KNN and SVM
classifiers to recognise them (mean, variance,
kurtosis, and skewness). They eventually achieved
96.58 percent accuracy.
Andi Dharmawan; CaturAtmaji;
DanangLelono; AgusHarjoko,[22] Artificial
Neural Networks (ANNs) and long-short-term
memories, as well as the foundations of finger
motion classification with four electrodes, were
used to compare the variation of characteristics
that would be used for classification in the time
domain or frequency domain (LSTM). According
to the findings of this investigation, using time
domain data for classification with artificial neural
networks (ANNs) produces more accuracy than
using LSTM. This is due to the movement's brief
period of only two seconds in this investigation.
When using the frequency domain feature, the
results demonstrate that using LSTM improves
accuracy, especially in terms of mean-power and
median-frequency characteristics.
Apiwat Junlasat, et al.[18], presented finger
movement detection based on several EMG
locations. EMG signals were recorded using
Myoware muscle sensors. In a low-cost
computational processing unit, the recorded EMG
signals are gathered and analysed.
Michele Barsotti et al.[19] suggested a
minimally supervised, online myocontrol system
for proportional and simultaneous finger force
estimate utilizing just individual finger tasks,
based on ridge regression and training..They
compared the system's performance using two
feature sets taken from high-density
electromyography (EMG) recordings: EMG linear-
envelope (ENV) and non-linear EMG to muscle
activation mapping (ACT). On eight participants
with intact limbs, they used online target-reaching
tasks.
3. Problem Solution
3.1 Proposed Methodology
The study technique utilised to categorise EMG-
based hand movements is depicted in Figure 1.
The collection of raw data was the first step in the
development of our system. We collected EMG
signals from diverse hand motions using an open-
access data set [2]. Before conducting
classification, the next step is to preprocess the
datasets and eliminate the noise components from
the signal (segmentation). We did this using
Empirical Mode Decomposition (EMD), which not
WSEAS TRANSACTIONS on SIGNAL PROCESSING
DOI: 10.37394/232014.2022.18.10
Prakash M. B., Harish H. M., Niranjana Kumara M.
E-ISSN: 2224-3488
71
Volume 18, 2022
only segregates our research region but also
eliminates the undesired high-frequency
components (0–500Hz). Following that, we
extracted the time domain characteristics from the
segmented EMG signals and classified them for
gesture detection using a k-nearest neighbour
classifier.
Fig 1. Proposed block diagram.
3.1.1. Dataset
The Kaggle Machine Learning Repository dataset
[2] was used in our research. They used a MYO
thalamic bracelet with eight separate sensors that
collected myography signals over eight channels to
collect EMG data. We observed 36 people
performing six different hand motions, but we only
looked at three of them: "hand at rest," "hand
clenched in a fist," and "wrist extension." Each
move lasted three seconds, followed by a three-
second break.
Fig 2. Unprocessed EMG signals of hand gesture.
3.1.2. Pre-Processing and ROI extraction
Instrument noise and baseline interference are the
most common types of noise detected in EMG
data. Thus, we will first remove variance from this
dataset in order to ensure that all signals have the
same range, and then use the Empirical Mode
Decomposition (EMD) techniques to filter out any
unprocessed EMG signals affected by these
disturbances. EMD decomposes the signal into
IMFs with varying resolution scales, similar to
wavelet analysis. In EMD, a pre-designed mother
wavelet that is selected before the investigation
determines the fundamental functions for the
different scales, whereas in wavelet analysis, the
basic functions for the various scales are dictated
by a pre-designed mother wavelet that is chosen
before the research.
As a result, IMF is better able to describe the
local properties of a signal and adjust to its
oscillation patterns over time. As a consequence,
EMD is appropriate for studying nonlinear and
non-stationary signals as a consequence of this
advantage, and may thus be used for EMG
analysis. Following decomposition, the IMFs were
formed in order, with each IMF having a lower
frequency and a residual signal than the one before
it. Mathematically,
 󰇛󰇜
󰇛󰇜󰇛󰇜󰇛󰇜
󰇛󰇜

Because our major purpose was to denoise and
distinguish ROI rather than decomposing the
unprocessed EMG signals into distinct IMFs.
Selecting IMFs with lower frequency(LMFs)
components and eliminating all IMFs with higher
frequency components accomplishes this.
Fig 3. Standardized EMG signals of hand gesture.
WSEAS TRANSACTIONS on SIGNAL PROCESSING
DOI: 10.37394/232014.2022.18.10
Prakash M. B., Harish H. M., Niranjana Kumara M.
E-ISSN: 2224-3488
72
Volume 18, 2022
Fig 4. Segmented EMG signal when Hand at rest
3.1.3. Feature Extraction
Feature extraction is a technique for obtaining
attributes from EMG data. Mean-Absolute-Value
(MAV), Root Mean Square (RMS), Variance
(VA), and Simple Square Integral (SSI) were
computed for each movement. Because EMG
signals are in TD, they are referred to as time-
domain (TD) features. The feature extraction value
will be utilised as an input to the classification
model.
3.1.4. Mean-Absolute-Value (MAV)
The absolute average of the EMG signal is
designated as MAV. The MAV is the computer-
calculated corresponding average revised value
(ARV). The MAV is referred to as a time-domain
variable because it is measured as a f(t), i.e. as a
function of time.It shows the area beneath the
EMG signal after it has been rectified, which
means that all (-ve) negative voltage values have
been transformed to (+ve) positive voltage values.
The MAV is used to determine the amplitude of
the EMG signal. The following formula is used to
compute it: 

 󰇛󰇜
Where N denotes the signal's whole length
andXkrepresents the EMG signals.
Fig 5. Segmented EMG signal when Hand at
clinched fist
3.1.5. Root Mean Square
The RMS is the square-root of the average power
of the EMG signal (RMS). The RMS represents
constant force and nonfatiguing contraction, and
it's characterised as an amplitude modulated
Gaussian (AMG) random process. Because it
represents the physiological activity in the motor
unit during contraction, its level has been used to
measure the electrical signal.
It's worded like this:


 󰇛󰇜
3.1.6. Variance
The power density of an EMG signal is measured
using EMG Signal Variance. The value of the
EMG signal variance might be zero. Since EMG
signals are based on white Gaussian noise
(AWGN).
The following formula may be used to
compute it:

󰇛
󰇜󰇛󰇜

WSEAS TRANSACTIONS on SIGNAL PROCESSING
DOI: 10.37394/232014.2022.18.10
Prakash M. B., Harish H. M., Niranjana Kumara M.
E-ISSN: 2224-3488
73
Volume 18, 2022
Fig 6. Segmented EMG signal when Wrist flexion
3.1.7. Simple Square Integral (SSI)
The EMG signal energy is measured by the SSI.
It's comparable to ZC, another approach for
displaying EMG signal frequency data. This is
how it's spelled out:

 󰇛󰇜
a. Classification
Comparison of the test EMG [9] feature vectors to
the learned EMG feature vectors is performed
using distance and similarity metrics. The closest
sample from the training set was determined to be
the unidentified test sample. While measuring
distance, the lowest value is utilized, when
measuring similarity, the highest value is used.
This strategy is simple yet ineffective. Instead of
just selecting a nearby training set sample,
accuracy may be enhanced by analyzing a group of
neighboring feature vectors. This is known as the
K-Nearest Neighbor (KNN) approach. K best-
matching neighbors are selected to classify the
unknown sample into the specific class. K might
be anything from one to the total number of
images in the training sets. The K value utilized
determines the accuracy of recognition. As the
value of K increases, we compare matching to
non-matching neighbors in the training sets.
3.2.1. K-NN model
For a given query instance, the K-NN
algorithm functions as follows:
󰇛󰇜
󰇛󰇜
󰇝󰇞
 󰇛󰇜
Where, is the expected class for the query
object, is a class number, and is the class
number of a data. 󰇛󰇜the set of nearest
neighbors. 󰇛󰇜󰇥

Where Euclidean distance between query
instance vector and trained vector.
󰇛󰇜
 󰇛󰇜
b. Results and Discussion
Simulation has been carried out in MATLAB for
the detection and categorization of diverse EMG-
based hand motions, we used normalization,
empirical mode decomposition, and KNN. For
evaluating the efficacy of parameters, we
employed numerous performance metrics
generated from the testing dataset, including
sensitivity (Se), specificity (Sc), false value (Fn),
true value (Tp), accuracy (Ac), and precision (Pp).
From the confusion matrix, determine the
classification's accuracy, sensitivity, and
specificity.

󰇛󰇜
 
󰇛󰇜

󰇛󰇜
WSEAS TRANSACTIONS on SIGNAL PROCESSING
DOI: 10.37394/232014.2022.18.10
Prakash M. B., Harish H. M., Niranjana Kumara M.
E-ISSN: 2224-3488
74
Volume 18, 2022
Table 1: The proposed work is compared to other
Classifiers
Model
Accur
acy
Sensiti
vity
Execut
ion
Time
(Sec)
Proposed
(K-
NN)
98.45
98.02
1.92
RBF
Network
96.63
98.33
2.78
Naive
Bayes
96.92
97.79
5.66
Random
Forest
97.76
98.52
4.55
4. Conclusion
In this research, we provide a thorough and
groundbreaking method for categorising hand
motions using EMG data. Normalization was
performed to eliminate variation after empirical
mode decomposition was used to segment raw
EMG signals. After a comprehensive analysis, the
best classifier for gesture classification was
selected. Finally, the best features of dimension
1x4 were used to train and evaluate K-NN,
resulting in an accuracy of 98.45%, a specificity of
98.02%, and a sensitivity of 99.66% with a margin
of error of less than 2%.
References:
[1] Diane W. Braza, Jennifer N. Yacub Martin,
Upper Limb Amputations,” Essentials of
Physical Medicine and Rehabilitation (Fourth
Edition), Elsevier, 2020, page 651-657
[2] “EMG Signal for gesture recognition| Kaggle.”
https://www.kaggle.com/sojanprajapati/emg-
signal-for-gesturerecognition (accessed Feb. 08,
2022).
[3] Marco E. Benalcázar, Andrés G. Jaramillo,
Jonathan A. Zea, and Andrés Páez, Hand
Gesture Recognition Using Machine Learning
and the Myo Armband”, 25th European Signal
Processing Conference (EUSIPCO), 2017.
[4] Jingxiang Chen, Chao Liu, Rongxin Cui,
Chenguang Yang, Hand Tracking Accuracy
Enhancement by Data Fusion Using Leap
Motion and Myo Armband”, 2019 International
Conference on Unmanned Systems and
Artificial Intelligence pages 256-261
[5] Tony Chau Machine Learning for Gesture
Recognition with Electromyography,”,
Norwegian University of Science and
Technology,Dept. of CS, June 2017,
unpublished.
[6] Nikitha Anil, Sreeletha S.H “EMG based
Gesture Recognition using Machine Learning,”
International Conference on Intelligent
Computing and Control Systems (ICICCS
2018).
[7] SACHIN NEGI, YATINDRA KUMAR, V. M.
MISHRA,“Feature Extraction and Classification
for EMG Signals Using Linear Discriminant
Analysis ,” IEEE Trans, 2016.
[8] Shunzhan He, Chenguang Yang, Min Wang,
Long Cheng, Zedong Hu, “Hand Gesture
Recognition using MYO Armband”, IEEE
Trans, 2017.
[9] Md. R. Ahsan, Muhammad I. Ibrahimy, Othman
O. Khalifa,”, The Use of Artificial Neural
Network in the Classification of EMG Signals”,
IEEE Trans, 2011
[10] Granit Luzhnica, Elizabeth Lex,
ViktoriaPammer. A Sliding Window Approach
to Natural Hand Gesture Recognition using a
Custom Data Glove. In: 3D User Interfaces
(3DUI); 2016 IEEE Symposium on; 2016 Mar
19; New York: IEEE; 2016; p.81-90.
[11] Ji-Hwan Kim,Nguyen Duc Thang,Tae-
Seong Kim. 3-D hand Motion Tracking and
Gesture Recognition Using a Data Glove. In;
Industrial Electronics; 2009 IEEE International
Symposium on; 2009 July 5; New York:
IEEE;2009; p.1013-1018.
[12] Hung CH, Bai YW, Wu HY. Home outlet
and LED array lamp controlled by a smartphone
with a hand gesture recognition. In: Consumer
Electronics (ICCE); 2016 IEEE International
Conference on; 2016 Jan 7; New York:
IEEE;2016
[13] Hung CH, Bai YW, Wu HY. Home
appliance control by a hand gesture recognition
belt in LED array lamp case. In: Consumer
Electronics (GCCE); 2015 IEEE 4th Global
Conference on; 2015 Oct 27; New York:
IEEE;2015; p. 599-600
[14] She Y, Wang Q, Jia Y, Gu T, He Q, Yang
B. A real-time hand gesture recognition
WSEAS TRANSACTIONS on SIGNAL PROCESSING
DOI: 10.37394/232014.2022.18.10
Prakash M. B., Harish H. M., Niranjana Kumara M.
E-ISSN: 2224-3488
75
Volume 18, 2022
approach based on motion features of feature
points. In: Computational Science and
Engineering (CSE); 2014 IEEE 17th
International Conference on; 2014 Dec 19; New
York: IEEE; 2014; p.1096- 1102.
[15] Lee DH, Hong KS. A Hand gesture
recognition system based on difference image
entropy. In: Advanced Information Management
and Service (IMS), 2010 6th International
Conference on; 2010 Nov 30; Seoul; New York:
IEEE; 2010; p. 410-413.
[16] Dulayatrakul J, Prasertsakul P, Kondo T,
Nilkhamhang I. Robust implementation of hand
gesture recognition for remote human-machine
interaction. In: Information Technology and
Electrical Engineering (ICITEE); 2015 7th
International Conference on ;2015 Oct 29; p.
247- 252.
[17] CaturAtmaji; DanangLelono; AgusHarjoko;
AndiDharmawan,The Use of Time and
Frequency Features in Finger Movements Based
on Electromyogram Recording, 2022
International Conference for Advancement in
Technology (ICONAT), 21-22 Jan. 2022,
Publisher: IEEE
[18] A. Junlasat, T. Kamolklang, P. Uthansakul
and M. Uthansakul, "Finger Movement
Detection Based on Multiple EMG
Positions", 2019 11th International Conference
on Information Technology and Electrical
Engineering ICITEE 2019, vol. 7, pp. 7-10,
2019.
[19] M. Barsotti, S. Dupan, I. Vujaklija, S.
Došen, A. Frisoli and D. Farina, "Online Finger
Control using High-Density EMG and Minimal
Training Data for Robotic Applications", IEEE
Robotics and Automation Letters, vol. 4, no. 2,
pp. 217-223, 2019.
[20] N. S. K. Ho et al., "An EMG-driven
exoskeleton hand robotic training device on
chronic stroke subjects: Task training system for
stroke rehabilitation", 2011 IEEE International
Conference on Rehabilitation Robotics, pp. 1-5,
2011.
[21] F. Zhang, L. Lin, L. Yang and Y. Fu,
"Design of an active and passive control system
of hand exoskeleton for rehabilitation", Applied
Sciences (Switzerland), vol. 9, no. 11, 2019.
[22] C. Atmaji, Y. W. Santoso, R. M. Hujja and
A. Dharmawan, "Klasifikasi Gerakan Jari
Tangan Berdasarkan Sinyal Electromyogram
Pada Lengan", Indonesian Journal of
Electronics and Instrumentation System, vol.
11, no. 1, pp. 71-82, 2021.
Contribution of individual authors to
the creation of a scientific article
Prakash M B, has carried out Design and
implementation of Algorithm, Simulation of Results
Niranjana Kumara M has organized and executed
the results.
Harish H M was responsible for collecting related
information about hand gestures, Kaggle database
Statistics collection of data
Creative Commons Attribution License 4.0
(Attribution 4.0 International, CC BY 4.0)
This article is published under the terms of the Creative
Commons Attribution License 4.0
https://creativecommons.org/licenses/by/4.0/deed.en_US
WSEAS TRANSACTIONS on SIGNAL PROCESSING
DOI: 10.37394/232014.2022.18.10
Prakash M. B., Harish H. M., Niranjana Kumara M.
E-ISSN: 2224-3488
76
Volume 18, 2022