Question: QUESTION 1 In the LabVIEW section, you recall the project where EMG (muscle electrical activity) data was collected from the lower arm muscles for 60
QUESTION 1
In the LabVIEW section, you recall the project where EMG (muscle electrical activity) data was collected from the lower arm muscles for 60 seconds at a sample rate of 0.001sec. During this time, the subject was asked to grip a force sensor at light strength for about 15 seconds, rest for a few seconds, then grip at a medium strength for 20 seconds, rest for a few seconds and then increase the grip to maximum strength for the remaining time. A grip force sensor measured the strength and was sampled at the same rate.
The spreadsheet file, Force_vs_EMG_Data.xlsx, that is provided in the Quiz folder, was produced from the experiment and it has column A as time, column B as EMG and column C as Force data. The EMG data is noisy and to get any meaningful information it needs to be processed.
One way to filter EMG used previously, was to use a smoothing filter. A more precise description of this type of filter is the root mean square (RMS) filter. This method looks at a sub set of the data (called the window), squares each value in that window, adds these squared values, takes the square root of the sum and then divides this by the number of samples to give an RMS average value. This value is then stored as a new data point in a new vector. The window is moved by one sample, the new RMS average computed and the value stored as the next data point and so on until the window is at the end of the vector. The figure below illustrates. Assuming we use a moving average of filter of 20 samples, using the first 20 samples compute the RMS averaged and the result placed in the first column of the new vector; starting from the second value, the next 20 samples are used to compute the RMS average and placed into the next column of the Filtered EMG and so on.
From above, the data points for the vector Raw_EMG starting from element(1) up to element(20) or element(n) where n=20, are squared then added, the square root is taken of the sum and then divided by 20. This RMS value is now stored in a new vector Filter_EMG as element(1). This is repeated using Raw_EMG starting from element(2) up to element(21) or element(n+1), are squared then added, the square root is taken of the sum and then divided by 20. This RMS value is now stored in a new vector Filter_EMG as element(2). We repeat this until we have filled "Filter_EMG" vector.
Write a MATLAB script file, that will read in the excel data, perform RMS on the EMG data. Use a menu command to ask the use to select a filter window of: 200, 400, 750 or 1000 points. Perform the filter operation and produce a plot of the filtered data (EMG vs Time)
Submit your script (.m) file that will perform the above task.
Note: Your filtered EMG vector needs to be the same size as the time vector (i.e. the same size as the raw EMG vector) in order for you to correctly plot.
Also Note: When you are averaging, as you get to the end of the vector it can become difficult. You will either need to stop filtering at n places before the end of the "Raw_EMG" vector, where n is the filter window value that was selected. Another way is to reduce the moving window by one for each iteration at the end so that the window size is gradually reduced until at the very end it is one, or the last point of the new filtered EMG vector is same as the rectified EMG vector.
Make sure to have an appropriate header, readable variable names, comments as well as suitable user input error checking if required.
QUESTION 2
Using the script that you have developed in Question1, submit a Word document showing your flow chart as well as screen shots of the graphs of raw and filtered EMG with windows sizes of 200, 400, 750 and 1000 data samples. Thus you should have four separate graphs, one for each window size, that have the raw and filtered EMG on the same axis.
Make sure that the flow chart and graphs are large enough to be read.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
