# What is wrong with this butterworth filter, how can it be improved?

I have designed a 6th order butterworth low pass filter with 20KHz cut off frequency using Sallen Key topology (thanks Andy Aka). The filter is behaving as expected with the cut off frequency and roll-off however, several order of magnitude above the cut off frequency something happens with the frequency response that I do not expect.

Why does the attenuation reduce 110KHz and then become stable after 1MHz?

EDIT: Today I did some more simulation. I used 2 nonideal opamps and it gave me similar result. Then I used what I consider to be ideal op amp in LTSpice. The symbol is called "opamp" and needs a spice directive to be useable. The result is below:

I initially thought that the ideal opamp does not suffer from the problem I saw with the real op amp. It is true that it does not. However, between 0.6GHz and 0.7GHz I notice a strange behaviour. This is different from what was seen earlier.

I have scaled the values by 10. All R divded by 10 and all C multiplied by 10.

I have now scaled the values by 10 the other way, i.e make resistor bigger.

Edit II:

As requested by Guru I now have more graphs:

Plots with ideal op amp with impedance scaling; upto 10MHz limit.

Plot of the original circuit with an extra RC at the end:

Plot with the OP275 as required by the Guru:

Finally plot of the original design but with buffer in the feedback loop:

• You may find that a 7th order filter, formed of the above plus a single-pole passive R-C meets your goals better. The passive stage eliminates the dependence on the opamp output impedance. Cheap experiment anyway. (RC for -3dB around 100-200kHz) – Brian Drummond Mar 15 '16 at 12:51
• quantum231, for explaining the behaviour at app. 0.7GHz it would be helpful (a) to look into the "ideal" opamp model description (any frequency dependence?) and (b) to replace this ideal model by a voltage-controlled voltage source (VCVS) with again of app. 1E5. Different simulation results? – LvW Mar 16 '16 at 9:21

I am afraid, changing the opamp type will not help. The observed effect (less damping for rising frequencies) is the typical disadvantage of the lowpass Sallen-Key topology.

The reason is as follows: For rising frequencies the "classical" output signal from the opamp decreases (as desired) - however, at the same time there is a signal arriving at the output via the feedback capacitor (the signal bypasses the opamp). This signal produces an output voltage across the finite output impedance of the opamp (the output impedance even increases for rising frequencies). Hence, this unwanted signal dominates for high frequencies and limits the damping at a fixed value.

If you need more damping for very large frequencies the only solution is to use another filter topology (Sallen-Key/negative, multi-feedback MFB, GIC,..).

The same effect can be observed for the classical inverting Miller integrator (capacitor in the feedback path).

EDIT/COMMENT: Of course, this unwanted effect can be suppressed using another buffer amplifier within the positive feedback path (driving the feedback capacitor). However, this method requires another opamp.

EDIT2: Depending on your damping requirements - it could be sufficient to use another filter topology (MFB) for the last of the three filter stages only. As another alternative, you could add a passive RC lowpass and and a buffer stage after the third filter stage.

EDIT3: Here is a simple "trick" for improving the attenuation of the existing filter circuit in the stop band: Modify the impedance level of the parts used. For example: Increase all resistors by a factor k (for example: k=10) and reduce all capacitors by the same factor. Thus, all time constants and the whole filter respose remains unchanged, but the direct way to the opamp output now contains a larger resistors (R2, R4, R6) and a smaller capacitor. This should decrease the remaining voltages at the output for very large frequencies to a value of app. **r,out/(r,out+RX)**with RX=R2, R4, R6, respectively.

• Ok, I week try that when I get home. I have another question. Sallen Key low pass filter is considered to have a draw back of low Q. But the Butterworth filter always has Q of 0.7071. Also, equation of Q for Sallen Key has R1, R2, C1, C2 in it. Why then do people say that it suffers from low Q as if it is a problem? Certainly Q becomes very important for band pass and notch filters. – quantum231 Mar 15 '16 at 13:21
• No - in principle, you can realize each Q-value. What means "in principle"? Answer: You have to distinguish between several Sallen-Key alternatives: The unity-gain approach (your design) requires a relatively large capacitor ratio for high Q-values. That`s all and this is - perhaps - a small drawback. The situation is better for gain values of "2" or larger. General remark: It is not easy to select a certain filtrer topology and a certain alternative (wihtin the same topology) for a specific applicatiuon.It is always a trade-off between conflicting requirements (parts values, sensitivities,.) – LvW Mar 15 '16 at 13:55
• I like the idea of changing the impedance levels, that's an easy way to see that it's a finite output impedance effect. – George Herold Mar 15 '16 at 14:55

The standard Sallen-Key design assumes you use perfect opamps.

An LM324 is pretty slow as opamps go, I'm surprised it shows the filter working as well as it does.

Perform a few more simulations, changing the opamp type you use. Use a faster opamp, a slower one, and a perfect one. I don't know LTSpice specifically, but most simulators have a generic opamp that you can set the parameters of, or failing that just a voltage source block that you can set a high gain on.

What's happening is the unmodelled increasing phase shift of the amplifier is changing the ideal response of the filter components.

It's not really a good idea to try to 'predistort' the design of the Sallen-Key to compensate for the amplifier speed out to the problem frequency at 1MHz where the response lifts. Firstly, with these component values and amplifiers, the passband and transition band are correct. Secondly, the bandwidth limit of opamps is not well controlled, so may be a bit different with every new build.

There are two ways to improve the response of the filter. The first is to use faster opamps. However, this only tends to move the problem up in frequency rather than eliminate it totally. Using faster opamps than you need also causes other problems. Slow opamps let you get away with bad layout or decoupling, fast opamps punish you with instability.

The second way to handle a bump in the stopband, if the continuing deep attenuation of the stopband is important to you, is to use a low order passive 'roofing' filter, in your case cutting off around 300kHz.

EDIT well done for exploring the simulations with other amplifier choices.

1) With the ideal opamp. The passband and the transition band look pretty ideal.

What's that little wrinkle at 650MHz? Check out the amplitude, it's below the -640dB line. Now according to my sums, 64 bit reals run out of steam at 16 decimal digits ~ 320dB. I would have expected to see only rubbish and noise below -320dB. But perhaps the clue is in the fact that 640 = 2x 320. Does LTSpice use 128 bits reals? If so, I would not believe anything below -640dB, just as when programming, you would not expect an if(float==0.0) test to work consistently.

Thermal noise is at the -174dBm level. A 1kW PA has a power of +60dBm. That's a dynamic range of 234dB.

So what's going on at 650MHz? Spice doesn't/shouldn't have the precision to represent it, and the audio world cannot begin to use that apparent dynamic range. I think we can ignore it.

This illustrates both the strength and the weakness of using dB for the y axis. Strength - it allows you to represent colossal dynamic ranges compactly. Weakness - if you're not careful and keep your eye on what the figures mean, you can have your eye drawn to some irrelevant detail down in the noise.

2) With the increased impedance level.

Good catch from LvW, and his analysis that feedforward from the small capacitor was getting directly onto the output. This shows another non-ideality of opamps, their finite output impedance. The better result with the higher impedances shows that this is a contributing cause.

Here I disagree that a faster opamp would not help. Typically the output impedance of an opamp is maintained over a wider bandwidth with a faster opamp. While output impedance curves are rarely presented for low frequency LM324 type amplifiers, it's common for video class amplifiers, and they tend to be flat out to some surprisingly low frequency, then start rising at 6dB per octave, as the closed loop runs out of gain.

Of course a faster opamp doesn't cure the problem, it will still run out of a stiff output at some frequency, but it will push the problem to a higher frequency, which makes it easier for a roofing filter to handle.

Brian picked up the point that an odd order filter was beneficial because of the real pole. When you do a 3rd order Sallen-Key section, there is a real RC section at the input, which will provide a 6dB attenuation into the far stopband, independent of the opamp.

Further plot requests

a) a plot on the same graph of the original 6th order and a new 7th order filter, using LM324 with the original impedance filter components. This is to see how well a single real RC improves the 1MHz lift.

b) a plot on the same graph the curve for LM324 with the higher impedance components, and the curve for the 'ideal' opamp, only out to 10MHz. This is to see how much there is still to gain from a better opamp, having made the improvement to the impedance level.

c) my 'go to' amplifier for audio work is the OP275. LTSpice should have a model for that. It would be interesting to see LM324 vs OP275 with original impedance components on the same graph.

Layout sketches - for communication only as I can't put sketches in comments, illustrating both how the Rs and Cs are configured a third order section, and how a buffer might be put in the feedback (something I would not suggest for a real design, only for an interesting experiment)

simulate this circuit – Schematic created using CircuitLab

• Problem with your 3rd order Sallen Key is that the 3rd pole is going to be a real pole, which is not going to fit any of the poles in an even-order Butterworth filter. – The Photon Mar 15 '16 at 4:34
• Also, for OP, remember that even after you find a faster op-amp, you need to worry about parasitics...at some frequency your resistors will turn into capacitors, your capacitors will turn into inductors, etc. If you need a filter to work more than maybe 3 decades above cut-off, you need to figure out what your main parasitics are and include them in your model. – The Photon Mar 15 '16 at 4:50
• There are six poles, all complex. This supposed to be used for audio signal. – quantum231 Mar 15 '16 at 8:41
• The observed behaviour is a systematic effect that is typical for lowpass sallen-key structures. It has nothing to do with slew rate or other parasitic effects. It is the price to be paid for the simplicity of one second-order filter stage requiring 4 parts only. Ter effect disappears for ideal simulation models (zero output impedance). – LvW Mar 15 '16 at 12:16
• The attenuation of the existing filter stages can be improved by modifying the impedance level, see my detailed answer. – LvW Mar 15 '16 at 13:01