PLOTS
The db45 wavelet filter was chosen based on the research conducted by Reaz et. al., which suggested that the output of the db45 wavelet filter is suitable for extracting features from the power spectrum. This filter was created using the Wavelet Filter toolbox in Matlab. From the power spectrum graphs we will be able to determine the median frequency. A decreasing median frequency corresponds to an increase in muscle fatigue. This will help us to classify weaker muscle contractions and stronger muscle contractions.
From the smoothed data graphs we will be able to create a transformation to torque as the mean amplitude of the time domain data corresponds to the force produced by the muscle. The EMG data was smoothed using the Gaussian smooth data function in Matlab.
Figure 1.
(Top) This plot shows the original time domain data from the online data set. (Bottom) This is the absolute value of the same data in the frequency domain. The data used to create these plots was used in our data classification.

Figure 2.
(Top) This is a plot of the time domain data taken from the custom EMG. (Bottom) This is the absolute value of the same data plotted in the frequency domain. The data used to create these plots was used for the non-linear transformation that helped to create the virtual model.

Figure 3.
(Top) The is the online data set time domain data sent through a db45 wavelet filter. It has removed some of the noise and produced a more recognizable shape that is comparable to that of the custom EMG. (2nd) This is the frequency domain of the d45 filtered data. (Last) This is the power spectrum of the data. We will use this to classify signal data.

WAVELET FILTERING
The motivation for using wavelet filtering in our project is that the traditional Fourier Transform is “unsuitable for nonstationary signals” as it would “wash out any local anomalies of the signal”. Anomalies of the signal may include features of the signals that we may want to observe or extract [18]. Nonstationary, or time-varying, signals are signals whose “frequency content changes with time” [19]. EMG signals have been considered as stationary signals in the advent of EMG signal technologies, but more recent literature have been considering EMG signals as nonstationary as a whole, or at least locally stationary [20].
One solution that relies on the assumption that the EMG signal is at least locally stationary is the short-time Fourier Transform (STFT) as seen in Equation 1, where f(t) is the EMG signal and g(t) is the window function: (1) [18]

The working principle of STFT is that the window function is then modulated and shifted. However, due to this working principle, the STFT necessitates that the window function is fixed in time, which limits feature extraction optimization in the frequency domain in response to local patterns or anomalies of the EMG signal [18]. Figure 1 graphically shows the constant window associated with the STFT, in which the constant cell is applied throughout the entirety of the time-frequency plane without any regard for special features in the plane that might require a different window dimension for proper extraction.
Figure 1. Time-frequency plane showing the constant windows associated with the STFT. The sigmas represent the spread of the EMG signal in the time domain and the frequency domain [18].

However, the wavelet transform introduces flexibility in the window sizes, and in turn efficiency, because the working principle of the wavelet transform involves scaling and shifting the window function. Equations 2 (top) and 3 (bottom) show the wavelet transform and the window function respectively, where f(t) is the EMG signal, and “a” and “b” are parameters that can be used to control the window size: [18]

More specifically, the parameter “a” controls the spread of the EMG signal which affects the window sizing, and the parameter “b” controls the scaling of the time domain with respect to the frequency domain (in such a way that the time axis scale accommodates the frequency axis scale) which contributes to the efficiency of the wavelet transform [18]. As seen in Equation 3, the window function of the wavelet transform leverages the scaling property of the Fourier Transform to provide the non-constant window sizing for optimizing feature extraction. Figure 2 graphically shows the non-constant windows associated with the wavelet transform.
Figure 2. Time-frequency plane showing the non-constant windows associated with the STFT. The sigma represents the spread of the EMG signal dependent on the parameter “a” of the wavelet transform [18].
