Time–frequency Analysis of the EMG Digital Signals

– In the article comparison of time-frequency spectra of EMG signals obtained by the following methods: Fast Fourier Transform, predictive analysis and wavelet analysis is presented. The EMG spectra of biceps and triceps while an adult man was ﬂexing his arm were analysed. The advantages of the predictive analysis were shown as far as averaging of the spectra and determining the main maxima are concerned. The Continuous Wavelet Transform method was applied, which allows for the proper distribution of the scales, aiming at an accurate analysis and localisation of frequency maxima as well as the identiﬁcation of impulses which are characteristic of such signals (bursts) in the scale of time. The modiﬁed Morlet wavelet was suggested as the mother wavelet. The wavelet analysis allows for the examination of the changes in the frequency spectrum in particular stages of the muscle contraction. Predictive analysis may also be very useful while smoothing and averaging the EMG signal spectrum in time.


Introduction
Human movement is the result of skeletal muscle contractions under the influence of nerve impulses which come from the central nervous system (CNS). In the muscles, electrical signals known as electromyographic which can be measured with needle electrodes or surface electrodes. As current research shows, they contain information concerning the proper functioning of the muscle, its fatigue, the power it exerts, the processes which occur during the contraction [1]. EMG signal examinations have diagnostic meaning in musculoskeletal system ailments, for the evaluation of muscle strain and fatigue [2] in sports medicine as well as in the research on prosthetic limb control [3,4]. During the last decade there has been a growing interest in the structure of the signals, particularly in their frequency spectrum. Generally, in the research the average or median of the Fourier spectrum is established [5,6]. Recently great interest has been observed in the possibility to apply the wavelet transform to the analysis of the signals [7,1,8]. As the signals have a very complex course, it is very important what is the main point of interest -the frequency spectra which are averaged in time or high resolution both in time and frequency.
The presented work describes the limitations of the Fourier Transform as the tool for the analysis of the signals and suggests the linear prediction method for the generalization of the spectral courses, as well as the wavelet method to obtain spectra of high time and frequency resolution.

Electromyographic signals
Electromyographic signals were registered during the contraction of the muscles: biceps and triceps when an adult man was folding his arm. They were performed with the use of surface electrodes in the Department of Biomechanics and Computer Science in Biała Podlaska. The signals were sampled with the frequency of 1500 Hz and were recorded in the form of text files. The record conformed with the IFCN standard [9]. The analysis was performed with the use of the Wave Blaster programme elaborated by Codello [10,11,12], which allowed for the Fourier analysis with any selected shape and width of the time window, for LPC analysis and a wide range of mother wavelets, for latitude in scaling thereof and for the presentation of a wavelet spectrum.

Short-Time Fourier Spectrum
In the case of stochastic signals, such as EMG, the Short-Time Fourier Transform method can be used, which consists in the analysis of subsequent time fragments of the signal, which are multiplied by the window function [13]. Such a procedure for digital signals can be exemplified with the following formula: where X(k)k-th line of the frequency spectrum, x(n)n-th sample of the signal in the time scale, w(n) -function describing the shape of the time window, N -number of sample at a given width of the time window (∆t). On the basis of the obtained spectrum, the peak frequency is established, which is defined with the following formula [6]: where X(k) -fringes of power spectrum, f p -sampling frequency, N -width of the window. The width of the time window (∆t ) defines the frequency resolution of the signal (∆f ), for the fact that the total number of the spectral lines equals the number of samples.
An averaged spectrum in a large time slot contains very many distinct maxima in the frequency scale, which poses a problem of how to determine e.g. the main maxima.
Thus it is appropriate to use the Linear Prediction method, which allows for any chosen smoothing of the spectrum depending on the choice of the prediction order.

LPC Spectrum
The idea of the Linear Prediction consists in the presentation of any given sample of the signal in the form of the combination of the preceding samples [14]. It allows for the determination of the frequency spectrum on the basis of the following formula: A -gain parameter a k -Linear Prediction coefficient (LPC coefficient) P -predictor order f p -sampling frequency [Hz] Fig. 1 presents a comparison of the spectra obtained with the Short-Time Fourier Transform (STFT) with the use of a Hamming window of 1024-sample width, which means 682.7 ms. The figure consists of three parts. The top part shows the signal oscillogram, the middle part shows a spectrogram in two time windows, and the bottom part shows two-dimensional STFS and LPC spectra with the prediction order of 100. As it can be observed, the Fourier course, which contains a lot of local maxima, has been smoothed, which allows for the distinction of the main maxima.
The maximum marked in the figure corresponds to the frequency of 48 Hz. So far, no research concerning the relation of the spectrum maximum location to the mechanical parameters of the muscles has been reported. According to the hypothesis of the authors such location can be characteristic of the type of the muscle and its condition. Research on such correlations will be continued. In the authors' opinion, it will allow to find the frequency and structure which are optimal for particular muscles from the point of view of physiotherapy.

Wavelet analysis
As it was mentioned above, for an analysis to be accurate in the frequency scale, a relatively wide time window is required. For example, if we want to obtain an EMG signal spectrum with the accuracy of approx. 3 Hz, 512-sample window needs to be Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 14/08/2023 13:07:24 U M C S used, which means 341.3 ms. A more accurate analysis simultaneously in the time and frequency scales is possible when the continuous wavelet transform (CWT) is applied.
It is obtained by convolution of the signal with the so-called analysing function, which is created by graduating the mother wavelet [15]. A mother wavelet which is a product of the Gaussian function (g(t)) and the cosinusoidal signal c(t) of the medium frequency of 1 Hz were chosen. Thus, the analysing functions can be expressed with the following formula: The Fourier Transform of such a function is a combination of the Gaussian function in the following form: and the fringe spectrum of the cosinusoidal signal of f/a frequency. Thus the medium frequency of the spectrum of the analysing function f c = a [Hz], and its duration time equals 1/a [s] (Fig. 3).   4 presents the comparison of the Fourier and wavelet spectra of EMG signal which was recorded during a contraction of the biceps muscle of the arm. In the time window which is marked with the arrow pointer, two-dimensional spectra were also presented. As it can be seen, the wavelet analysis allows for an accurate analysis in the scale of time and frequency. It allows for the localisation of the main maxima of a spectrum as well as for the localisation of characteristic impulses (bursts) in time in the course of EMG signal.

Conclusions
The EMG signal analysis is of great importance for the evaluation of the condition and functioning of the human musculoskeletal apparatus. The limitations of the Short-Time Fourier Transform method, commonly used in such research, are a motivation to search for better methods. The averaged spectra, on the basis of which peak frequency of the power spectrum can be determined, are interesting from the point of view of diagnostic and rehabilitation actions, e.g. with the use of stimulation with external stimuli. In the article, the Linear Prediction method (LPC) has been suggested, which allows for discretionary averaging of a spectrum and exact determination of the maximum. The examples of analyses of biceps and triceps operation presented in the article show that the proper choice of the prediction order allows for precise determination of the peak frequency, independent of the time window width.
In the recent research exact time-frequency structure has been analysed with the use of the wavelet analysis. The authors of the article have proposed mother wavelet and Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 14/08/2023 13:07:24 U M C S selection of scales for accurate analysis with the CWT (Continuous Wavelet Transform) method, both in the scale of time and in the scale of frequency. It is noted for great resolution in both fields and it allows for the examination of short signal fragments. Obviously, the presented results should be treated as initial and serving the purpose of highlighting the advantages of the proposed method of analysis. Continuation thereof will allow for conclusions concerning the condition and description of muscle operation.