Electromyography and Applications Based on the Interpretation of the Electrical Activity Associated with the Depolarization-Repolarization Cycle of the Muscle Fiber Membrane

.The aim of this paper is to present the implementation of a method for data acquisition, processing and interpretation of the electrical activity associated with the muscle fiber membrane, generated as a result of the ionic pumps’ action. By using a biofeedback shield (EKG/EMG shield) for differential amplification and analog signal filtering, an Arduino development board for analog to digital conversion and an external processing unit, a series of experiments were carried out. These referred to medical diagnosis and research, human-machine interfaces (control of a robotic joint which could be used for prosthetic limbs or industrial robots, as well as control of the computer – for video games, virtual reality, interaction with other devices), and monitoring and increasing sports performance. Due to its noninvasive characteristics, this technique, known as surface electromyography, proves to play a significant role in areas such as medical research, rehabilitation, ergonomics, sports etc.


1.Introduction
The fundamental structural unit of the striated (skeletal) muscles is the muscle fiber, which, together with the dendrites and axons of a motor neuron, forms the motor unit which is the smallest functional structure that describes the neuronal control of the muscle contraction process. The electrical properties of the sarcolemma (also called myolemma -the cell membrane of a striated muscle fiber cell) can be described by means of a semi-permeable membrane model [1]. There is a voltage (a potential difference called the membrane potential, Em) between the two sides of the membrane, generated by an unequal distribution of electrical charges. This difference in the electric potential, which is maintained by physiological processes such as ionic pumps, leads to a buildup of intracellular negative charge relative to the outer surface of the membrane [2].
In order to calculate the voltage across the membrane that results from the contribution of all the monovalent ions (both M + cations and Aanions) that can go through the membrane, we can use the Goldman-Hodgkin-Katz (GHK) equation [3,4] (1) where Em is the membrane potential (V), Pion -permeability for the ion (m s -1 ), [ion]out and [ion]inextracellular and intracellular concentrations of the ion (mole m -3 ), R -ideal gas constant (J mole -1 K -1 ), T -temperature (K), F -Faraday constant (c equiv -1 ). Substituting the known values of concentration and permeability of the main ions (Na + , K + , Cl -) in the Goldman-Hodgkin-Katz equation a voltage value of about -80 mV ÷ -90 mV is obtained during the resting period.
The excitation of the motor nerve (via motor neurons in the spinal cord activated by the central nervous system or by a reflex) causes the release of neuro-transmitters from the synaptic button and the emergence of an electrical potential at the point of innervation. The phenomena of ion diffusion through the membrane are temporarily modified and an influx of Na + occurs in the intracellular space, causing a membrane depolarization. This is immediately followed by the action of the active ion pumps mechanism which restores the concentration at the sarcolemma, also producing a small hyperpolarization (Figures 1 and 2]. This excitation leads to calcium ions entering the intracellular space, which is followed by an electro-mechanical coupling that shortens the muscle fibers through the contractile myofilaments (actin and myosin). After the initial excitation, the same phenomena propagate along the muscle fiber at a speed of 2-6 m s -1 [4]. The action potentials within the sarcolemma are responsible for the electrical activity of the skeletal muscles. The electromyography (EMG) is an electrodiagnostic technique for measuring this activity. By using a bipolar electrode configuration and another third electrode for common mode rejection, these depolarization-repolarization cycles can be studied. Due to the fact that a single motor unit contains multiple muscle fibers, the two electrodes system receives as input the overall (summed) magnitude of the fibers (Figure 3) [4].  This paper provides an accessible approach for studying these signals, aiming to be a starting point for developing more sophisticated devices certified to be used in professional scenarios. Through simplicity and by implementing the techniques in various applications, it makes this field available to not only those with a medical background, but also to people passionate about the subject that have minimal engineering skills. Interpreting the EMG data for diagnostic purposes requires a more in-depth research that is not covered in this paper. "Despite the availability of sophisticated systems for EMG acquisition and of easy-to-use software for the processing of EMGs, misleading conclusions may be drawn by non-expert users. Being familiar with methodological issues regarding the use of surface electromyography is, therefore, a sine qua non condition." [5].

2.Materials and methods
The main structure of an EMG analysis system can be divided into three blocks: the data acquisition system, the signal amplification block and the real-time processing system ( Figure 4). Because a bipolar configuration of the signal acquisition was used, there will be two electrodes and one used as a reference (common mode rejection) as Figure 5 shows. The two detection surfaces are positioned at 1-2 cm relative to each other and their output signal is sent towards a differential amplifier which removes the commonmode signal and amplifies the difference [6]. Before getting to the computer, the signal must be sampled, a process carried out by the Arduino Uno board, configured to work with a sampling rate of 200 Hz and a 10-bit ADC (Analog to Digital Converter). The Arduino development board handles a bidirectional signal transmission with the processing unit, because besides sending data to the computer, it also needs to control other devices connected to it, such as displays, motors, LED bands, etc.
The functionality of the electrodes is based on the chemical balance between the skin and the detection surface, by electric conduction, so that the electrons can flow through the electrode. However, the electrodes present some drawbacks and limitations. Being applied on the skin's surface, they are generally used only for superficial muscles and interference caused by nearby muscles represents a big issue. Also, they must have a stable position on the skin, so that the signal is not distorted. Placing the electrodes just above the middle of the muscle turned out to be the optimal spot for detection, muscle fiber density being the highest in that area. The receiving signal must be compared against a reference. That reference is given by a third electrode that acts as a grounding point and must be placed as far away as possible from the measuring region, on an electrical neutral tissue.
EMG signal amplitude was between 1 and 10 mV (+5 mV, -5 mV) before it goes through the amplification block, with a frequency between 0 and 500 Hz, the most dominant one being between 50-150 Hz. Noise is a critical factor that can influence the signal and that's why it is necessary to know its origins as followings [5]: (1) Intrinsic noise of the equipmentall electrical equipment generate noise and it cannot be removed, but only reduced by using high quality components; (2) Ambient noiseelectromagnetic radiations. Our body is constantly bombarded by EMG waves which can have an amplitude as high as 3 times more than the signal we are trying to measure; (3) Distortions due of movement, which generate irregularities in the signal. These can be caused by electrodes interference or electrode cable movement; (5) Intrinsic instability of the signal. EMG magnitude is random and generally it is influenced by the rate of motor unit activation, which usually has a frequency between 0 and 20 Hz.
The device used in the present work for differential amplification and analog filtering of the EMG signal was the EKG/EMG shield from Olimex [5], which allows experimenting with human biofeedback ( Figure 6). The unprocessed and not digitally filtered signal acquired is called "raw EMG signal" ( Figure  7). The shapes it shows are random, in the sense that one recording cannot be recreated. This is because the motor units involved in the contraction can change their position relative to one another; if one or more motor units are activated at the same time and are physically close to the electrodes, they will produce a bigger superposed signal [7].  One of the most applied processing steps is signal rectification (Figure 8). This involves converting negative amplitudes into positive ones by using absolute values. Besides offering an easier signal reading, the main effect is that the standard amplitude parameters (mean value, peak, area) can now be available to analyze. The next part in the digital data processing is the calibration. This is personalized for each individual and mainly it involves measuring the signal while the person is relaxed; the obtained data were as a reference point, a baseline for future recordings (Figure 9). By calculating a mean signal value during these relaxation periods and subtracting it from future recordings one can get a cleaner signal, easier to work with. In ideal situations, after calibration took place, during the resting period we should see an almost horizontal line (with no variations).

Figure 7. EMG signal during muscle relaxation
The next and most important step was implementing the real-time Fourier transform. Taking into consideration the central processing unit (CPU) power of the devices used, the most stable results were obtained by applying the Fourier transform over a 0.64 s window (128 samples). Because a sampling rate of 200 was used, the maximum frequency shown will be 100 Hz (the Nyquist frequencythe highest frequency that can be represented for a specific sampling rate, so that the signal can be reconstructed). A small spike is noticeable at 50 Hz due to the line frequency in Romania which is 50 Hz (Figures 10  and 11). The main programming language used for system processing and control is Python, a programming language that emphasizes on code cleanliness and simplicity, with a syntax that allows developers to express their ideas in a cleaner and more concise way than other programming languages, such as C program [8].

3.Results and discussions Pathology
Surface electromyography, because of its noninvasive nature, can offer just a limited overview of the muscular activity, enough though to diagnose certain medical problems. Basically, there are five main questions that could be answered by an EMG analysis: 1. Is the muscle active? 2. Is the muscle more or less active? 3. When is the muscle active/inactive? 4. For how long time is the muscle active? 5. Is there any muscle fatigue? Like any other bio-mechanical method, the EMG analysis focuses only on one subsystem. Muscles are the ones that make locomotion possible, but they are controlled by the central nervous system. Thus, electromyography of a single muscle can never answer the question of 'why?' [7]. In simple terms, the word 'fatigue' is utilized to indicate the level of tiredness. For muscles, this tiredness means reducing the ability to produce power even when they are stimulated by neuronal impulses from the spinal cord or by external electrical impulses. Before fatigue sets in, some alterations of the electrical activity can be seen during the muscle activity ( Figure 12). There are some situations when EMG results can show neuronal dysfunctions, being able to diagnose diseases such as amyotrophic lateral sclerosis (ALS)a progressive neurodegenerative disease affecting nerve cells in the brain and spine [9].  For monitoring the muscular activity, a web interface was implemented, which communicates in real time with the data acquisition system, offering the user an accessible way to track and interact with the information (Figure 13). By using an intuitive interface accessible from any mobile device, one can get data regarding the amplitude of each contraction, time lengths and counts.

Sport activities
Surface electromyography also has a great influence in sports and ergonomics, being usually used to quantify the magnitude and timing of muscle usage during different types of activities. Improving the efficiency of the movements implies correct muscle use, both in terms of effort distribution and in accident prevention. For this purpose, an application for assistance in carrying out physical exercises has been made, which can count reps, stopwatch them and measure efficiency. The user is asked to choose a desired type of exercise from a preset menu ( Figure 14) and then he receives relevant information about him together with the aforementioned features. Figure 15 illustrates an example of such application for physical exercises.  In order to provide a visual feedback during the exercise, by using a light band that allows individual LEDs (light-emitting diodes) to be controlled, a system that shows the amplitude of each contraction was developed. According to the power applied for each contraction, more LEDs turn on or off in different colors (Figure 17). This kind of system was already implemented in modern gyms for performance self-assessment, usually having more complex animations.

Prosthetics
The use of the EMG signal as a decisive criterion in the manipulation of a robotic arm is demonstrated through the thresholding technique [10]. Once the signal is received in digital format, the values are compared with a certain value of amplitude (threshold). When the signal exceeds this value, the micro controller will send the binary value "1" to a digital pin connected to the motor (joint), or "0" otherwise. It is recommended that this threshold value be set around the midpoint of the variation interval. For generating the commands, in this work the authors did not use the raw EMG signal, but the magnitude of the frequencies in the Fourier transform, in order to facilitate the development of functions such as pattern recognition. Since a fully functional robotic arm was not the purpose of this article, the concept was demonstrated with a miniature that mimics the joint between the arm and forearm, being capable to perform flexion/extension of the forearm based on the interpretation of the EMG signal from the biceps (Figure 18). Depending on the capabilities of the processing unit, micro-controller and size of the fast Fourier transform (FFT) window, the delay between muscle activation and the response of the prosthetic arm may be greater or lower, with the average value of around 0.2 s (in experimental test). To perform other movements of the upper limb, such as pronation, supination, abduction and adduction, a multi-channel analysis is required, as these complex movements require the activation of several muscles. The techniques presented above can also be used for another category or applications; for example, if a person has lost the ability to fully control their hands the surface electromyography can allow the translation between movement intent into cursor's position on a screen, thus allowing the interaction with devices such as the computer. This is achieved by interpreting the small contractions (considering that they still exist) from the forearm that would move the ligaments from the hand. By breaking down https://doi.org/10.37358/RC.20.9.8343 the EMG signal into its component frequencies and using pattern recognition techniques, it is possible to determine the movement intention for each finger [11].

Conclusions
The applied methods presented here were based on the classic technique of detection and amplification of the differential (bipolar) signal. Currently, improved measurements techniques are being developed, including approaches based on multi-channel analysis on a single muscle. By combining these methods with sophisticated mathematical algorithms and digital signal processing techniques, a solid basis is formed for standardization of new methods that can be applied in biomedical situations.
Although it is far from being used in real diagnostic or prosthetic control situations, the techniques presented and the applications implemented can provide a stable starting point in developing efficient, reliable equipment, offering an alternative approximately 25 times cheaper than the professional existing product in the market, with the lower cost that performs similar functions. However, it can be used with confidence in activities such as monitoring muscle activity, tracking exercise efficiency, observing the ergonomics of a certain activity/device, or increasing sports performance.
Another advantage of the way this system was implemented is the use of open source resources, which allow those passionate about this field to contribute to its development.