0% found this document useful (0 votes)
25 views

Lab 6 & 7-EMG Signal Analysis

The document describes processing electromyography (EMG) signals recorded from muscles during a bench press exercise. EMG signals were recorded from three muscles while subjects lifted weights of 5 and 10 lbs. The goal is to analyze the EMG data to determine if there is a significant difference in muscle activity between the two weights. The EMG signals will be processed by removing bias, full-wave rectification, filtering with low-pass filters or moving averages, and integrating to obtain a measure of total muscle effort for each trial.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Lab 6 & 7-EMG Signal Analysis

The document describes processing electromyography (EMG) signals recorded from muscles during a bench press exercise. EMG signals were recorded from three muscles while subjects lifted weights of 5 and 10 lbs. The goal is to analyze the EMG data to determine if there is a significant difference in muscle activity between the two weights. The EMG signals will be processed by removing bias, full-wave rectification, filtering with low-pass filters or moving averages, and integrating to obtain a measure of total muscle effort for each trial.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

School of Applied Medical Science

Department of Biomedical Engineering


Medical Signal Processing Lab (BM323)

Experiment 6: EMG Signal Processing

I. Objective:
The objective of this assignment is to expose you to signal processing methods applied
for quantifying human performance by analyzing EMG signals for total muscle effort
over a given task. In particular, the bench press maneuver, which the subject performs, is
used as the basis of analysis. Specifically, the subject will perform the bench press
maneuver with two different weights, 5 and 10 lbs, performing three trials of the task for
each weight. As the subject performs the task, electromyographic (EMG) data is
recorded. The goal of the assignment is to find a significant difference in the data
between the 5 and 10 lb maneuvers.

II. Physiology Background :


The Bench Press: The bench press is an exercise of the upper body. For bodybuilding
purposes, it is used to stimulate the pectorals, deltoids, and triceps. In order to perform
this maneuver, the person, while on his or her back, lowers a weight to the level of the
chest, then pushes it back up until the arm is straight. This exercise focuses on the
development of the pectoralis major muscle as well as other supporting muscles including
the triceps, anterior deltoids, and serratus anterior amongst others. In this experiment,
EMG recordings were simultaneously (i.e. at the same time) measured from the Pectoral
muscle, the Bicep muscle and the Tricep muscle of the subject, for comparative purposes.

1
The Bench Press Anatomy:

Figure 6.1: Bench press Anatomy

The electromyographic (EMG) signal: The EMG is an electrical measure of skeletal


muscle activity. To understand this signal, we must consider the physiology of muscular
contraction. Human skeletal muscle is excited by motor neurons. Specifically, a single
motor neuron excites several muscle fibers and thus a motor neuron and its corresponding
fibers are referred to as a motor unit. When a motor unit is excited, an action potential
propagates from the motor endplate to the other ends of the muscle fibers. This action
potential, as we know, is a rapid exchange of ions across a cell’s membrane and can be
measured as a rapid change in membrane electrical potential, or more specifically a
change in membrane polarity (from negative to positive for example). Compiling all of
these concepts into a simple model, we can describe muscular activation as an electrical

2
dipole traveling down a muscle fiber. That being said, if we place a pair of electrodes
close to or on an active muscle fiber, we should be able to measure a change in the
membrane potential.

Typically, differential operational amplifiers are used to measure the voltage difference
between electrodes A and B in ‘noisy’ environments. The operational amplifier’s output
voltage (Vout) will be proportional to the difference between electrodes B and A.
Differential voltage measurements are preferred because the relatively small magnitude
of the EMG signal at the surface of the skin (between 100 and 1000 microvolts) is on the
same order of magnitude as electrical noise in the environment. By taking the difference
between electrodes B and A, we would theoretically cancel out any noise common to
both electrodes. Realistically, there are hundreds and thousands of muscle fibers firing at
random intervals and since we are using surface electrodes, it becomes increasingly
difficult to separate activity of one motor unit from another. In general then, an EMG
signal is an indicator of the activity of several muscle fibers near the electrodes.

Table 6.1: The main Parameter of EMG signal

Typical EMG Characteristics


Time Domain
Amplitude (pre- 0-10mV
amplification)
Frequency Domain
General Frequency Range 10-500Hz
Dominant Energy 50-150Hz
Peak Energy 80-100Hz
Specific Frequency Range of Muscle Activity
Slow Twitch 75-125Hz
Fast Twitch 125-250Hz

3
III. Signal Processing Concept:
The Raw EMG signal offers us valuable information in a practically useless form. It can
not be quantitatively compared between different subjects or even for the same subject if
the electrodes are moved between one recording and the other. As such, it is typical
protocol to render the raw EMG signal into a more suitable form. There are several ways
to process EMG and the methods chosen primarily depend on what information you want
out of the EMG. For the purpose of this assignment, we want a quantitative measure of
muscular effort required to lift either the 5lb or 10lb weights. In other words, if we could
sum up the activity of each muscle over the time it took to complete the experiment we
could get an estimate of the net (i.e. total) activity to complete the task. In order to do this
we integrate the area under the processed EMG signal. However, prior to taking the
integral, a series of common steps in processing EMG are taken. Namely, the signal is
first full-wave rectified and then passed through a Low-Pass filter, before finally being
integrated. Refer to the following flow chart when reading about the signal processing
steps below. The steps outlined below need to be implemented for each of the 3 trials for
each of the 2 weights. The final values that result from the following steps should be
input into the data tables provided in the document titled DataInputs.doc.

Signal Processing Sequence – Flow Chart

4
(1) The first mandatory step in processing the EMG signal is to remove the bias,
which is a low amplitude voltage offset, which can be AC or DC. The bias is
eliminated by subtracting the mean of the signal from the signal itself.

LINEAR ENVELOPE
The linear envelope is a 2-step process: rectification followed by low pass filtration. The
linear envelope provides the signal in a form that is easy to interpret and to detect the
onset of activity.

(2) Rectification: is an operation that converts a signal whose values are both positive
and negative into one that has only positive values. There are 2 types of rectification:
a. Half-wave Rectification: all negative data is discarded and only positive data is kept.
b. Full-wave Rectification: the absolute value of each data point is used.

Rectification is an intermediate step done before further processing. In this experiment


the unbiased signal should be full-wave rectified. Otherwise further analysis will not
necessarily be valid (Think about it: Why?) Now the signal only has values >0.

(3) This stage is designated to smooth out the signal by removing higher frequency
components (i.e. Low Pass Filtration). There are two methods to do this:

a. Low Pass Filter (LPF)


Define a Butterworth filter in Matlab using the butter command.
[b,a]=butter(order,cutoff_freq, ‘filter type’)
The filter specifications you should use are as follows:
– Filter order: 4

– Cutoff frequency: 10Hz, 25Hz, 50Hz.

5
Note: the Matlab function butter requests that you input the cutoff frequency as a value
normalized by half the sampling frequency. For example, a cutoff frequency of 10Hz
would be input as: 10Hz/ 0.5 *2000Hz = 0.
In order to compare the performance of filters of various cutoff frequencies, you will
create 3 different Butterworth low pass filters, each with a different cutoff frequency.
– Filter type: ‘Low’

Apply the filter you defined using butter by using the filter command:
filtered_signal=filter(b,a,signal)
Where b,a are the filter variables output by the butter function, and the signal you input is
the unbiased, full-wave rectified signal from part (2).

b. Moving Average (MA)


The Moving Average filter will be applied 3 different times, each time with a different
window width in order to compare the performance of the filter using various window
widths. Window widths that should be implemented are: 100ms, 150ms, 200ms.
Note: these window widths are given as time-lengths. In order to be applied to the signal
in Matlab, these widths need to be converted into sample-lengths as detailed below:
window width (milliseconds) *(1 second/ 1000 milliseconds) *(sampling frequency in
samples/ second) =window width (samples).

(4) Finally, the signal is integrated, i.e. the area under the curve of the smoothed-out
signal should be determined in order to produce a ‘final’ integrated (IEMG) value. This
value is a measure of the overall muscle effort that was exerted while performing the
bench-press task.

a. Mean Absolute Value


The values of the signal are summed over the specified time then divided by the total
number of values. In the equation below is the smoothed, full-wave rectified unbiased
signal generated in part (3).

6
Remember that in Matlab, this integral is implemented by summing all the values of the
signal vector.

b. RMS Value
The RMS value represents the square root of the average power of the EMG signal for a
given period of time. It is calculated by:

– squaring each data point.

– summing the squares.

– dividing the sum by the number of observations.

– taking the square root.

The RMS measure is often preferred over the MA value because it provides a measure of
the power of the EMG signal while the MAV does not.

Signal Processing Sequence- Equation Overview

7
IV. Laboratory Protocol :

Data Preparation

Before getting started on the assignment you will need to successfully retrieve the data
and upload it into Matlab. The data you are given is a collection of trials, each trial
consisting of measurements from each of the 3 target muscle groups mentioned above.
You should have 6 data files in the .txt format. Opening the text file will help you
understand how the data is organized. There are three columns of data, each column
representing a muscle group EMG signal for a given trial using a given weight. Each file
name indicates the weight that was lifted and the trial number. For example, to load the
1st trial of the 5lb bench press, type the following command in Matlab:

load emg5_1.txt

You should now have a variable called ‘emg5_1’ in your Matlab workspace. Check the
size of your variable by using the following command:

size(emg5_1)

This should yield the following answer:

ans = 4000 3

Indicating that each data file contains 3 columns (1 column per muscle) with 4000 data
points per column. Since analysis will be done to compare the different muscle groups
during each trial, it is a good idea to separate this data file into 3 Matlab variables, each
variable representing a given muscle. We will continue to use the 1st trial of the 5lb bench
press as an example:

emg5_1pect=emg5_1(:,1);

emg5_1bicep=emg5_1(:,2);

emg5_1tricep=emg5_1(:,3);

8
You will have to repeat similar data preparation steps for the 2nd and 3rd trials of the 5lb
bench press as well as all three trials of the 10lb bench press.

Visualizing the Raw EMG Data: Now that the data has been separated into individual
files, it can be visualized to get a better understanding of what the signal we are working
with looks like. Use the plot command to generate a figure of the raw data. We begin
with the raw EMG signal seen in the figure below:

The Gain:

The first thing to note is that the recorded EMG voltage output is not what the electrodes
measure, but rather the signal coming from the electrodes is amplified by a gain factor G
by built-in circuitry located between the electrodes and the node from which Vout is read.
The signal plotted in the figure above has a maximal peak-to-peak value of
approximately 2.3V, although in reality the EMG signal had a maximum peak to peak of
460microVolts. Given this information, we can determine that the value of the gain factor
G is …………..

The Bias:

9
The next thing to notice about the figure is the small DC offset in the signal. The EMG
amplifiers cause a bias, in this case of about 0.06Volts. That is, if the electrodes were
connected to each other, the output would be 0.06 Volts. This bias can be determined by
taking the average of the raw signal. To account for this DC offset, we simply subtract it
from the recorded EMG signal. The following figure shows the unbiased version of the
above signal.

Time Axis Setup:

Now that the bias has been removed we are ready to begin analyzing the data. First, the
time frame of the recorded data needs to be defined. We know (from the data text files)
that the EMG data was collected at a sampling frequency of 2000Hz and that the total
number of data points for one recording of EMG is 4000 samples. Given this information,
we can conclude that the data was recorded for a total time of seconds and thus, a Matlab
time variable ‘t’ should be defined as follows:

t=[ : : ];

The following is the same unbiased data plot, but with time labels in the x-axis rather
than sample number label.

10
Advanced Signal Processing

Your task is to implement all the Signal Processing steps described in the Flow Chart
Sequence above on the EMG Data you have been provided using the MATLAB
environment. You will do so by writing a different function file for each of the signal
processing steps and then running all of these functions in a single .m file.

V. Coding Tip:
Helpful Hint: This assignment requires you to perform several signal processing steps
many times using different data. Thus, it is a good idea to make this easier & faster by:
– Creating a different function file for each signal processing step
 e.g. unbias.m, movingaverage.m, butterfilter.m, etc

 Write the function in such a way that the user can simply change the value of the
input variable when calling the function rather than by having to re-edit the
function each time.
– Create an .m file for each muscle trial (e.g. emg5_1_bicep.m) that includes all of the
above signal processing functions, so by running this .m file you’re able to execute all
processing steps at once.

VI. Plotting:
Generate a 4-subplot figure for each of the following scenarios:
I. EMG5_1_Pectoral: Unbiased : Full-Wave Rectified : LPF (10Hz) : Mean Absolute
Value

II. EMG5_1_Bicep: Unbiased : Full-Wave Rectified : LPF (10Hz) : Mean Absolute


Value

III. EMG5_1_Pectoral: Unbiased : Full-Wave Rectified : LPF (10Hz) : RMS Value

11
IV. EMG5_1_Pectoral: Unbiased : Full-Wave Rectified : LPF (50z) : RMS Value

V. EMG10_1_Tricep: Unbiased: Full-Wave Rectified: Moving Average (100ms):RMS


Value

VI. EMG10_1_Tricep: Unbiased: Full-Wave Rectified: Moving Average (200ms):RMS


Value
Be sure to label all axes and give appropriate titles for each subplot.
Note that the x-axis should be Time not Samples, as explained in the Time-Axis section
above. Below is an example figure for the following scenario:

EMG5_2_Tricep: Unbiased : Full-Wave Rectified : LPF (25Hz) : Mean Absolute Value

VII. Results Analysis:


After performing all the above signal processing steps on all 6 sets of data and tabulating
the output values in the Data Tables provided to you, it is now time to overview these
results and draw some conclusions about muscle effort and activity during the different
experimental trials. What conclusions can you reach regarding …

1. (a) Comparison of effort exerted by the 3 different muscle types


Within one trial of one weight: Across types of muscles
Weight 5: Trial 1: Pectoral vs Bicep vs Tricep
12
Weight 10: Trial 1: Pectoral vs. Bicep vs Tricep
Weight 5: Trial 2: Pectoral vs Bicep vs Tricep
Weight 10: Trial 2: Pectoral vs. Bicep vs Tricep
Weight 5: Trial 3: Pectoral vs Bicep vs Tricep
Weight 10: Trial 3: Pectoral vs. Bicep vs Tricep

(b) Thus, what muscles are targeted by a bench-press maneuver?

2. (a) Evidence of fatigue experienced after several trials


Within one weight: Across trials for each muscle type
Weight 5: Pectoral: Trial 1 vs Trial 2 vs Trial 3
Weight 10: Pectoral: Trial 1 vs Trial 2 vs Trial 3
Weight 5: Bicep: Trial 1 vs Trial 2 vs Trial 3
Weight 10: Bicep: Trial 1 vs Trial 2 vs Trial 3
Weight 5: Tricep: Trial 1 vs Trial 2 vs Trial 3
Weight 10: Tricep: Trial 1 vs Trial 2 vs Trial 3

(b) Thus, do the muscles fatigue after 3 consecutive benchpresses?

3. (a) Comparison of effort exerted when bench pressing 2 different weights


Within one muscle: Between 2 weights foor all trials

Pectoral: Trial 1: 5lb vs 10lb

Pectoral: Trial 2: 5lb vs 10lb

Pectoral: Trial 3: 5lb vs 10lb

Bicep: Trial 1: 5lb vs 10lb

Bicep: Trial 2: 5lb vs 10lb

Bicep: Trial 3: 5lb vs 10lb

13
Tricep: Trial 1: 5lb vs 10lb

Tricep: Trial 2: 5lb vs 10lb

Tricep: Trial 3: 5lb vs 10lb

(b) Thus, do the muscles exert more effort when lifting a 10lb vs 5lb weight.

14

You might also like