4th order filter with a single opamp

Started by Rob Strand, January 14, 2021, 05:52:44 AM

Previous topic - Next topic

Rob Strand

[tag:  4th order butterworth low pass filter with one op amp]

More a toy or curiosity than anything else.

The idea is to get a 4th order filter using only a single opamp.   The third order filter with a single opamp is quite well known but the 4th order isn't.   The 3rd order case usually has equal part resistor values (see the Boss CE2 for example).   The idea of a 4th order filter with a single opamp isn't new but some of the solutions in the literature aren't that great.    Normally 4th order filters are done by cascading two second order filters, say Sallen and Keys filters, and that requires two opamps.

One exmaple from 1973, which appears in Doug-Self's crossover book,  uses equal capacitors but the gain of the opamp isn't zero unity.    Generally the equal cap value filters are quite sensitive to the part values (and amplifier gain).   

A circuit with equal resistor values appeared in Elektor/Electuur 1993.    As far as I know the published circuit was for a Bessel 4th order filter.   The Bessel filters have a very slow roll-off which more or less ensures you can find cap values.   The article implied a Butterworth 4th order filter was possible however from my calculations it does not seem possible to find cap values for the equal resistor value case.

Just for fun I thought I would try to come-up some 4th order designs using a single opamp wired as a buffer.  The main point is there are *many* possible designs even when we restrict ourselves to a Butterworth filter.   Some of those designs aren't great because response is very dependent on the gain of the buffer.  (I don't want to go into the details but basically the filter response doesn't match the design if the opamp bandwidth is low and the filter cut-off is high.)    The solution to this problem is to taper the resistor values.   This also increases the ability find cap values for different filters.

So after about 1000 lines of C code with a lot of math machinery under the hood I managed to get something which generates good solutions.   As an example I've put up a 4th order Butterworth filter.  Please read the notes about what the 'E' things are, *as a whole* they are opamp buffers.  The +/- inputs are *not* opamp pins.  The + pin is the input to the buffer.



The sensitivity of the filter to the part values is in the ball-park of the two cascaded 2nd order Sallen and Key filters.   (This sensitivity is the effect of part tolerances on the filter response.)

The sensitivity of the filter to the buffer gain is much worse even though the design I've given tried to reduce this effect.   If you stick to an opamp buffer it should not be a problem at all.  However if you take the part values and use them with a transistor buffer it's likely the part values will need to be tweaked to get the response to match.   I might put up another design more suitable for transistor buffers.  In reality you are much better off sticking to opamp buffers.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

composition4

Thanks Rob, this is great. I'll be running this through my circuit sim and seeing if I can work it into a cab simulator I'm designing - I need the steep 4th order rolloff but one opamp section seems far better than two.  Can I swap caps and resistors for high pass?

Rob Strand

QuoteThanks Rob, this is great. I'll be running this through my circuit sim and seeing if I can work it into a cab simulator I'm designing - I need the steep 4th order rolloff but one opamp section seems far better than two.  Can I swap caps and resistors for high pass?

You can do the RC <---> CR  swap transformation to convert a 4th order low-pass into a 4th order high-pass.   

There's also a similar trick of putting a second order high-pass and second order low-pass in the one opamp.   You can see it in this paper.  The idea is also used in the Eden bass amplifiers and some other guitar stuff.

https://orbit.dtu.dk/files/3813126/Gaunholt.pdf

I strongly suspect it is better to combine a 2nd-order HPF and a 2nd-order LPF into the one opamp then use another opamp for a 2nd-order LPF to make-up the 4th-order.   The reason is the HPF is at low frequencies and the LPF is at high frequencies so the two interfere with each other less.   In theory you could put the HPF and the two LPFs in the one opamp.  I haven't tried that yet even though it's probably only one hour to code-up.   It could take half a day to work out how to massage the results to get "good" filters.  It's on my list though!  One problem with single opamp high order filters is the need to taper the resistors.   That means the circuit ends up with a very large spread in the cap values (and resistor values).
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ElectricDruid

I first saw a single op-amp 4th order filter in the Maplin magazine back in the day. It was part of the "Maplin ADA echo", a digital delay project, based on separate ADC and DAC with separate RAM and glue logic and whathaveyou. Proper old school. The filter was used as an anti aliasing filter at the input, iirc.

I never built the ADA echo, but I did use that filter quite a few times here and there. I didn't know any filter theory, but I'd realised that I could simply scale all the cap or resistor values to get different cutoffs, so that's what I used to do. It turns out I even have a graphic of it online:

 

I did a freq plot too:

https://www.electricdruid.net/images/FrequencyResponse.png

Rob Strand

#4
QuoteI first saw a single op-amp 4th order filter in the Maplin magazine back in the day.
It's definitely not a new idea.   I haven't seen that one before.   There's an EHX pedal that has a 4th-order filter as well.

QuoteI never built the ADA echo, but I did use that filter quite a few times here and there. I didn't know any filter theory, but I'd realised that I could simply scale all the cap or resistor values to get different cutoffs, so that's what I used to do. It turns out I even have a graphic of it online:


I did a freq plot too:
I'll plug it into the sim and see how it goes.   Since the R's are equal the roll-off probably won't be as fast as the Butterworth. 
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Vivek

Can these be made with variable cutoff ?

garcho

QuoteCan these be made with variable cutoff ?

The reason "control-voltage" filters like LM13700 stuff, or dedicated VCF ICs, use voltage to dial in the cutoff, instead of something easy like a pot, is because it's really hard to make a higher order filter variable with potentiometers/cap switching. The resistors and caps values' ratios are complex, a single pot or dual gang won't do. Even a simple multiple feedback filter will have big Q changes and other effects if you stick a pot in there and start twiddling.
  • SUPPORTER
"...and weird on top!"

Rob Strand

#7
Well the things you find.   I plugged in the ADA values and I had this feeling it was like a Bessel, so I plugged in the Elektuur 1993 filter.    After scaling the cut-off to 1kHz, the ADA and Electuur 1993 are pretty much identical.

You can see the Bessel roll-off is much slower than the Butterworth.



Quote
Can these be made with variable cutoff ?
In the sense of varying the cut-off and keeping the shape of the response constant you would need a quad-gang pot.   Not very practical although I think I saw one in a product once.   Also you would need to use the slower roll-off filters with the equal resistor values.   Another angle is to vary only two resistors, that will change the response but it could end-up a wonky response.

Edit:
Here's the EHX pedal, see smoothing filter in the middle,
http://experimentalistsanonymous.com/diy/Schematics/Guitar%20Synth%20and%20Misc%20Signal%20Shapers/EHX%20Bass%20Microsynth.pdf
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Digital Larry

I'm really blowing smoke here but isn't a Moog filter basically a passive filter with some gain and feedback around it?  Seems like you could get a 4th order thing going on there, although "what" response it would have, I have no idea.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

ElectricDruid

#9
Quote from: Rob Strand on January 14, 2021, 09:16:49 AM
I'll plug it into the sim and see how it goes.   Since the R's are equal the roll-off probably won't be as fast as the Butterworth.

Yes, exactly. That's pretty much it. It approaches 24dB/oct, but doesn't get there fast, so the response isn't that great. Still, for one op-amp,  it's hard to complain ;)

Quote from: Rob Strand on January 14, 2021, 09:57:50 AM
Well the things you find.   I plugged in the ADA values and I had this feeling it was like a Bessel, so I plugged in the Elektuur 1993 filter.    After scaling the cut-off to 1kHz, the ADA and Electuur 1993 are pretty much identical.
Somehow that doesn't come as a massive surprise. I think things like this get discovered once and re-used lots of times, especially in the era before it was easy to do the calculations yourself on some bit of software you just downloaded off the interwebz. Back then, you found something someone had published, and tweaked it.

Quote
Can these be made with variable cutoff ?

I agree with Rob. If you've got a "quad pot" and can vary the all resistors at once, it's relatively easy to make it variable. Since such things aren't common, it's hard. It could be done with PWM and analog switches, like some phasers. But then the question becomes, "why?". And that leads me onto the final point - why not do four single-pole filters instead?:

Quote from: Digital Larry on January 14, 2021, 01:47:05 PM
I'm really blowing smoke here but isn't a Moog filter basically a passive filter with some gain and feedback around it?  Seems like you could get a 4th order thing going on there, although "what" response it would have, I have no idea.

Yes, that's pretty much it. It's not "passive" exactly, but the Moog Filter, or many other synth filters are basically four single-pole sections bolted together, with some global feedback wrapped around them to provide resonance. This simplifies the problem enormously, since now you're not trying to solve some hideous fourth-order equation, but just a simple 1st-order thing instead. If you can vary the resistance (or something equivalent to the resistance, like the current flowing into a capacitor) then you have control over an RC stage and you can build a multi-stage filter. Hence Moog transistor stages in the days before OTAs, or the OTA-C filters once OTAs had been invented. Here's an excellent page giving an overview of the evolution in Roland's synth filters:

http://www.florian-anwander.de/roland_filters/

The responses are fourth-order, but the interesting stuff happens with the way the poles shift with increasing resonance in different topologies. This and the different distortion behaviours is what give different synth filters their character. It's a fascinating field and there's a lot of depth to dive into!



PRR

The Elektor and Maplin seem to be "the same" topology. They differ in taper or equal-value.



  • SUPPORTER


Rob Strand

#12
QuoteStill, for one op-amp,  it's hard to complain ;)
Very true.

QuoteSomehow that doesn't come as a massive surprise. I think things like this get discovered once and re-used lots of times, especially in the era before it was easy to do the calculations yourself on some bit of software you just downloaded off the interwebz. Back then, you found something someone had published, and tweaked it.
Yes, in the old days most people worked off tabulated results and in this case very limited results to choose from in the literature.

Quote
The Elektor and Maplin seem to be "the same" topology. They differ in taper or equal-value.
It's not a new idea, the earliest I've seem is 1973, and that's made it to Doug Self's book.   It's basically taking two Sallen and Key circuits and pulling the one of the opamps out.   

You can repeat the idea for 5th order, 6th order and up but beyond 6th order the performance of the filter might not be so good in terms sensitivity.    The span of capacitance gets out of hand, the largest cap could be 100nF but the smallest could be 10pF.  With a 10pF the opamp and  PCB capacitance starts to affect the tolerances.

Quotehttps://www.researchgate.net/figure/Fourth-order-LP-filter-with-single-opamp-and-unity-gain_fig1_4129086
That paper looks very interesting.  I haven't come across that one before.  The authors have a number of papers on the subject.

I'm not presenting a new idea.  All I'm doing is presenting a useful result.    For general work the Butterworth filters are very usable and there's no results for this case in the literature.  The problem with the single opamp 4th order filter is the equations are large and not easy to solve.   The solution (if it exists) isn't unique so then you have to work out which solutions are the good one.   Getting a good solution is important.  For example one filter I looked at matched the Butterworth response exactly by when the buffer gain shifted 5% the response deviation was 13dB to 14dB, almost beyond belief.   A filter made in the usual way by cascading two second orders will only deviate about 2dB.

FWIW, you can make bad second order S&K filters as well.  If the second resistor is small the sensitivity to the buffer gain goes up.   The fact we normally choose equal resistors hides this problem.    If we make the second resistor larger it can reduce the sensitivity to the gain.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

noisette

Hey, nice.
I have made HP&LP VCFs from that single opamp topology.

I used Vactrols in an equal value scenario,
...into unity gain opamp buffer and a second variable gain amp in the feedback path.
or
...into unity gain opamp buffer and a second fb path all around the whole filter into the input buffer, I´ll add the schematics, it sounds very cool btw!

(R18 is not essential, it just fattens the low end, some resistor values in the exp.conv. are not correct!)

"Those who believe in telekinetics, raise my hand."
― Kurt Vonnegut

amptramp

Did TI ever offer the switched-capacitor filters from their acquisition of National Semiconductor?  They had 8th order lowpass filters among their offerings and the centre frequency was controlled by the clock frequency.  If they are not still available, maybe we could cobble up some variable filters using CD4066 analog switches along with op amps and capacitors.

Rob Strand

QuoteDid TI ever offer the switched-capacitor filters from their acquisition of National Semiconductor? 
IIRC, LT also had some offerings.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ElectricDruid

Quote from: amptramp on January 15, 2021, 10:23:38 AM
Did TI ever offer the switched-capacitor filters from their acquisition of National Semiconductor?  They had 8th order lowpass filters among their offerings and the centre frequency was controlled by the clock frequency.  If they are not still available, maybe we could cobble up some variable filters using CD4066 analog switches along with op amps and capacitors.

If you start going with PWM switched-cap filters, then obviously having four, five, six, seven, eight, identical variable resistors is no longer a problem, so these things become possible.
The trick then is choosing a design where the roll-off is good and the sensitivity to different R values is low. It's possible, I'm sure, but it's beyond my maths skills. That's the point where good ol' fashioned "trial and error" (with the emphasis on "error") becomes my friend :)

Tom