MATLAB EMG Signal Processing Lab

Job ID: 40279000

Budget: $10 – $30 USD

Lab EMG - Electromyogram
I have result from the lab attached labeled Jennah
Introduction
Today, we will use the Biopac amplifiers at each station to collect electromyography data, which
we will then explore and analyze using Matlab.
In this lab, you will investigate the EMG from two muscles resulting from isometric muscle
contractions. Matlab code for collecting EMG data (BioPacEMG.m) is posted on Canvas. Verify
that your equipment is working correctly before attempting to collect any actual data.

Task 1: Data Collection
Procedure
Before testing your setup, make sure that the power light turns on when you flip the power
switch on your amplifier. Dr. Adamovich will explain the proper amplifier settings at the
beginning of class.
After ensuring the proper locations for electrode placement on the subject’s biceps and triceps
are clean, place the electrodes as instructed in class. Ensure the electrodes are securely attached
to the subject’s skin with medical tape, as any shifting can degrade the data. Have the subject
flex their arm several times to ensure the electrodes stay in place. In addition to measuring EMG
muscle activity, we will measure the force the muscle generates using a Biopac dynamometer.
Once the electrodes are correctly placed, connect the wires to the trifurcated grey cable that
connects the Biopac amplifier to your group’s station. The wires connecting to the electrodes on
the subject’s biceps should be inserted into the positions labeled G1 & G2, while the wire for the
reference electrode should be plugged into the position marked COM. Once the electrode wires
and grey cable are correctly plugged in, ensure they do not move too much during data
collection, as any movement will introduce artifacts and may degrade the data quality. Repeat
this process for the electrodes on the subject’s triceps.
Run the Matlab code titled “BioPacEMG” that you got from Canvas, which will ask for the
number of channels you are acquiring and the duration to collect data. Have the subject flex their
biceps or triceps, and ensure you get a clean signal.
Once you are satisfied with the quality of your EMG signal and ready to collect data, run the
same Matlab code for the experiments. After collection, as always, check and then rename the
files where you save your data for quality assurance and to prevent accidental overwriting.
Experiment A
The amplifier can prefilter the acquired data. Several preset filters can be selected from the file
ChannelPresetID.docs posted to Canvas. These channel presets can be specified in the
“BioPacEMG.m” script on line 26. Collect 3 trials:
2
Collect one trial using channel preset a104 for the two EMG channels and another trial with
preset a113. No prefiltering should be used for the force channel in both trials. In addition, a trial
should be collected without any prefiltering on all three channels. No prefiltering should be used
for the force channel in all three trials.
Have the subject sit with their forearm resting on the top of their thigh under the table, fully
supinated (palm up), pushing against the dynamometer on the underside of the table. The arm
muscles should be relaxed. Start data collection and have the subject push up on the table for 0.5
seconds 20 times, while completely relaxing for 1-2 seconds between pushes.
Experiment B
Using channel preset 113, have the subject sit with their chair raised and grab the edge of the
table with the arm fully supinated. Start data collection, and have the subjects push their hand up
for half a second, then push it down for half a second with moderate force, 10 times.
Experiment C
Using channel preset 111, have the subject sit with their chair raised and grab the edge of the
table. Start data collection, and have the subjects push their hand up for half a second, then push
it down for half a second with maximal force, repeating this several (10) times. If you see
saturation in the force signal, reduce the force slightly and collect again.
Task 2: Data Analysis (start this in class)
Data Analysis for Experiment A:
• Using signalAnalyzer, which will be explained in class, plot the power spectrum of the
three datasets (no presets, presets a104 and a113) from Experiment A on the same graph
and investigate the differences between the datasets.
• Filter the trial collected without the presets using functions butter and filtfilt with a high
pass filter at 30 Hz, and a low pass filter at 250 Hz, and compare the power spectra of the
outcome with the original a113 data using signalAnalyzer.
• Rectify the filtered data (take the absolute value of the signal) for each of the 3 trials.
• Make an envelope (by low-pass filtering the rectified data; see an example posted on
Canvas) for each of the 3 trials.
• Plot the EMG envelope on top of a plot of the rectified EMG data for 3 representative
muscle contractions.
• Plot the force versus time and filter it if needed.
• Plot the EMG envelope on top of the filtered force versus time for 3 representative
muscle contractions. Multiply the EMG by a constant if necessary.
• Describe the differences in the data from the three preset conditions and explain what you
have found and why.
Data Analysis for Experiments B & C:
• Preprocess the data using the filtering steps from the Experiment A analysis.
• For each experiment, compare the onset(s) of activation for the biceps and triceps data
using the calculated envelopes. Compare the data from both muscles and explain what
you have found and why.
3
• For each muscle dataset, compare the moderate and maximum force conditions. Compare
the EMG plots from both conditions and explain what you have found and why.
• BONUS: Plot envelopes of the EMG bursts synchronized in time (using onsets for each
EMG burst), separately for the biceps and the triceps. Use a figure with two subplots.
*If you run the wrong script or stop the script before the duration is over, you will lose
connection with the amplifier. DO NOT RUN “clear all”. You need to run lines 61 and 62
(see below) of the “BPE” script to unload the library:
calllib(libname, 'disconnectMPDev'); % disconnect device
unloadlibrary(libname) % unload library
Then, you can rerun the script.
Lab Report: Your lab report must be submitted to Canvas as a single Word document.
Formatting: Make sure to include:
• Date
• Names of the people in your group
• A presentable format
• Clearly labeled and explained plots
• Clear wording
• An explanation of the procedure of the lab
• The information requested for each task
• A conclusion explaining what you found and why
• Any difficulties that you had with the lab
Each person in the group must upload their own copy of the lab to Canvas at the end of the
class next Tuesday.