How to optimize my notch filter ?

Posted on 2011-10-28
Last Modified: 2012-05-12
Hello Guys,

I need to design and build a notch filter to remove the 50 Hz main electricity before outputting my ECG (ElectroCardioGraphy signal) on an oscilloscope.

I used this source to build one

I'm using the LF351 op-amp because it's got high noise impedance (am I right in that ?)

I've attached screenshots of my circuit, and a bode plot and all. Please have a look at them.

The question is, how can I optimize my notch filter ? how can I make signals of 40 and 60 less attenuated (since I only want 50 to be attenuated to zero) ? How can I make it more accurate basically ? Please feel free to suggest :D

 notchfilter notchFilter-ac-analysis-linear notchfilter-bodeplot
Question by:adkry
    LVL 26

    Accepted Solution

    This is the sort of performance you can expect from a simple filter.

    You should try simulating the Twin-T Notch Filter from the link you posted.
    The adjustable might help.

    If you need a narrow notch with deep sides, you will have to build additional filter stages
    and align them properly.

    You can never build a perfect filter.  The question, as always, is how good a filter do you need?
    LVL 26

    Expert Comment

    >>  The adjustable Q might help.
    LVL 82

    Assisted Solution

    by:Dave Baldwin
    The signal output should be taken directly from the opamp output at pin 6.  Connecting the scope to the junction of C2 and R4 unbalances the filter.  The Twin-T filter in the second picture on that page is a better choice for a notch filter.  Precision parts will help it work better too.  Component variations will make it less precise when built than your simulation will show.
    LVL 20

    Assisted Solution

    Instead of optimizing the present circuit maybe is good to make another one.
    To solve your request you have to have a high Q filter and you can read some info here:

    you can use Multisim to simulate before you implement and also to compare with yours

    Author Comment


    Thanks so much for your help so far. I did simulate the 2nd diagram and it gave me a much much better bode plot, I've attached the circuit diagram and outputs here.

    Question is, what range should the potentiometer be within ? the simple requirement is to remove noise from the mains electricity and keep the rest of the signal untouched. I'm still gonna do an FFT, but for the time being, I simulated with Q = 98, Q = 99 and Q = 100 and I've attached the 3 responses here. 99% seems the best, and 50 Hz does go down to zero, but there is a major problem, when my signal generator inputs 100 Hz for example, then I change the input to 50 Hz, it takes a lot of time to go down to zero, and if I then change it to 100 Hz, it still takes a lot of time to go back to full gain. anything I can change to keep that need bode plot but have a much much faster reponse to change in signal ? Will it actually affect me, i.e in simulation I change the signal from 50 Hz to 100 Hz, but in reality, both frequencies will be present in the same signal, will the slow response affect me in reality ?


    Thanks so much for your amazing tips and suggestions. Don Loncaster's "Active Filter Cookbook" is a great book by the way. Could you please explain why the signal output should be take from pin 6 and not after the resistor/capacitor junction ? I will have to take the output from the resistor/capacitor junction to input it to another filter maybe, so I might as well connect the oscilloscope to that output not to pin 6, did you understand what I want to tell you ? Also please explain what you meant by "Precision parts will help it work better too" ??? are you talking about the potentiometer ?


    Thanks so much for your wonderful links, I am using MultiSim already, it'll take me some time to check your links, in the mean time if you have any suggestions please do suggest.

    My final circuit looks as follows (again the problem is the notch filter has a very slow response):

    Please Help, thank you
    LVL 82

    Assisted Solution

    by:Dave Baldwin
    Regards the Twin-T filter, high Q means long settling times.  Make the Q as low as you can and still get the filtering you need.  You do not need absolute zero, real parts won't do that anyway.

    In the previous circuit, the junction of C2 and R4 provides a specific RC time constant and hooking it up to the scope changes it.  The much lower output impedance of the op amp will be much less affected by the loading of the scope.

    Precision parts are those with low tolerances.  Tolerance is the variation from the intended value and all parts vary in value.  Standard resistors are usually 5% tolerance and capacitors are 10% to 25% depending on the intended use.  When I have designed audio filters, I usually specify 1% tolerance for the resistors and 2% tolerance for the capacitors.  That allows you to make the pot for the final trim as small as you can.  Low tolerance parts usually have lower drift due to temperature than standard parts.

    Your simulation software should have a setting for checking the performance of your circuit with varying component values due to the component tolerance.  You should check that in case you specified something that wouldn't really work when the values are a few percent off.  And the last step is to actually build the circuit and measure the performance.
    LVL 82

    Assisted Solution

    by:Dave Baldwin
    In 'real' circuit designs, the next step is to pick the closest capacitor value you can actually buy.  Precision resistors are easier to come by than odd value caps.  It is not uncommon in filter circuits like the Twin-T to double up on the capacitors to be able to use the sum of two in parallel to get the values you want and/or trim the response of the circuit.

    Author Comment

    d-glitch, DaveBaldwin, and viki2000

    Can you guys have a look at my new question please ?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Whether you believe the “gig economy,” as it has been dubbed, is the next big economic paradigm shift ( or an overstated trend (…
    Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
    The Bounty Board allows you to request an article or video on any technical topic, or fulfill a bounty request to earn points. Watch this video to learn how to use the Bounty Board to get the content you want, earn points, and browse submitted bount…
    Articles on a wide range of technology and professional topics are available on Experts Exchange. These resources are written by members, for members, and can be written about any topic you feel passionate about. Learn how to best write an article t…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now