{'fraction_non_alphanumeric': 0.02811188811188811, 'fraction_numerical': 0.016713286713286712, 'mean_word_length': 4.747990353697749, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Effect of window length on performance of the elbow-joint angle prediction based on electromyography

The high performance of the elbow joint angle prediction is essential on the development of the devices based on electromyography (EMG) control. The performance of the prediction depends on the feature of extraction parameters such as window length. In this paper, we evaluated the effect of the window length on the performance of the elbow-joint angle prediction. The prediction algorithm consists of zero-crossing feature extraction and second order of Butterworth low pass filter. The feature was used to extract the EMG signal by varying window length. The EMG signal was collected from the biceps muscle while the elbow was moved in the flexion and extension motion. The subject performed the elbow motion by holding a 1-kg load and moved the elbow in different periods (12 seconds, 8 seconds and 6 seconds). The results indicated that the window length affected the performance of the prediction. The 250 window lengths yielded the best performance of the prediction algorithm of (mean±SD) root mean square error = 5.68%±1.53% and Person’s correlation = 0.99±0.0059.


Introduction
Nowadays EMG signal has important role in the development of the devices based on myoelectric control such as prosthetic device, exoskeleton for assistive or rehabilitative purpose, and sport activity monitoring. High accuracy in the prediction of the joint angle is significant in the devices based on myoelectric control. EMG is a signal which is generated when the muscle is in contraction. The characteristics of frequency and amplitude of EMG signal are 20 to 500 Hz and 0 to 10 mV [1] respectively. EMG can represent the activity of muscle when the limbs are in motion. By analysing the EMG signal, we can predict the position or angle of the joint which is under the study. The algorithm to predict the joint angle can be classified into two methods [2], namely e a non-pattern recognition and pattern recognition. A pattern recognition method uses classifiers to recognize the features. The classifiers, which are used often in the related research, are the artificial neural network [3], support vector machine [4], and neuro-fuzzy [5]. In the pattern recognition method, the classifiers can be assumed as a black box model which has inputs from feature extraction. The weakness of this method is the need of a training time to learn the pattern of the feature. A non-pattern recognition method uses a modelling function with the Hill-based method [6], a combination of feature extraction and low pass filter [7], and an optimization of the feature extraction using Kalman filter [8]. Feature extraction is an important part in the prediction algorithm which is used to predict the elbow joint angle. Previous researchers more concerned using time domain feature extraction than other domain (frequency and wavelet). This is due to the less complexities of processing time than those frequency and wavelet domain. Less complexity in the feature extraction is very important when the algorithm is applied to the real system. Some parameters in the feature extraction need to be adjusted in order to obtain an optimum performance of the prediction. The parameters are window length, type of the segmentation (disjoint or overlap segmentation), and frequency sampling. The window length is essential in the feature extraction because it determines the accuracy of the prediction and the time processing of the system. In a real-time system, the window length cannot be too long because it introduces a lag time in the myoelectric control system. Smith [9] investigated the optimal window length for pattern recognition based myoelectric control. In his research, the classifier was used to discriminate seven patterns of motion by varying window length (50 to 550 milliseconds). Subasi [10] used window length of 256 milliseconds for feature extraction. Chu [11] suggested that in the devices based myoelectric control, the window length should be less than 300 milliseconds. Those previous studies concerned to find the optimal window for the best performance of the classifier. The study of window length which is related to the prediction of the elbow joint angle is rarely found in several literatures. Thus, studies in the window length, such as the Pearson's correlation coefficient and linear regression, which relate to the performance of the prediction algorithm are still promising.
The optimum of the window length needs to be investigated in order to obtain the best performance of the prediction and the linearity of the prediction algorithm. In this study, first, we proposed a nonpattern recognition method to predict the elbow joint angle. This method used zero-crossing feature extraction and second order Butterworth low pass filter. Second, we evaluated the effect of the window length on the performance of the prediction.

Experimental Setup
EMG signal was collected from biceps muscle ( Fig. 1(b)) using three disposable electrodes of Ag (AgCl). Two electrodes were placed in the biceps muscle, and one electrode was used as a common ground which was anatomically not related to biceps muscle. The distance of the electrodes was about 2 cm. Before placing the electrode, the skin surface was cleaned from dust and oil using alcohol 70%. This preparation was purposed to maintain the tape of the electrode, so that the electrode would not slip when there was a motion on elbow joint. In this experiment, the elbow was moved in the flexion and extension motion. The period of the motion was varied with three different periods (12 second, 8 second and 6 second). The period of the motion was synchronized using a metronome application (Tempo Perfect). In the data collection ( Fig.  1(a)) diagram, EMG was recorded while the elbow was moved in flexion and extension motion. The motion of the elbow joint derived from full extension (0 o ) to full flexion (150 o ) and then returned to full extension (0 o ). It was called as one cycle of motion. EMG signal was sampled using sampling frequency of 1000 Hz (time sampling equal to 1 milliseconds). An EMG amplifier was used to amplify the EMG signal to some level which was fit to the A/D converter. A 12 bit A/D converter was used to convert from analog to digital format.

Feature Extraction
Zero Crossing (ZC) is number of time that the signal crosses a certain threshold value. Chang [12], the first person who introduced the use of ZC as feature extraction, used this feature to determine the onset of muscle contraction. This feature can represent frequency information of the EMG signal [13]. The ZC feature is formulated as [14]   The x i indicates the i-th EMG signal, N indicates the length of the signal, and threshold indicates a certain voltage value.

Infinite Impulse Response
Infinite Impulse Response (IIR) is a recursive filter which uses a previous output as an input of the filter. This filter is a mathematical process that is used to enhance or reduce a certain frequency band of the signal. This digital filter is usually implemented using a software programming [15]. The digital filter is written as following equation: Where and are the (M+1) numerator and N denominator coefficient, respectively. The coefficient of IIR filter was calculated using MATLAB program (version 2008). The coefficient was designed as a low pass filter second order Butterworth filter.

Data Processing
The data processing (Fig.2)  raw EMG signal and to evaluate the accuracy of the prediction. The recorded EMG data, which were saved as text file, were opened using the Delphi programming. Zero crossing was selected as a feature extraction due to the previous study [16] which proved that the feature had better performance for root mean square error and Pearson's correlation coefficient to predict an elbow joint angle. For period of motion and window length of 12 second and 25 millisecond respectively, the feature extraction would result 480 features (12.000 millisecond ÷ 25 millisecond). A low pass filter (LPF) was designed digitally using an infinite impulse response (IIR) as low pass Butterworth filter second order. The IIR was selected as a digital filter by considering the number of the coefficient of the filter which was less than the FIR filter. The calculation of IIR filter coefficient was performed using MATLAB application. The LPF was used to filter the ripple yielded from the output of the feature. To evaluate the performance of the prediction, the output of filtered features was normalized by multiplying with maximum angle so that the filtered feature had the same unit as the real angle. The maximum angle was accorded to the real angle of the elbow joint while EMG was recorded.

Window Length
In regards to the aim of the study, each cycle motion was performed on period of motion of 12, 8, and 6 seconds. It was then extracted with different window length from 25 to 250 millisecond with increment of 25 milliseconds in order to investigate whether there was any relationship between the window length and the performance of the prediction. The raw EMG data were segmented into several windows with disjoint segmentation. Fig 3 shows  for window length of 200 millisecond. For time frame of 1000 milliseconds, the number of feature is five as shown in Fig. 4. The y-axis in the Fig. 4 is in degrees unit because the feature has normalized the angle unit by multiplying with the maximum value of the real angle.

Statistical analysis
The performance of the prediction algorithm, which was tested with some window length, was evaluated using root mean square error (RMSE). Several previous studies [17] [18] used this value (RMSE) to measure the accuracy of the prediction. The RMSE value can be calculated using the following equation [3]: The Pearson's correlation coefficient (CC) is also often used as a complement of the RMSE value. The CC was used to measure the relationship between two parameters. In this case, the parameters were the predicted angle (x i ) and the real angle (y i ) and N indicated as the window length. Previous researchers [19] [20] used CC to measure the relationship between those parameters. The CC can be formulated as follows: The significant different tests, between two or more condition, was performed using analysis of variance (ANOVA) of single factor. In this study, the effect of the window length would be tested to see whether any significant change of the performance of the prediction. As mentioned on several related work literatures, the significant confident was 95% (alpha =0.05).

Estimated Elbow Joint Angle
EMG signal shows a random [1] value with the amplitude of the EMG signal ranged from -1.5 to 1.5 millivolt (Fig.4(a)  Smith [9] reported that in the window length of 150 to 250 milliseconds, he obtained the best performance of the classifier. A similar result was also reported by Kamavuako [21] that the optimal window length was 250 milliseconds. In the window length of 50 milliseconds and period of motion 8 seconds, the performance was the lowest (RMSE = 17.30%±0.96% and Pearson's correlation = 0.92±0.025). Although, the RMSE and Pearson's correlation was varied for different periods of motion and window length, yet, the Pearson's correlation was higher than 0.9. It indicated that there was a high relationship between the predicted angle and real angle.
In the window length of 150 milliseconds, the RMSE and the Pearson's correlation value was almost coincided for all of periods of motion (12 seconds, 8 seconds and 6 seconds) namely 9.29%±1.13% and 0.98±0.009 respectively. In the window length of 50 to 150 milliseconds, the period of motion of 6 seconds has the lowest RMSE than other periods of motion, yet, after the window length was set to more than 150 milliseconds, the period of motion of 8 seconds has the lowest RMSE other periods of motion.
In ANOVA test, it was found that there was no significant difference on RMSE between window length of 50 and 75 milliseconds (p>0.05). Between window length of 50 and more than 100 milliseconds, there was a significant difference on RMSE (p<0.05).

The Effect of Window Length on Determination Coefficient
The linearity of the predicted angle is essential in the development of the devices based on myoelectric control. In this study, the linearity of the prediction angle was tested for each different windows length. The linearity was measured by plotting the linear regression of the output of the predicted angle against the real angle (Fig.6). The linear regression estimates the trend line of the predicted angle. The trend line shows the difference of the determination constant (R 2 ) for the different windows length. The highest determination constant was obtained when the window length was 250 milliseconds (R 2 =0.96). The window length determined the determination constant. The longer the window length the more linear the predicted angle.

Conclusion
In this paper, we demonstrated the effect of the window length to the performance of the prediction. The prediction algorithm was performed using the zero crossing feature extraction and filtering the output of the feature using a second order Butterworth low pass filter. The prediction algorithm offers a simple method to predict the elbow joint angles. The effect of the window length to the performance of the prediction was tested by varying some windows length (50 milliseconds to 250 milliseconds) in the feature extraction. Accuracy (RMSE and Pearson's correlation coefficient) of the prediction algorithm depended on window length. The results of this study suggested that the window length of  250 milliseconds has the highest performance (root mean square error and Pearson's correlation) to predict the elbow joint angle. The window length also affected the linearity of the predicted angle. There were some limitations to this study which need to be considered in the next work such as muscle fatigue, the distance between the electrodes, the overlap segmentation, and the kinematic condition in the data collection. The results of this study can be used for other related studies based on electromyography such as sport activities, ergonomic tests, and devices based on myoelectric control.