Predict loads in potential patient's hand
Copyright 2020 Manqing Zhou
In order to remove any of low frequency noises from out EMG signal data. Done by a high pass filter to remove any of the non-zero dc levels from the signal data

Apply a digital smoothing algorithm that outlines the mean trend of the signal develoment
Extract the average value of 100 samples to reduce the input data of our classification. Here, I used RMS
---
def rms(data):
df = pd.DataFrame(data)
df2 = np.array(df).ravel()
# change it into 1D array to do window sliding
# np.sqrt(sum([a[window_size-i-1:len(a)-i]**2 for i in range(window_size-1)])/window_size)
df3 = np.sqrt(sum([df2[100 - i - 1:len(df2) - i] ** 2 for i in range(99)]) / 100)
#max_rms = 1.0608
#normalized = np.divide(df3, max_rms)
return df3
def rms(data):
df=np.array(data).ravel()
df2=np.sqrt(sum([df[100 - i - 1:len(df) - i] ** 2 for i in range(99)]) / 100)
return df2
---
Use the sub maximal normalization. The main idea is to divide the data by max rms. The graph below is one subject.

Prediction Part
The final code file is in /emg/final_code.py