Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Filter problem... Very urgent pls..

Status
Not open for further replies.

kingkong83

New Member
Hello.. i have 1 problem that relative with the low filter (Before i have post 1 topic about the ECG system) and i want to change the circuit for the low pass filter... before i am using the 150Hz for the low pass filter and now i want change it to the 60Hz.. But after i changed the value of R1 (to 2.65kohm) and R2 (to 26.5kohm) i cannot get the ECG signal
Before chaged the value, the signal very small after i pass through the notch filter, why??) i am using the formula : 1/2*pi*f*c to change the value for LPF.. Any mistake in the calculation??

Em.. i also want to change the previous circuit (low pass filter part) to butterworth filter using sallen key circuit for improve my circuit performance.. But i dunno how to what value should i put.. Can u help me put the value?? i want set the frequency at 60 Hz and 120 Hz..

The last question is the connect to replace the LPF part is correct?? i have upload the circuit below..
 

Attachments

  • hardware11.jpg
    hardware11.jpg
    37.4 KB · Views: 1,090
kingkong83 said:
Hello.. i have 1 problem that relative with the low filter (Before i have post 1 topic about the ECG system) and i want to change the circuit for the low pass filter... before i am using the 150Hz for the low pass filter and now i want change it to the 60Hz.. But after i changed the value of R1 (to 2.65kohm) and R2 (to 26.5kohm) i cannot get the ECG signal
Before chaged the value, the signal very small after i pass through the notch filter, why??) i am using the formula : 1/2*pi*f*c to change the value for LPF.. Any mistake in the calculation??

Em.. i also want to change the previous circuit (low pass filter part) to butterworth filter using sallen key circuit for improve my circuit performance.. But i dunno how to what value should i put.. Can u help me put the value?? i want set the frequency at 60 Hz and 120 Hz..

The last question is the connect to replace the LPF part is correct?? i have upload the circuit below..

Does your ECG signal have a 60Hz component to it (not noise but actual) ?
Be sure you do not filter part of the signal you need.

And hows come the inamp is not rejecting all the 60Hz? Its CMRR should be fantastic at 60Hz.

Also the equation you used, I have nto figured out if it is correct or not for your circuit but in any case, keep in mind that these pole frequencies are actually 3dB points. The filter has slope on both sides of the pole. In otherwords, a 60Hz LPF for example, actually begins rolling off down at 6Hz..
 
Hi Kingkong,
Your hum pickup is caused by poor shielding of the cable, and as said before, the shield should be driven from another opamp. See the inamp's datasheet.

Your original lowpass filter is just two cascaded RC filters so its cutoff is very slow and droopy. With your new resistors of 2.65K and 26.5K, its response at 60Hz is -6dB, which is half the voltage. Not much difference. Its slow and droopy response even cuts 6Hz a fair amount, so your 15Hz to 30Hz ECG signal is also being cut quite a lot.
Even if you use a 2-pole Sallen and Key lowpass filter, 60Hz won't be cut very much but your ECG signal will still be cut.

The Q of your notch filter is probably much too low, so it is also cutting your ECG signal. Get rid of the notch filter, it won't reduce the harmonics of 60Hz anyway.

I suggest that you use a switched-capacitor Butterworth lowpass filter IC, I used a 4-pole National one to filter all the harmonics from my sine-wave gen, but it isn't made anymore. Maxim make some good ones, even with a built-in oscillator. With a cutoff frequency of 30Hz, a Butterworth 4-pole filter will cut 60Hz 24dB, which is 1/16th of the voltage. Harmonics will be cut much more. The 15Hz to 30Hz ECG signal will barely be affected.

Hi Optikon,
The inamp has a gain of umpteen-thousands so its CMRR is probably nearly the same, and the probes will pickup some unbalanced hum anyway. It needs good shielding and filtering.
 
1. You have pins 1 and 3 swapped.
2. The inverting input should connect to the output, not to GND.

At what frequency do you want to set the -3dB corner, and why? Are you planning to keep the notch filter?

I, like the others, suspect that you still have not properly connected the shield on the cable, as shown in the schematic.
 
Actually in the output of filter is just sin waveform.. After the signal pass the notch filter i will able to see a little bit ECG waveform..

The Q of your notch filter is probably much too low, so it is also cutting your ECG signal. Get rid of the notch filter, it won't reduce the harmonics of 60Hz anyway.
The Q of filter is low so i think i will put it up.. What walue ar u suggest audioguru??

Your hum pickup is caused by poor shielding of the cable, and as said before, the shield should be driven from another opamp. See the inamp's datasheet.

I, like the others, suspect that you still have not properly connected the shield on the cable, as shown in the schematic

i already follow what the datasheet mention and add the op-amp already.. But still the same result..

1. You have pins 1 and 3 swapped.
2. The inverting input should connect to the output, not to GND.

Ron H.. Which part u mention?? Can you point it out??


At what frequency do you want to set the -3dB corner, and why?

The freuqency is 60Hz and want try to remove the above frequency...




[/quote]
 
See revised schematic below.
A 2 pole Butterworth has a slope of -12dB/octave above the corner frequency. If you want to reject 60Hz, you will have to set the corner below that. I think someone else pointed out that a corner frequency of 15Hz will attenuate 60Hz by 24dB, which is 1/16 of the voltage at the filter input.
 

Attachments

  • hardware11_200.jpg
    hardware11_200.jpg
    37.3 KB · Views: 926
A low pass filter to pass 30 Hz and attenuate 60 Hz will have to have many poles. This 2 pole Chebychev 0.1 dB low pass illustrates the problem. The cutoff frequency is 35 Hz but 60 Hz is not down much. A 60 Hz notch might be better.
 

Attachments

  • cheby_low_pass.jpg
    cheby_low_pass.jpg
    434 KB · Views: 928
Russlk said:
A low pass filter to pass 30 Hz and attenuate 60 Hz will have to have many poles. This 2 pole Chebychev 0.1 dB low pass illustrates the problem. The cutoff frequency is 35 Hz but 60 Hz is not down much. A 60 Hz notch might be better.

Thats a good job, is it printed and then scanned?
You can save time by print-screen in windoze..
Is that switchercad? I think it has graphic output option.
Seems like alot of work to scan. They never make it easy eh?
It always seems like a lot of monkeying around to get graphics
output & right size, resolution etc...
 
As you can see, a 2-pole filter isn't good enough. A notch filter doesn't filter the harmonics.
Maxim-ic has two 8-pole (called 8th-order) switched-capacitor Butterworth lowpass ICs: MAX291 and MAX7480. It can be set for -3dB at 25Hz to 30Hz by a 2.5KHz to 3KHz variable-frequency external clock (Cmos-555). 60Hz will be down 60dB (1/1000 of the voltage). Harmonics and noise will be down much more. An RC filter at its output will stop aliasing, and an RC filter at its output attenuates its small clock leakage.
 
I agree that a 2 pole filter at 30Hz prpbably isn't good enough, but there is something wrong with Russ' plot. It should be 3dB down at 30Hz, but is actually slightly peaked at that freq. Here is my sim of a 0.1dB, 30Hz Chebyshev. Not good, but it is down 3dB at 30Hz, and 12dB at 60Hz, pretty close to theory.
I got the component values from **broken link removed**. I selected one of their op amps at random in order to get component values, but substituted the SwitcherCAD behavioral op amp for the sim. At these frequencies, almost any op amp should work.
 

Attachments

  • cheby_schematic.gif
    cheby_schematic.gif
    4.5 KB · Views: 916
  • cheby_response.gif
    cheby_response.gif
    15.6 KB · Views: 933
Hi Ron,
Kingkong's filter seems to cutoff at about 65Hz by mistake. Even your 30Hz cutoff filter is down only 13dB at 60Hz, which won't show much of a reduction.
Try plotting the response of an 8-pole switched-capacitor Butterworth LPF. On a plot it will probably look like a vertical line, truly a "brick-wall"!

I wish that National didn't discontinue their LMF40, 4th-order switched-capacitor Butterworth LPF with built-in oscillator, all in only 8 pins. Maybe I was the only person who bought them. It was a beauty. I cascaded two for very good attenuation of my sine-gen's harmonics. It began with a very blocky-looking 10 steps from a 4018 (very stable amplitude), and was only about 0.01% distortion after filtering. I tried to sweep it, but my 4046 PPL had frequency jitter.
 
Hi Ron,
Kingkong's filter seems to cutoff at about 65Hz by mistake. Even your 30Hz cutoff filter is down only 13dB at 60Hz, which won't show much of a reduction.
Pretty much what I said.
Try plotting the response of an 8-pole switched-capacitor Butterworth LPF. On a plot it will probably look like a vertical line, truly a "brick-wall"!
Keep in mind that an IIR brick-wall filter will have terrible transient response if there is significant signal energy at and above the cutoff frequency, due to group delay and Gibb's phenomenon. Both of these potential problems could be circumvented by using a higher resolution A/D and doing the filter in software or DSP, where you could use an FIR filter. FIR filters are difficult to implement in the analog domain, especially at these frequencies.
 
Hi Ron,
Good point about transient response. I don't know the edge speed of a raw electrical heartpulse, the ones that I've seen are already filtered. The risetime is probably a lot faster than 1/2 of a 30 Hz cycle so an 8-pole Butterworth filter will ring somewhat. Can you please sim its ringing for us?
 
Ron H said:
Hi Ron,
Kingkong's filter seems to cutoff at about 65Hz by mistake. Even your 30Hz cutoff filter is down only 13dB at 60Hz, which won't show much of a reduction.
Pretty much what I said.
Try plotting the response of an 8-pole switched-capacitor Butterworth LPF. On a plot it will probably look like a vertical line, truly a "brick-wall"!
Keep in mind that an IIR brick-wall filter will have terrible transient response if there is significant signal energy at and above the cutoff frequency, due to group delay and Gibb's phenomenon. Both of these potential problems could be circumvented by using a higher resolution A/D and doing the filter in software or DSP, where you could use an FIR filter. FIR filters are difficult to implement in the analog domain, especially at these frequencies.


I agree this may very well be better suited to digital filtering techniques. But don't you think some kind of analog processing should be done to get clean up the signal and make sure it is out of the noise floor.?

How does Gibbs phenomena relate to transient response? (In terms of slowing it down presumably)??
 
I think we're all guessing about the nature of the problem, and I think it is due to improper shielding and/or improper common mode feedback, but there could very well be some pre-filtering still required to remove EMI-related noise.
As you may know, Gibbs phenomenon is caused by the abrupt truncation of a Fourier series, and is best demonstrated by a square wave, which we know is made up of the fundamental and odd harmonics (all sinusoids by definition). The amplitude of the Nth harmonic is 1/Nth the amplitude of the fundamental. I am posting an example where the series is truncated after the 7th harmonic, just as an example. Notice the symmetrical ringing. Of course, an IIR filter will also add a lot of group delay near cutoff, causing all the ringing to be after the transitions.
Even if the signal is not a square wave, Gibbs phenomenon will be present in some form if there are significant harmonics that are abruptly attenuated (as in a brick-wall filter). Group delay is probably a much worse problem, and can be compensated for to some degree with allpass networks, but the solution is unwieldy.
 

Attachments

  • gibbs.gif
    gibbs.gif
    7.9 KB · Views: 820
  • fourier.gif
    fourier.gif
    4.8 KB · Views: 813
Hi Ron,
Yeah, I count 7 little sine-waves. It doesn't look nearly as bad as I thought. I suppose that its edges will be rounded instead of peaky if the signal is truncated after an even-count harmonic.
 
audioguru said:
Hi Ron,
Yeah, I count 7 little sine-waves. It doesn't look nearly as bad as I thought. I suppose that its edges will be rounded instead of peaky if the signal is truncated after an even-count harmonic.
Well, a true square wave (50% duty cycle) has no even harmonics. It would be an interesting experiment to try something rich in even harmonics.
 
A heartbeat signal isn't square-wave, it is uni-directional pulses (unless you just finished running a marathon). Lotsa even harmonics.
So I think that an 8-pole filter would round the edges of those pulses, with some ringing at the top of each pulse and following each pulse. It will look a lot better than a signal that is buried in hum and its harmonics.

One probe on one side of your body. The other probe on the other side. If one side of you and its probe is closer to an interference-producing mains field than the other (quite likely), the interference isn't common-mode and will need filtering.
 
audioguru said:
A heartbeat signal isn't square-wave, it is uni-directional pulses (unless you just finished running a marathon). Lotsa even harmonics.
So I think that an 8-pole filter would round the edges of those pulses, with some ringing at the top of each pulse and following each pulse. It will look a lot better than a signal that is buried in hum and its harmonics.

One probe on one side of your body. The other probe on the other side. If one side of you and its probe is closer to an interference-producing mains field than the other (quite likely), the interference isn't common-mode and will need filtering.

RON H: That was a nice example of Gibbs pehnomenon, Thanks. I am aware of the the theoretical part of it. I think though this filtering problem is more of a distortion question rather than a transient response question??

Audioguru; While one side might be closer and pickup "more" of the signal, it still will exist on the other side and create a common-mode situation yes?

Has the original author just moved on to other things?..
 
RON H: That was a nice example of Gibbs pehnomenon, Thanks. I am aware of the the theoretical part of it. I think though this filtering problem is more of a distortion question rather than a transient response question??
Do you mean harmonic distortion, such as that caused by nonlinear amplifiers? I can't see a difference between transient response and accompanying waveform distortion.
I ran a typical EKG pulse (1v pk) with 60Hz common mode (2v p-p) added to it through an 8 pole Butterworth with Fc=30Hz. It looks pretty darned good. See below. I think Audioguru is spot on.
 

Attachments

  • in_out.gif
    in_out.gif
    5.7 KB · Views: 426
  • sig_cm.gif
    sig_cm.gif
    8.2 KB · Views: 397
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top