Smoothing spikes of analog data

Thread Starter

EMGcircuit

Joined Oct 29, 2013
4
Hello,
I'm currently trying to figure out whether it is possible to smooth an EMG-signal in an analog circuit.
My problem is that I would like to turn on a vibrator, if the EMG reaches a certain amplitude and turn off, once the muscle reflexes via use of a comparator - of course happening in real time.

Due to EMG's nature, a raw signal looks like:
http://www.biomed.drexel.edu/labs/biomechanics/images/emg_fig3.gif

My theory is that the vibrator would constantly turn on and off, thus giving discomfort to the user. Firstly, my plan is to rectify the signal to make all values positive. After this, I would like some sort of smoothing. Digitally, root mean square would be ideal for my purpose (see image below), however, I am pretty lost when it comes to implementing a method similar to this in an analog circuit.

http://www.jjengineering.com/Images/Screenshots/emgraw-1WebSmall.jpg

I have been recommended a low pass filter to filtrate some of the highest frequency, however this won't change the oscillative nature of an EMG signal. Is there anything I can do to lessen this? Must be in an analog circuit.

Thank you!
 

Danm1

Joined Jul 19, 2010
69
If you have a wave form that you want to smooth and want to implement a filter, it can be done in analog or digital.

It more depends on your system, are you reading it from transducer on the persons body and then want to correct the condition by smoothing the signal? Then why not use a digital filter?

If you must use an analog filter, you can look at Butterworth, Chebyshev or Elliptic.
 

#12

Joined Nov 30, 2010
18,224
You have 4 variables to work with. First, an RC low pass filter can act as a crude integrator with (1) adjustable charge and (2) discharge times. Third, the time the vibrator is on is adjustable.

You could use an operational amplifier as a precision rectifier and integrate the resulting signal for a more precise result. This seems important because of the DC offset. Use a capacitor to couple the signal to the precision rectifier and use resistors and a capacitor to set the charge and discharge times.

The goal seems to be to integrate fast pulses and switch on the vibrator (4) at a certain level.

Something like this:
 

Attachments

Danm1

Joined Jul 19, 2010
69
Do you have access to Matlab or similar program? You should simulate the filter circuit to see how it filters your sample signals. Then you will be able to tweak it precesely to get the exact result you want.
 

ronv

Joined Nov 12, 2008
3,770
It looks like a envelope detector to me. Is what you care about the amplitude of the signal and not all the "grass" that creates the envelope?
 

#12

Joined Nov 30, 2010
18,224
Yes. Muscles are controlled by a series of pulses. Repeat rate is the key factor. Picking out any particular pulse is useless. The integral of pulses per time is the important metric.
 

Thread Starter

EMGcircuit

Joined Oct 29, 2013
4
My specific application is for a project, during which I have to develop an analog system, which samples EMG from apoplexia patients and monitors their muscle activity in certain muscles to prevent what is known as compensatory movements (Patients use their core and / or shoulder region to move their arms, when they should be using... well... their arm, which can lead to pain and loss of control)... Anyway my circuit is currently:
An instrumentational amplifier (small gain ~ 10) -> high + low pass filter (butterworth) -> OpAmp (gain ~ 300)

From here on, I'm in trouble when it comes to the further components of my circuit. Even with my filters, I still have those large spike, which would turn my vibrator on / off. I assume it'll have to involve a full-wave rectifier and then we're back to my initial statement. I do have access to MATLAB, but this particular system is supposed to be using by patients at home, so there should not be any external analysis of the data recordings, but rather have it all done by components of the circuit.

As noted in a previous comment by #12, I am not particularly interested in one exact spike of EMG, but rather the amplitude tendencies which can be drawn from it. Ideally, I would like to implement a Schmitt-trigger, which would supply the output to the vibrator.


#12, I think you may be onto something, however, I see a potential problem with integration of the signal. Say, for example, if the patient has medium (but allowed) muscle activity for a certain amount of time, then because of the integration, wouldn't that eventually add up to an amplitude value, which is "not allowed" and then trigger the vibrator falsely? Also, how would I set the time frames in which the signal in integrated and then reset from 0?
 

#12

Joined Nov 30, 2010
18,224
The resistors marked, "charge time" and "discharge time" are used to set how much time the subject is allowed to move before an alarm and how fast the integral dissipates toward zero. You are just going to have to tell the subject to hold still because "allowed" movements create exactly the same signals as, "not allowed" movements.

You can replace the second amplifier with a Schmidt Trigger or add a positive feedback resistor to turn the opamp into a Schmidt trigger. I think the second option is right because it would be adjustable.
 

Attachments

Last edited:

Thread Starter

EMGcircuit

Joined Oct 29, 2013
4
The resistors marked, "charge time" and "discharge time" are used to set how much time the subject is allowed to move before an alarm and how fast the integral dissipates toward zero. You are just going to have to tell the subject to hold still because "allowed" movements create exactly the same signals as, "not allowed" movements.

You can replace the second amplifier with a Schmidt Trigger or add a positive feedback resistor to turn the opamp into a Schmidt trigger. I think the second option is right because it would be adjustable.
This might not be a problem, afterall. My current plan is to sample data from a muscle that should be next-to inactive during an exercise, so I guess it would be possible to create such a configuration that would allow just a tiny bit of movement, but have the alarm threshold and dissipation times set rather strict
 
Top