Determining Best Window Size for an Improved Gabor Transform in EMG Signal Analysis

Electromyography EMG is a standout amongst the most regularly utilized tools to study human muscle condition. But due to the intricate attributes of the EMG itself, time-frequency distributions such as Gabor transform and spectrogram are more preferred than the simpler time distribution and frequency distribution. These techniques have been broadly utilized as it can provide both time and frequency information. However, both techniques have a fix window size for all frequency values, thus there exist a problem of determination of the window size, where excessively limit window and too wide window, will result in poor frequency resolution and time resolution, respectively. Along these lines, the point of this study is to choose the best window size so as to be utilized with Gabor transform to screen human muscle activity during core-lifting task. Four electrodes were placed on the right and left biceps brachii, and left and right erector spinae. In this study, the results of five acceptable window sizes (300, 400, 430, 450 and 520) were shown, despite the fact that other window sizes were also tested. Three criteria have been considered during the determination of the best window size, which are good time resolution, good frequency resolution, and high accuracy. Results demonstrate that window size of 450 is the best compared to others. As an additional analysis, the result is compared to a spectrogram and it can be seen that Gabor transform is better, as it has the flexibility in choosing the window size, thus affects the resolution and accuracy.


Introduction
Electromyography (EMG) signal is a highly complex non-stationary signal used to measure electrical activity created by skeletal muscle in the human body [1].Research involving EMG are inconceivably developing as it can be utilized as a part of different applications not restricted to clinical, biomedical and human-computer interaction.A few propelled techniques have been acquainted to efficiently and successfully analyze the signal [2].
Among researchers, it is well known that the Fourier transform (FT) is the simplest among the other transformation method [3].It is also a perfect technique for analyzing periodic functions, and to represent them as a superposition of pure frequencies [4].This, however, makes sense for stationary signals only [5], whereas EMG is a non-stationary signal.Thus, the idea of time-frequency representations (TFR) of signals came up [6].One of the simplest methods is the short-time Fourier transform (STFT), since for many purposes the STFT of a signal is easier to handle because it depends in a linear way on the analyzed signal [7].This technique has become a common tool in signal analysis.Other than this, the concept of the TFR also motivates other researchers to come up with a more advanced techniques such as spectrogram and Gabor transform.These two techniques are preferred than the traditional Fourier techniques, whenever time dependence of the analyzed signal is of an indistinguishable significance from its frequency dependence [6].However, there exist strict limits to the maximal time-frequency resolution of these both techniques, since there is a compromise between time and frequency resolution [8].Both of these techniques require the choice of a window function and window size, which are used to localize analyzed signal in a decent way [9].This includes the control of precision of the time and frequency resolution [10].The window chosen however is constant for all frequencies.
In previous research, the author already came up with a proper guideline in determining the window size of spectrogram for core lifting task application, while this paper presents the selection process in determining Gabor transform's best window size for the same application.The same selection criteria are applied which based on time-frequency resolution, timefrequency representation (TFR) and the plot of instantaneous RMS voltage (V rms (t)).The performances of the chosen window size for both techniques are then compared.

Experimental Procedures 2.1. Subjects
Eleven EMG recordings were inspected in this research.These EMG signals were recorded from eleven healthy control subjects aged 22-25 years.Table 1 summarized the subjects' demographic details.The subjects were selected arbitrarily by the utilization of ads and notices.A fundamental idea in enrolment of the volunteers was that the subjects did not have a past history of musculoskeletal disorders.The Extremity Functional Index (UEFI) survey and Oswestry Low Back Pain Disability survey have been used in perceiving the typical reference control subjects with a particular end goal to enlist them.The experimental procedures were affirmed by the Human Ethics Committee of Universiti Putra Malaysia, and all the subjects are required to signed informed consent forms before the start of the experiment.

Lifting Protocol
Subjects were asked to perform a core-lifting task, which comprises of six lifting phases in 1 cycle.The succession of the 6 lifting phases was shown in Figure 1.Preceding the lifting protocols, the subject is required to remain in front of the Valpar work centre as in Figure 2 and certain anthropometric data that particularly relate to lifting were recorded (midsection height, and above shoulder height (jaw to nose level)).After one cycle, weights will be added to the container.Weight progression flip diagram as shown in Figure 3(a) in conjunction with the colour-coded weights as shown in Figure 3(b) was utilized to advance the subject through the lifting task.The entire lifting task was performed at the Social Security Organization (SOCSO) rehabilitation centre, Malaysia and takes after the convention set by the association to guarantee the outcomes are solid.Hz to 400-450 Hz, bandpass filter with the range of 5-500 Hz was utilized to incorporate just the physiological frequency of a sEMG.This range is consistent with the high pass and low pass corner frequency prescribed by [11], which is currently supported by the International Society of Electrophysiology and Kinesiology (ISEK).

EMG Signal Analysis 4.1. Spectrogram
Spectrogram is defined as the squared magnitude of STFT and can be expressed as equation 1.
where S(t,f) is the time-frequency representation, x( ) is the input signal and w(t) is the observation window.In the previous research by the author herself, Hanning window was chosen for the spectrogram, since it has a low peak side slope compared to the rectangular and Hamming window, that would affect the narrow frequencies [12].The window size was changed from 64, 128, 256, 512, 1024 and 2048 so as to locate the best window with good timefrequency resolution.Window size of 512 and 1024 were found to be suitable for the application, but window size 512 was found to be the best between those two.

Gabor transform
Gabor transform is an expanding of the signal into a set of functions that are concentrated in both time and frequency representation and then utilize the coefficients as the descriptors of the EMG signal's property.Gabor transform is defined as equation 2.
where C(n,k) is the time-frequency representation, x( ) is the raw EMG signal and h(n,k) is the set of elementary function, which defined as; where w(τ), Tω and f 0 are the observation window, time sampling, and frequency sampling, respectively.Both time and frequency sampling must satisfy the Heisenberg uncertainty relationship as follows; (4) In this study, Hanning window was chosen, same as the spectrogram.Since the best window size for spectrogram is 512 as previously reported, the window size for the Gabor transform was varied around this value.This is to save time as the determination of window size was done on a trial and error basis.The window size was varied from 300 to 520 in order to find the best window with good time-frequency resolution.Frequency resolution (F r ) and time resolution (T r ) of the TFR were calculated using equation 5 and equation 6.
(5) (6) where N w is the window size and F s is the sampling frequency.From the TFR, the parameter used to represent the lifting flow is the instantaneous RMS voltage (V rms (t)).
where S(t,f) is the time-frequency representation and f max is the maximum frequency.

Best Window Size Selection
For this application, frequency resolution and time resolution of the TFR must satisfy certain criteria, keeping in mind the end goal to be acknowledged as the best window size.Observe that the guidelines listed are distinctive for various applications and research needs.The two criteria that should be satisfied are listed as follows: a. F r must be equal or smaller than the minimum frequency to be distinguished (f min = 5 Hz) b.T r must be smaller than 1 s in order to effectively distinguish each lifting phases

Results and Discussions
Since this research is concentrating on finding the best window size for Gabor transform, only the TFR and instantaneous RMS voltage plot for stage 5 were displayed.Figure 5 shows the TFR and V rms (t) plot for spectrogram using window size 512 which is found to be the best window size for this application, based on previous research done by the author.Roughly looking at Figure 5 The following five figures as shown in Figure 6, Figure 7, Figure 8, Figure 9 and Figure 10 represent the TFR and V rms (t)plot of Gabor transform for window size 300, 400, 430, 450 and 520, respectively.The selection of these window sizes are based on the selected best window size (512) explained in previous research.The window sizes were varied by trial and error method near this value and the resolution for both time and frequency were monitored for All five window sizes presented in this paper have acceptable time and frequency resolution based on the criteria listed before.Table 2 summarizes the frequency resolution and time resolution for all window sizes tested.Since a bandpass filter with a range of 5-500 Hz was used in the pre-processing stage, thus the minimum frequency, fmin to be detected is 5 Hz.It can be seen that all window sizes in Table 2 able to detect the minimum frequency exist in the signal since all of them have frequency resolution that is either equal or smaller than fmin.Similar to the time resolution, Tr criteria, all window sizes must have Tr less than 1 s to effectively distinguish each lifting cycle.All window sizes listed in Table 2 satisfy this criterion.As to distinguish which window size is the best, the TFR peak time and V rms (t) peak time were measured and the absolute error was calculated.By referring to Table 3, as the window size increased, the absolute error is also increased.Thus, after thorough study and comparing, and considering not just the time resolution and frequency resolution, but also the absolute error exist between the TFR peak time and V rms (t) peak time, the window size of 450 was considered as the Gabor transform best window size for this application.Table 4 summarizes the results of Gabor transform and spectrogram using their best window size resulted from the analysis.Not just by having a slightly better time resolution compared to the spectrogram, Gabor transform also has a lower absolute error, which is the main criteria to look at when having results that have acceptable time and frequency resolution.Despite the fact that only the result for one subject and one muscle was presented, alternate subjects still have comparable patterns of TFR and Vrms(t) plot as the window size is changed.This can be seen from the absolute error mean plot and standard deviation error bars of eleven subjects for every window size, as in Figure 11.

Conclusions
Results presented demonstrated that the study effectively introduces guidelines to decide acceptable Gabor transform window size to be used in the analysis of core-lifting task.The main problem occurs when dealing with time-frequency distribution such as Gabor transform and spectrogram, is the problem of resolution, as this can affects the reliability and accuracy of the analysis.This issue, however, can be solved by choosing a suitable window size.
Despite the two main criteria of a good frequency resolution (Fr must be equal or smaller than the minimum frequency to be detected) and good time resolution (Tr must be smaller than 1 s to correctly identify each lifting phases) as presented in the author's previous research, another criteria that is important to determine the best window size especially when dealing with multiple window size that have good time and frequency resolution, is the absolute error.By considering these three criteria, the window size of 450 was found to be the best for this application.However, this value is not fixed as different researchers may have different opinions and different applications may have a different level of importance of the three criteria.When the performance of Gabor transform and spectrogram were compared, it can be seen that Gabor transform provides a marginally better time resolution and lower absolute error, with a more flexibility in choosing the window size to suits various research applications.

Figure 1 .Figure 3 .
Figure 1.Core-lifting task flow for 1 cycle Figure 2. Valpar work centre Figure 2(a) shows the surface EMG electrodes attached at the biceps brachii named as input (A) and the reference electrode named as (B), while Figure 2(b) is the surface EMG electrodes appended at the erector spinae.

Figure 11 .
Figure 11.Absolute error mean plot with standard deviation error bars of eleven subjects for each window size

Table 2 .
Comparison of Time Resolution and Frequency Resolution for Each Window Size

Table 3 .
Comparison of Absolute Error for Each Window Size

Table 4 .
Performance Comparison between Gabor Transform and Spectrogram