WAVELET BASED NOISE REMOVAL FROM EMG SIGNALS M. S. Hussain\ M. B. I. Reaz\ M. 1. Ibrahimy\ A. F. Ismail\ F. Mohd-Yasin^ "'international Islamic University Malaysia, Kuala Lumpur, Malaysia ^Faculty of Engineering, Multimedia University, Selangor, Malaysia Keywords: Denoising, Mean power frequency, SEMG, wavelet transform. Abstract: Wavelet transform has been applied in this research for removing noise from the surface electromyography signal (SEMG). The effectiveness of the noise removal is quantitatively measured using Root Mean Square (RMS) Error. This paper reports on the effectiveness of the wavelet transform applied to the SEMG signal as means of removing noise to retrieve information related to muscle contraction and nerve system. Power spectrum analysis has been applied to SEMG signals where mean power frequency was calculated to indicate changes in muscle contraction. Wavelet based noise removal and power spectrum analysis on the EMG signal from the right "biceps brachii" muscle was performed using four wavelet functions. With the appropriate choice of the wavelet function (WF), it is possible to remove noise effectively to analyze SEMG significantly. Results show that WFs Daubechies (db2) provide the best noise removal from the raw SEMG signals among other WFs Daubechies (db6, db8) and orthogonal Meyer The algorithm is intended for FPGA implementation of portable bio medical equipments to detect neuromuscular disease and muscle fatigue. Odprava suma iz EMG signalov z valčno tranformacijo Kjučne besede: odstranjevanje šuma, srednja frekvenca šuma, SEMG, valčna tranformacija Izvleček: V prispevku opišemo uporabo valčne transformacije za odpravo šuma iz signala SEMG (Surface ElectroMyography Signal) z namenom pridobiti informacijo o povezavi med krčenjem mišice in živčnim sistemom. Učinkovitost metode kvantitativno izmerimo z izračunom RMS napake pri odpravi šuma. Za odpravo šuma iz EMG signala desne mišice "biceps brachii" smo uporabili štiri valčne funkcije. Rezultati kažejo, da s funkcijo Daubechies (db2) dosežemo najboljše rezultate med izbranimi (db6, db8 in ortogonaina Mayer funkcija). Algoritem nameravamo v končni fazi implementirati v vezje FPGA za uporabo v prenosni biomedicinski opremi za ugotavljanje nevromišičnih obolenj in mišične utrujenosti. 1. Introduction EMG signal represents the electrical activity of muscles to gather information about muscular and nervous systems. It is commonly used in diagnosis of muscle weakness, muscle fatigue, nerve damage etc /1 /. EMG signals detected directly from the muscle or from the skin by using surface electrodes, respectfully, show a train of motor unit action potentials (MUAP) plus noise. It is difficult to obtain high-quality electrical signals from EMG sources because the signals typically have low amplitude (in range of mV) and are easily corrupted by noise. The simplest way method of removing narrow bandwidth interference from recorded signal is to use a linear, recursive digital notch filter. But the disadvantage of the notch filter is that, it distorts the signal /2/. Wavelet-based noise removal is performed in this research prior to EMG signal analysis. Wavelet denoising (noise removal) has been found effective in denoising a number of physiological signals /3/. It is preferred over signal frequency domain filtering because it tends to preserve signal characteristics even while minimizing noise. This is because a number of threshold strategies are available, allowing reconstruction based on selected coefficients /4/. It is desired to apply a method of spectral analysis to study the frequency characteristics of random signals like EMG. In the SEMG, recruitment and increase in the firing frequencies are seen as an amplitude increase of the SEMG signal/5/. Changes in the EMG power spectrum are used as an indicator of changes in muscle contraction and muscle fatigue for ergonomic purposes /6/. For this study wavelet functions, Daubechies (db2, db6, dbS) and Meyer (dmey) are used during the wavelet transform for noise removal. These WFs are chosen based on the shapes of the mother wavelet, which are similar to MUAP /3, 7/. RMS Error was calculated to measure the effectiveness of the noise removal using these wavelets. As a tool for analyzing frequency components of the EMG signals. Fast Fourier Transform (FFT) is considered. A superposed EMG signal can be considered as summation of sine waves with different frequency velocity The FFT algorithm is described as a decomposition of the EMG signal to its underlined sinus contents. Within applied EMG frequency analysis the most important parameters are the mean and median. Results show that, WFs db6, dbS and dmey show similar kind of RMS error indicating that they perform similar kind of noise removal for SEMG. Meanwhile, WF db2 presents less RMS error compared to the other three WFs, resulting better noise removal for the EMG signal. The effectiveness was observed more clearly while analyzing the power spectrum properties of the SEMG signals. 2. Methodology For this experiment, 6 separate EMG data files were used. The sample raw EMG signals of a subject from University Kebangsaan Malaysia are used for the simulation of the algorithm. SEMG was recorded from the left "biceps bra-chii" muscle of a normal subject aged 22. All analog channels are recorded at 1000 samples per second. Two surface electrodes were used to capture the raw EMG signals and the distance between the electrodes were 3.5 inches. SEMG signal was captured during the subjects rest position, light contraction level, strong contraction level and contraction with load (weight 1 kg). These SEMG signals were denoised using discrete wavelet transform (DWT) and a threshold method. The DWT and threshold based denoising was implemented using MAT-LAB Wavelet toolbox. Mean frequency from the power spectrum was calculated to estimate the muscle contraction at various muscle contraction stages. Fig. 1 shows the flow of the algorithm. Fig. 1 Algorithm flow A. Wavelet Denoising Wavelets commonly used for denoising biomedical signals include the Daubechies 'db2', 'db8' and 'db6' wavelets and orthogonal Meyer wavelet. The wavelets are generally chosen whose shapes are similar to those of the MUAP /3/. Fig. 2 gives the process of noise removal using wavelet transform. Wavelet Decomposition Tlireshold Metliod Wavelet SEMG after Reconstruction noise removal Fig. 2 Wavelet denoising method Wavelet decomposition: The WT decomposes a signal into several multi-resolution components according to a basic function called the wavelet function. Filters are one of the most widely used signal processing functions. The resolution of the signal, which is a measure of the amount of detail information in the signal, is determined by the filtering operations, and the scale is determined by upsam-pling and downsampling (subsampling) operations. The DWT is computed by successive lowpass and highpass filtering of the discrete time-domain signal as shown in Fig. 3. In the figure, the signal is denoted by the sequence x[n], where n is an integer. The low pass filter is denoted by Go while the high pass filter is denoted by Ho. At each level, the high pass filter produces detail information, d[n], while the low pass filter associated with scaling function produces coarse approximations, a[n]. With this approach, the time resolution becomes arbitrarily good at high frequencies, while the frequency resolution becomes arbitrarily good at low frequencies. H» G; ____ U tliOi] ■ 0. 2. The noise signal's transform values all have the magnitudes while lie below a noisG thrGshold Tn satisfy Tn < Ts. Then the noise in f can be removed by thresholding its transform. All values of its transform whose magnitude lies below the noise threshold Tn are set equal to 0. Signal reconstruction: An inverse transform is performed, providing a good approximation of f. The reconstruction is the reverse process of decomposition. The approximation and detail coefficients at every level are upsampled by two, passed through the low pass and high pass synthesis filters and then added. This process is continued through the same number of levels as in the decomposition process to obtain the original signal. B. RMS Error Calculation The RMS Error of the contaminated signal f compared with the original signal s is defined by equation 1. HMS Error- (/i+ + - + (^, V N The RMS Error was calculated for the four WFs where f is the raw SEMG signal and s is the signal after denoising. N is the number of samples. C. Power Spectrum Analysis Power Spectrum Analysis: The power spectrum (PS) was obtained using fast Fourier transform (FFT) techniques. Manning window was used with a 256 point FFT. The mean power frequency was obtained from equation 2. Pfmean \ßS{f)df lPS{f)df (2) 3. Results and discussion Wavelet denoising method is applied to SEMG signal at various muscle contraction stages (rest, light contraction, strong contraction and contraction with load). RMS Error was calculated for each of the WFs (db2, db6, db8 and dmey) during all the muscle contraction states, which are given by table 1. Table. 1 RMS error of SEMG signal at various stages using four WFs Muscle Stage db2 db6 db8 dmey Rest 0,005 0.005 0.005 0.005 Light 0.0162 0.0166 0.0166 0.0163 Strong 0.0279 0.0281 0.027 0.0272 Load (Start Point) 0.0632 0.0641 0.0621 0.0608 Load (Mid Point) 0.0795 0.0826 0.0801 0.0811 Load (Fatigue Point) 0.0388 0.0385 0.0385 0.0391 Similar kind of RMS Error is found using db6, db8 and dmey. RMS Error is less using db2 compared to the other WFs, which means that it is more effective during the noise removal process. Fig. 4 illustrates the result of denoising method using db2 with 4 levels of decomposition for a sample SEMG signal. 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 SampSe 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Sample Fig. 4 Noisy SElvlG from "Biceps Braohii" muscle (top) and result of wavelet denoising performed using the 'db2' wavelet with 4 levels of decomposition (bottom) The mean power spectrum was calculated for the analysis of SEMG signal. According to the study by Hagberg and Ericson, mean power frequency was lower at low contraction levels when compared with high contraction levels /8/. Moritani et al. also obtained similar results where significant increase in SEMG amplitude and mean power frequency were found with increasing force /9/. It is also shown that during muscle fatigue, the power spectrum of SEMG shows a shift to lower frequencies /10/. Mean/ Median frequency is used to quantify this shift. The cause of this is related to the changes in the MU and changes in the firing characteristics of the MU. The analysis performed in this study also shows that mean power frequency increased with increase of muscle contraction. Fatigue was also noticed by observing a shift to lower frequencies in the power spectrum. Fig. 5 shows the mean power frequency of SEMG signal at the various muscle contraction stages using the WFs. According to the figure, mean power frequency for all four WFs increased from rest stage to strong muscle contraction stage. The contraction further increased when the load was added. However, mean power frequency dropped from the initial load stage to the end of the muscle contraction indicating muscle fatigue. The effectiveness of noise removal using WF db2 is also clear in fig. 5 where the curve shows higher mean power frequency for the SEMG signal which gives a better representation of muscle contraction during at higher muscle contraction stages. Fig. 5 Mean power frequency of SEMG signal at various muscle contraction stages using the WFs 4. Conclusion Wavelet based noise removal has the added advantage that it is fast and easy to implement. Wavelet theory has already enjoyed great success in other biomedical signal processing, and expected to provide a powerful complement to conventional noise-removal techniques (such as notch filters and frequency domain filtering as mentioned earlier) for EMG signals. All four WFs can effectively remove noise from SEMG signal but according to this research, WF db2 is found to be most efficient for removing noise from SEMG signal. The wavelet based noise removal technique proposed in this research can be used for the analysis and characterization of EMG signal to understand muscle contraction significantly. VHDL, a hardware description language, will be used to model the algorithm, which will be followed by extensive testing and simulation to verify the functionality of the algorithm that allows efficient FPGA implementation. The chip will be cost effective, portable and robust for a portable EMG related biomedical equipments. 5. References /1/ J. v. Basmajian, C. J De Luca, "Muscles Alive - The Functions Revealed by Electromyography", The Williams & Wilkins Company, Baltimore, 1985 /2/ T. David Mewette, N. Homer, J. R, Karen, "Removing Power Line Noise from Recorded EMG", Proceedings of the 23''' annual international conference, pp 2190- 2193, Oct 25-28, Istanbul, Turkey /3/ P. Carre, H. Leman, C. Fernandez, C. Marque, "Denoising of the uterine EHG by an undecimated wavelet transform, IEEE Trans, on Biomedical Signal Processing, vol 45, issue 9, pp 1104-1114, 1998 /4/ S. Mallat, "Awavelettourof signal processing", edition. Academic Press, 1998, New York, USA /5/ H. S Milner Brown., R. B. Stein, "Tfie relationsiilp between the surface eieotromyogram and muscularforce", J of Physiol (Lond), vol. 246, pp 549-569; 1975 /6/ L. Lindstrom, R. Kadefors, I. Petersen, "An electromyographic index for localized muscle fatigue", J of AppI Physiol: Respirat Environ Exercise Physol, vol. 43, pp 750-754, 1977 /7/ P. W. Mark, "Wavelet-based noise removal for biomechanical signals: A comparative study", IEEE Trans, on biomedical engineering, vol 47, no. 2, pp. 360-360 /8/ M. Hagberg, B. E. Ericson; "Myoelectric power spectrum dependence of muscular contraction level of elbow flexors", Eur J of Appi Physiol, vol. 48, issue 2, pp 147-156, 1982 /9/ T. Moritani, A. Nagata, M. Muro, "Electromyographic manifestations of muscular fatigue"; Med Sei Sport Exerc; vol. 14, pp 198-202, 1982 /10/ C. J. De Luca, "Myoelectrical manifestations of localized muscular fatigue in humans; CRC critical reviews in Biomedical Engineering", vol. 11, issue 4, pp 251-279, 1985 M. S. Hussain, M. B. I. Reaz, M. I. Ibrahimy, A. F. Ismail Dept. of Electrical and Computer Engineering, International Islamic University Malaysia, Gombak, 53100 Kuala Lumpur, Malaysia F. Mohd-Yasin Faculty of Engineering, Multimedia University, 63100 Cyberjaya, Selangor, Malaysia Tel: +603-61964435, Fax: +603-61964488, Email: mamun. reaz@iiu. edu.my Prispelo (Arrived): 25.05.2006 Sprejeto (Accepted): 15.06.2007