Muscle activity processing

Dimitra Blana
The quest for a life-like prosthetic hand
3 min readMay 25, 2018

When muscles contract, they generate electricity that we can measure with a technique called electromyography (EMG). We get something that looks like this:

Three bursts of electrical activity, corresponding to three muscle contractions

It’s a squiggly line that changes a little when the muscle is resting, and a lot when it is contracting.

If you are wondering about its shape, it is due to the action potential. This is the mechanism the brain uses to send electrical signals to the muscles, and which allows you to reach for that chocolate biscuit. The EMG is the summation of action potentials from multiple muscle fibres. Individually, they are shaped like this:

There are many ways to process EMG signals, depending on the purpose of your experiment. Our purpose is to convert them into inputs for our computer hand model.

The tricky bit is that we need to do this in real time, because it is part of the control method for the hand prosthesis. So unlike the analysis of the motion data, which we can do at our leisure following the end of the experiment, we need to process the EMG data as it is being collected.

Here’s what we do. At each step, which we take ten times a second, we run the following process:

  1. We collect new EMG data from our participant, as they are moving their hand. We record EMG a thousand times a second (we have to do it that often otherwise we wouldn’t be able to capture all the changes in the squiggly line), so we end up with 100 new EMG data points (1000 points a second divided by 10 times a second = 100 points).
  2. We add these points to the 100 points we collected during the previous step, so that we have 200 points to analyse.
  3. Our EMG system records data from 0 to 4 Volts (you can see that in the picture above). So next, we remove the baseline (2 Volts) and divide by 2, so that instead of a signal that changes from 0 to 4, we have a signal that changes from -1 to 1.
  4. We then take the absolute value of the signal, which means that we turn all the negative points into positive. This is called rectification. Are you still with me?
  5. Finally, we apply a moving average filter to smooth the signal. This is because we are interested in the overall shape of the EMG, and not every single up and down of the squiggly line. I mentioned filtering when I described the processing of motion data. We used it then to remove high frequency noise, but the effect is the same: a smoother signal.

After all this we end up with the red line below:

Isn’t that neat? We now have a signal that is zero when the muscle is resting, and increases smoothly to a maximum of one when the muscle is fully active (which doesn’t happen in the example above, it only goes up to 0.2 or so).

That’s perfect, because our computer hand model expects an input between zero and one, representing how active the muscle is.

What does the model do with this input? Tune in next week to find out :)

--

--

Dimitra Blana
The quest for a life-like prosthetic hand

I am a biomedical engineer, and I develop computer models to help understand and treat movement impairment. I am Greek, living in the UK.