108 Al-Khwarizmi Engineering Journal Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) Comparison Study of Electromyography Using Wavelet and Neural Network Nebras Hussain Gheab* Sadeem Nabeel Saleem** Baghdad University/ Al Khwarizmy College of Engineering/ Biomedical Engineering Department *email: nbmeng@yahoo.com **email: sedeemkubba@gmail.com (Received 5 March 2008; accepted 17 July 2008) Abstract In this paper we present a method to analyze five types with fifteen wavelet families for eighteen different EMG signals. A comparison study is also given to show performance of various families after modifying the results with back propagation Neural Network. This is actually will help the researchers with the first step of EMG analysis. Huge sets of results (more than 100 sets) are proposed and then classified to be discussed and reach the final. Keywords: EMG, Wavelet transform, neural network, Back propagation. 1. Introduction Electromyography is the discipline that deals with the detection, analysis, and use of the electrical signal that emanates from contracting muscles. This signal is referred to as the electromyography (EMG) signal. An example of the EMG signal can be seen in Fig. 1. Here the signal begins with a low amplitude, which when expanded reveals the individual action potentials associated with the contractile activity of individual (or a small group) of muscle fibers. As the force output of the muscle contraction increases, more muscle fibers are activated and the firing rate of the fibers increases. Correspondingly, the amplitude of the signal increases taking on the appearance and characteristics of a Gaussian distributed variable [1]. Fig. 1. The EMG signal recorded with surface electrodes located on the skin above the first dorsal interosseous muscle in the hand. The signal increases in amplitude as the force produced by the muscle increases. The nervous system always controls the muscle activity (contraction/ relaxation). Hence, the EMG signal is a complicated signal, which is controlled by the nervous system and is dependent on the anatomical and physiological properties of muscles. EMG signal acquires noise while traveling through different tissues. Moreover, the EMG detector, particularly if it is at the surface of the skin, collects signals from different motor units at a time, which may generate interaction of different signals [2]. Detection of EMG signals with powerful and advance methodologies is becoming a very important requirement in biomedical engineering. mailto:nbmeng@yahoo.com mailto:sedeemkubba@gmail.com Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 109 The main reason for the interest in EMG Besides basic physiological and biomechanical studies, kinesiological EMG is established as an evaluation tool for applied research, physiotherapy/ rehabilitation, sports training and interactions of the human body to industrial products and work conditions, Fig. 2 explain the wide spread use of EMG signal [3]: Fig. 2. The EMG Aspects. However, a number of problems are associated with the recording and the analysis of the transient EMG signal. A main problem is due to the noisy character of the signal. The noisy character is due to the fact that several muscle activations that occur simultaneously are recorded from the electrode(s) that are attached to the skin. What is actually being recorded is the superposition of several muscle activations filtered through different transfer paths of the surrounding tissues and the skin itself [4]. EMG signals are nonstationary and have highly complex time–frequency characteristics. Consequently, these signals cannot be analyzed using classical methods such as Fourier transform. Although the short time Fourier Transform can be used to satisfy the stationarity condition for such nonstationary signals, it suffers from the fact that the performance depends on choosing an appropriate length of the desired segment of the signal. To overcome such problem, Wavelet Transform has been widely used in signal analysis [5]. An important requirement in this area is to accurately classify different EMG patterns for controlling a prosthetic device. For this reason, effective feature extraction is a crucial step to improve the accuracy of pattern classification; therefore, many signal representations have been suggested. The wavelet transform have been successfully applied with promising results in EMG pattern recognition by Englehart and others (1998). The Discrete Wavelet Transform (DWT) and its generalization, the Wavelet Packet transform (WPT), were elaborated in (Englehart 1989a). These techniques have shown better performance than the others in this area because of its multilevel decomposition with variable trade-off in time and frequency resolution. The WPT generates a full decomposition tree in the transform space in which different wavelet bases can be considered to represent the signal. The techniques were applied to feature extraction from surface EMG signals. Amount of coefficients, since the transform space has very large dimension. This fact suggests the systematic application of feature selection or projection methods and dimensionality reduction techniques to enable the methodology for real time applications [6]. This paper continues the work described above by taking different families of Wavelet transform and studies the coefficients of them after passing the training and validate in the neural network. 2. The Raw EMG Signal An unfiltered (exception: amplifier band pass) and unprocessed signal detecting the superposed Multi Unit Action Potentials (MUAP) is called a raw EMG Signal. As given below (Fig. 3), a raw surface EMG recording (sEMG) was done for three static contractions of the biceps brachii muscle: Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 110 Fig. 3. The rAw EMG Recording of Three Contractions the Muscle Biceps Brachii [2]. When the muscle is relaxed, a more or less noise–free EMG Baseline can be seen. The raw EMG baseline noise depends on many factors, especially the quality of the EMG amplifier, the environment noise and the quality of the given detection condition. Assuming a state-of-the-art amplifier performance and proper skin preparation, the averaged baseline noise should not be higher than 3 – 5 microvolts, 1 to 2 should be the target. The investigation of the EMG baseline quality is a very important checkpoint of every EMG measurement. The healthy relaxed muscle shows no significant EMG activity due to lack of depolarization and action potentials! By its nature, raw EMG spikes are of random shape, which means one raw recording burst cannot be precisely reproduced in exact shape. This is due to the fact that the actual set of recruited motor units constantly changes within the matrix / diameter of available motor units: If occasionally two or more motor units fire at the same time and they are located near the electrodes, they produce a strong superposition spike! By applying a smoothing algorithm (e.g. moving average) or selecting a proper amplitude parameter (e.g. area under the rectified curve), the non- reproducible contents of the signal is eliminated or at least minimized. Raw sEMG can range between +/-5000 microvolts and typically, the frequency contents ranges between 6 and 500 Hz, showing most frequency power between ~20 and 150 Hz [3]. 3. Factors Influencing the EMG Signal On its way from the muscle membrane up to the electrodes, the EMG signal can be influenced by several external factors altering its shape and characteristics. They can be grouped in [3]: a. Tissue characteristics. The human body is a good electrical conductor, but unfortunately, the electrical conductivity varies with tissue type, thickness (Fig. 4), physiological changes and temperature. These conditions can greatly vary from subject to subject (and even within subject) and prohibit a direct quantitative comparison of EMG amplitude parameters calculated on the unprocessed EMG signal. Fig. 4. The Influence of Varying Thickness of Tissue Layers Below the Electrodes [2]. b. Physiological cross talk. Neighboring muscles may produce a significant amount of EMG that is detected by the local electrode site. Typically this “Cross Talk” does not exceed 10%-15% of the overall signal contents or is not available at all. However, care must been taken for narrow arrangements within muscle groups. ECG spikes can interfere with the EMG recording, especially when performed on the upper trunk / shoulder muscles. They are easy to see and new algorithms are developed to eliminate them. c. Changes in the geometry between muscle belly and electrode Site. d. External noise. e. Electrode and amplifiers. 4. EMG Signal Processing Raw EMG offers us valuable information in a particularly useless form. This information is useful only if it can be quantified. Various signal- processing methods are applied on raw EMG to achieve the accurate and actual EMG signal. Reza Time, s µv Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 111 et al. [2] discussed the major EMG signal processing methods used currently. 5. Wavelets Wavelets are building blocks for general functions. That means that any general function can be expressed as an infinite series of wavelets. The basic idea underlying wavelet analysis consists of expressing a signal as a linear combination of a particular set of functions, obtained by shifting and dilating one single function called a mother wavelet. Several different mother wavelets have been studied in Daubechies [7] and Meyer [8]. The decomposition of the signal into the basis of wavelet functions implies the computation of the inner products between the signal and the basis functions, leading to a set of coefficients called wavelet coefficients. The signal can consequently be reconstructed as a linear combination of the basis functions weighted by the wavelet coefficients. In order to obtain an accurate reconstruction of the signal, a sufficient number of coefficients have to be computed. The procedure followed for calculating the wavelet coefficients is shown graphically in Fig. 5. The main characteristic of wavelets is the time- frequency localization. In effect, that means that most of the energy of the wavelet is restricted to a finite time interval. Frequency localization means that the Fourier transform is band limited. The advantage of time – frequency localization is that contrary to the short - time Fourier transforms a wavelet analysis varies the time - frequency aspect ratio, producing good frequency localization at low frequencies (long time windows), and good time localization at high frequencies (short time windows). This produces segmentation, or tiling of the time-frequency plane that is appropriate for most physical signals, especially those of a transient nature. The difference between the Short Time Fourier Transform and the Wavelet transform is illustrated in Fig. 6 [4]. Fig. 5. The Operations of Shifting and Dilation of the Mother Wavelet to Calculate the W. Coefficients [4]. Fig. 6. The Tiling of the Time-Frequency Plane in the Case of Short-Time Fourier Transform (STFT) and Discrete Wavelet Transform (DWT) Respectively. 6. Wavelet Techniques for EMG: A lot of papers and researches have been written to discuss the different applications for the Wavelet techniques in Biosignal and EMG specifically. We briefly consider the application of wavelet systems from two perspectives [9]: First: we look at the wavelets as a tool for denoising and compressing an EMG signal (more details see [4, 10, 11]), where noise removing process, and compression for biotelemetry techniques. Second: We look at the wavelet as a tool for feature extraction and classification (more details see [5, 6, 12]), where the process of defining the movement and control for the prosthetic applications are desired. Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 112 7. Application of Neural Network Back Propagation Algorithm Solving EMG signal with the Artificial Neural Network (ANN) techniques have been reported with different powerful strategies, for the present application, back propagation is used to train the feed forward NN [13], see Fig. (7). Fig. 7, Back Propagation NN. During the training phase, each output neuron (zi) compares its computed activation with its target value (ti) to determine the associated Error (ei) for the neuron, where: E = ∑ (zi - ti) 2 …(1) The ANN weights and biases are adjusted to minimize the least square error. 8. Wavelet Types and Families: There are different types of wavelet families whose qualities vary according to several criteria. The main criteria are [14]: a. The support of Ψ, Φ: the speed of convergence to zero of these functions Ψ(t) when the time t or the frequency ω goes to infinity, which quantifies both time and frequency localizations. b. The signal symmetry. c. The number of vanishing moments for Ψ or Φ for (if it exists), which is useful for compression purposes. d. The regularity, which is useful for getting nice features, like smoothness of the reconstructed signal, and for the estimated function in nonlinear regression analysis. The wavelet types included in our work here can be classified to the following groups [14]: 1. Crude wavelets. a. Wavelet families: Gaussian, morlet, Mexican hat. b. Properties: Only minimal properties: - Φ does not exist. - The analysis is not orthogonal. - Ψ is not compactly supported. - The reconstruction property is not insured. c. Possible analysis: - Continuous decomposition. d. Main nice properties: Symmetry, Ψ has explicit expression. e. Main difficulties: Fast algorithm and reconstruction unavailable. 2. Infinitely regular wavelets: a. Wavelets families: Meyer. Discrete Meyer wavelet. b. Properties: - Φ exists and the analysis is orthogonal. - Ψ and Φ are indefinitely derivable. - Ψ and Φ are not compactly supported. c. Possible analysis : - Continuos transform. - Discrete transform but with non-FIR filters. d. Main nice properties: Symmetry, infinite regularity. f. Main difficulties: Fast algorithm unavailable. 3. Orthogonal and compactly supported wavelets. a. Wavelets families: Daubechies, symlets, coiflets. b. General properties: - Φ exists and the analysis is orthogonal. - Ψ and Φ are compactly supported. - Ψ given number of vanishing moments. c. Possible analysis: - Continuous transform. - Discrete transform using FWT. d. Main nice properties: Support, vanishing moments, FIR filters. e. Main difficulties: poor regularity. 4. Biorthogonal and compactly supported wavelet pairs. a. Wavelets families: B-splines biorthogonal wavelets. b. Properties: - Φ functions and analysis is biorthogonal. - Ψ and Φ both for decomposition and reconstruction are compactly supported. - Φ and Ψ for decomposition have vanishing moments. - Ψ and Φ for reconstruction have known regularity. c. Possible analysis: - Continuous transform. - Discrete transform using FWT. Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 113 d. Main nice properties: Symmetry with FIR filters, desirable properties for decomposition and reconstruction are split and nice allocation is possible. e. Main difficulties: orthogonality is lost. 5. Complex wavelets. a. Wavelets families: Complex Gaussian, complex Morlet, complex Shannon, complex frequency B- spline. b. Properties: Only minimal properties - Φ does not exist. - The analysis is not orthogonal. - Ψ is not compactly supported. - The reconstruction property is not insured. c. Possible analysis: - complex continuos decomposition. d. Main nice properties: Symmetry, Ψ has explicit expression. e. Main difficulties: Fast algorithm and reconstruction unavailable. Table (1) below represent the whole fifteen Wavelet families with their short name as expressed in Matlab 7.a, at the same time table (2) a and b, represent the summery for the properties of the fifteen wavelet families with their properties. Table 1 Wavelet Families with their abbreviations [14]. Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 114 Table 2 Properties of the Wavelet Families [14]. Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 115 9. Material and Method We developed a preliminary version for the whole families in Matlab, and as experimenting values for the EMGs we test 2 cases of butterfly exercises one with 5 lb and the other with 10 lb. For each one of the two cases we took three different volunteers with three different muscles locations for each one of them, right pectoralis, right biceps and right triceps. In total we have got 18 (eighteen) data files with sampling frequency 2000 Hz [15], with 4000 samples length for each file. The analysis of these data files started with converting them to .mat files and then removes any DC offset to be ready for the Wavelet families’ analysis. In this stage each family were considered as special solution for the proposed case, and of course the output of the wavelet family are the coefficients and details which will be trained with the back propagation neural network, the reason for this training to get finally the error proposed in each analysis. Comparison finally between the sets of errors will help us with the final. 10. Results Huge sets of results have been found here, Table (3) explained that 1350 runs, so for explanation of the Results, we will explain and discuss samples of them and for more information, you visit my web in www.biomedicaleng2006.jeeran.com. (Results will be uploaded to the website after the date of acceptance). Table 3 Number of Runs. No. of Cases 2 No. of Volunteers 3 No. of measured points 3 No. of families 15 No. of level for each family (at least) 5 Total number of runs 1350 Figures 8 (a, b and c) shows the EMG signals for 5lb first person (expressed as 5_1), of course these signals have been plotted after the DC offset have been removed. (a) Pectoralis of 5 lb with Volunteer 1. (b) Biceps of 5 lb with Volunteer 1. (c) Triceps of 5 lb with Volunteer 1. Fig. 8. EMG for 5_1. The continuous with the analysis shows in Figures 9 the db4 for pect5_1 where the technique used here is DWT. The output decomposed (denoised) signal are treated with the back propagation NN in which we considered the input to this net is (s = a4 + d4 + d3 + d2 + d1) and the target is the original signal (so as to found out the residuals), the training is 60% (these are presented to the network during training, and the network is adjusted according to its error) of the original samples (2400 samples of 4000), validation 20% (these are used to measure network generalization, and to halt training when generalization stops improving) of the original http://www.biomedicaleng2006.jeeran.com/ Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 116 samples (800 samples of 4000) and the testing 20% (these have no effect on training and so provide an independent measure of network performance during and after training) of the original samples (800 samples of 4000), with 20 hidden neurons. Table (4) proposed the final results for the ANN after running the NN for 20 Epochs. Fig. 9. db4 for Pectoralis 5_1. Table 4 Results of NN for Pectoralis 5_1 of db4. Where MSE: is the Mean Squared Error is the average squared difference between (normalized) outputs and targets. Zero means no error, over 0.6667 means high error. And R: Regression Values measure the correlation between (unnormalized) outputs and targets. An R value of 1 means a close relationship, 0 a random relationship. At the same Fig. 10 shows the performance, Epochs relations for the training, validation and test. We can observe in most of the families that we have tested before that the level of the wavelet is very important for the training and performance of the NN, level 4 and 5 in db and haar are closest in results than the other highest or lowest level. While the other families recorded unstable response in levels with the action analysis and effect in the NN performances. Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 117 Fig. 10. Epochs – Performance Relationship for the Training, Validation and Test of Pectoralis 5_1 of db4. 11. Conclusions In this paper, we have checked most of the families used to process the EMG signals into denoising and compressing. Our target is to reach a high quality of the performance for combined Wavelet techniques with the ANN. The obtained results are very huge to be discussing in one paper but they are comfortable and reach a final decision. Our approach uses a two parts the first WT technique and the second ANN, where the first used to generate deniosed signal (or compressed) and the second used to train this signal and calculate its performance of training and validation The results indicate that, Haar and db in their (4 th to 5 th level) are more comfortable to use with our samples of EMG. 12. References [1] John G. Webster, Encyclopedia of Medical Devices and Instrumentation, 2 nd edition, 2006, vol. 3, p 99 – 109. [2] M. B. I. Reaz, M. S. Hussain and F. Mohd- Yasin, Techniques of EMG signal analysis: detection, processing, classification and applications, Biol. Proced. Online 2006 8(1): 11-35. [3] Peter Konrad, The ABC of EMG - A Practical Introduction to Kinesiological EMG, power by Noraxon INC. USA, Version 1.0 April 2005, page 5. [4] D. Moshou, I. Hostens, G. Papaioannou, H. Ramon, Wavelets and self-organizing maps in EMG analysis, ESIT 2000, 14-15 September 2000, Aachen, Germany. [5] K. Englehart, B. Hudgins, P. A. Parker and V. Stevenson (1999). Classification of the Myoelectric Signal Using Time-Frequency Based Representations, Medical Eng. and Physics, volume 21, pages 431-438. Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 118 [6] R. Carreño and M. I. Vuskovic: “Wavelet Transform Moments for Feature Extraction from temporal Signals’” 2 nd Internat. Conference in Control, Automation and Robotics (ICINCO 2005), 14-17 September, Barcelona, Spain, 2005 [7] Daubechies, I., 1988, “Orthonormal bases of compactly supported wavelets”, Commune. Pure Applied Mathematics 41, pp. 909-996. [8] Meyer, Y., 1989, “Orthonormal Wavelets, Wavelets, time-frequency methods and phase- space”, J. M. Combes, A. Grossman, P. Tchamitchian, (eds.), Springer-Verlag, pp. 21- 37. [9] C. S. Burrus, R. A. Gopinath, and H. Guo, Introduction to Wavelet and Wavelet Transforms, Prentice – Hall, Inc., 1998. [10] P. Wellig, C. Zhenlan, M. Semling, and G. S. Moschytz, “Electromyogram data compression using single-tree and modified zero-tree wavelet encoding,” in Engineering in Medicine and Biology Society. Proceedings of the 20th Annual International Conference of the IEEE, Hong Kong, China, Oct. 1998, vol. 3, pp. 1303– 1306. [11] M. S. Hussain, M. B.I. Reaz, M. I. Ibrahimy, and F. Mohd-Yasin, An Efficient Technique of Analyzing Surface EMG Signals, ISBME 2006, paper No. 107. [12] J. U. Chu, I. Moon, and M Mun, A Real- Time EMG Pattern Recognition based on Linear-Nonlinear Feature Projection for Multifunction Myoelectric Hand, Proceedings of the 2005 IEEE, 9th International Conference on Rehabilitation Robotics, June 28 - July 1, 2005, Chicago, IL, USA. [13] J. Laakso, M. Juhola, V. Surakka, A. Aula and T. Partala, Neural Network and Wavelet Recognition of Facial Electromyographic Signals, MEDINFO, V. Patel et al. (Eds), Amsterdam: IOS Press, 2001. [14] Wavelet Toolbox help, MATLAB 7.a. [15] G. D. Luca, Fundamental Concepts in EMG Signal Acquisition, Delsys Inc., 2003. Nebras Hussain Gheab Al-Khwarizmi Engineering Journal, Vol. 4, No. 3, PP 108-119 (2008) 119 دراست هقارنت الشارة التخطيط العضلي باستخذام الوويجت و الشبكاث العصبيت نبراس حسين غائب سذين نبيل سلين جايؼح تغذاد / كهيح هنذسح انخىاسيي/ قسى هنذسح انطة انحياتي الخالصت انذراسح . ػضهيح يختهفحنثًانيح ػشز اشارجقذينا طزيقح نتحهيم خًس انىاع نخًسح ػشز يجًىػح ين يجاييغ انًىيجح , في هذا انثحث هذا سىف يساػذ انثاحثين . انًقارنح تظهز ايضا اداء انًجاييغ انًحتهفح تؼذ يؼانجح و تحىيز اننتائج تاسهىب االرجاع انؼكسي نهشثكاخ انؼصثيح .كى هائم ين اننتائج تقذو و تصنف نهًناقشح و انىصىل انى نتائج. في انخطىج االونى نتحهيم االشارج انؼضهيح