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, Data.xlsx, file that is provided, was produced from the experiment and it has column A as time, column B as Force and column C as EMG 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 (call 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 can be 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: For Example, assuming we use a window of 20, i.e. a moving average of filter of 20 samples, using the first 20 samples you 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.

In the figure above, the data points for the vector Raw_EMG starting from element(1) up to element(n) will be squared then added, then the square root is taken of the sum and then divided by n. This RMS value is now stored in a new vector Filter_EMG as element(1). For the Data.xlsx sample file, you will need to add a multiplier constant of k = 20, so that the RMS values are equivalent magnitude to the raw EMG and can be seen on the graph.

Write a MATLAB script file, that will prompt the user for an excel file, read in the excel data and perform RMS on the EMG data only. Use a menu command to ask the use to select a filter window of: 500, 1000, 1500 as well as option for the user to specify any window size from 100 to 2000. Your script should plot graphs of EMG vs Time with the Raw and the Filtered EMG on the same axis. Ensure that the graphs are clear and well labeled.

Submit your script (.m) file that will perform the above tasks.

Note: When you are averaging, as you get to end of the vector it can become difficult. You will either need to stop filtering before at n places before the end where n is the filter window value that was selected, but this produces unfiltered end effect. Another way is to reduce the moving window by one for each iteration at the end so that the window size is gradually reduced but this also produces an unfiltered end effect as you approach the end. Either way you need to reduce the end effect. Typically you can ignore the end values by setting them to zero.

Question 2

Using the script that you have developed in Question 1, submit a Word or PDF document showing your flow chart as well as screen shots of the graphs of raw and filtered EMG with windows sizes of 500, 1000 and 1500 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!