Bandpass Filter Design - Page 1
Forum section: electronics / beginners

author: Rigolon
author_rank: Regular Contributor
timestamp: April 27, 2018, 11:52:22 am
content: Hello,I've been working on a project that has 2 low pass filter (LPF) and 2 high pass filter (HPF) to make a band pass filter (BPF). I am using Sallen-key topology.My question is: If sallen-key is a second order filter, when using 2 low pass it's considered a 4th order low pass filter and the same for the high pass. So my band pass filter, which has a 4th order LPF and a 4th order HPF, is a 4th order BPF or an 8th order?If it's an 8th order the transfer function is the product of each filter transfer function correct? [Hlp1(s)*Hlp2(s)*Hhp1(s)*Hhp2(s)]But what is the transfer function if the filter is considered to be 4th order?And for last, should I use buffer stages between each filter?

author: Benta
author_rank: Super Contributor
timestamp: April 27, 2018, 12:51:52 pm
content: First, don't use Sallen-Key, there are better filters, eg, MFB.To your second question: if you have two identical second-order filters cascaded, it's a 4th order filter with a second-order squared response. This is probably not what you want.A true 4th order filter will have two different sets of complex conjugate poles. These poles will depend on your desired response, eg, Butterworth, Bessel etc.The low-pass/high-pass combo you are describing would normally not be called an 8th order filter, as the cutoff frequencies are different.No reason to use buffers if your opamps are good.

author: Wimberleytech
author_rank: Super Contributor
timestamp: April 27, 2018, 01:10:00 pm
content: Go here:http://www.analog.com/designtools/en/filterwizard/When I was first introduced to filter design, it was all tables. Active filters of anything other than 2nd order were implemented with gyrators or leap frog. Now, somebody has done the work for you.

author: schmitt trigger
author_rank: Super Contributor
timestamp: April 27, 2018, 01:41:15 pm
content: Either that, or solve polynomials in the s-plane.

author: Rigolon
author_rank: Regular Contributor
timestamp: April 27, 2018, 05:02:26 pm
content: Thanks for everyone's answer.I will try using MFB, made some research and saw that it's better than sallen-key for LPF and BPF. Thx for the tip.So a true 4th order filter is a filter with same cutoff frequency but different poles (i.e. different capacitors and resistors combination for each stage)?Since I want to go for linear phase response I guess my best choice should Bessel right?@WimberleytechThx for the link I've been using some similar tools, but my goal is to also learn the math, the problem is that I haven't done this "more advanced" type of math in a few years, so I'm a little rusty.@Schimitt TriggerAs said previously solving the polynomials is what I want to do, but I'm making a lot of mistakes since I have to remember a lot from my classes

author: Benta
author_rank: Super Contributor
timestamp: April 27, 2018, 08:10:13 pm
content: Quote from: Rigolon on April 27, 2018, 05:02:26 pmLast Q first: yes, the Bessel transfer function is optimized for linear phase... at the cost of amplitude rolloff.Finding the poles for a Bessel filter is not trivial, but if you search there are tables available.Yes, your 2nd order filter sections will be different.

author: Rigolon
author_rank: Regular Contributor
timestamp: April 30, 2018, 11:34:42 am
content: Some few more questions:Can I use different topology to design a n order filter (e.g. LP Sallen-key and an integrator amplifier to make a 3rd order)?I may be very wrong here, but from what I researched the type of filter I want is determined by the Q factor (Butterwhorth it's 0.707), not sure what is the Q for bessel yet, but I guess 0.58?But using this filter wizard:http://www.beis.de/Elektronik/Filter/ActiveLPFilter.html) I saw that when designing an even order filter the Q should the product of the Q from the second order filters is close to 0.707 and when designing an odd order filter the Q product is around 1, why is that?(At least for butterworth)Any good links or papers I can read on designing Bessel Filters?

author: Wimberleytech
author_rank: Super Contributor
timestamp: April 30, 2018, 01:42:34 pm
content: Quote from: Rigolon on April 30, 2018, 11:34:42 amIf you mean by 'integrator" an RC added to a 2nd order Sallen-Key, then yes you can but there are better topologies.QuoteIn terms of filters, Q is only meaningful for a second-order denominator. For higher-order filters, that is the wrong way to think about the problem.Bessel, Butterworth, Chebyshev, eliptic, etc, are all approximation functions derived based on certain criteria (e.g., maximally flat for Butterworth). It is difficult to know what you really want to do, but now I am guessing you want to be able to derive the Bessel function from first principles. Otherwise, you would go find it published in a gazillion different locations and just use it. I have a few books on my shelf that cover this stuff, but it is the "dusty shelf" of books written before there were calculators and likely all of the authors are dead.In the IIR world, the LP filter design process is more or less something like this.Define pass band and stop band parametersPick the approximation that meets these parameters (Butterworth, Cheby Type I, Cheby Type II...)Get the polynomial from a referenceBreak it into second-order polynomials (this can be tricky, see below)Pick a second-order active filter topology and associated design equations for the componentsThe way you generated the second-order polynomials will impact component spread, noise, dynamic range, sensitivity.In this process, if you need BP or HP, you do what is called a "frequency transformation" to convert from e.g., LP to BPThe book I suggest is "Modern Filter Design Active RC and Switched Capacitor" by Ghausi and Laker

author: Rigolon
author_rank: Regular Contributor
timestamp: April 30, 2018, 03:00:48 pm
content: Quote from: Wimberleytech on April 30, 2018, 01:42:34 pmI asked because I saw in a circuit(not sure where this circuit is from) but it has a integrator amplifier followed by a sallen-key, followed by a differentiator amplifier and for last a simple active rc filter. Not sure why use 3 OpAmps for a 1st order but it's how the circuit on the board is.QuoteThx.IIR Filter are digital filters right? I actually need an analog filter.

author: Wimberleytech
author_rank: Super Contributor
timestamp: April 30, 2018, 03:05:29 pm
content: Quote from: Rigolon on April 30, 2018, 03:00:48 pm

author: Rigolon
author_rank: Regular Contributor
timestamp: April 30, 2018, 04:08:11 pm
content: I see, thx.Have a lot of thing to google for now.hahahaha

author: Mr. Scram
author_rank: Super Contributor
timestamp: April 30, 2018, 04:33:30 pm
content: Quote from: Wimberleytech on April 27, 2018, 01:10:00 pmThanks, that's actually helpful.

author: Rigolon
author_rank: Regular Contributor
timestamp: April 30, 2018, 07:14:47 pm
content: So I've been having fun with some filters and trying to understand the math and all.I tried with a Sallen-key that i never saw before. @Wimberleytech actually you were the one that helped me see that it was a Sallen-key, from a old post of mine.The only thing that I found about something like that was this:http://www.ti.com/lit/an/sbaa237/sbaa237.pdfBut in my case the resistor wasn't to compensate the GBW.Circuit Attached. And I got down to the transfer function (I guess):H(s)=(s*R3*C1 + 1)/[s2*R1*R2*C1*C2 + s*(R1*C1+R2*C1+R3*C1) +1]I got stuck on this point, how do I find the corner frequency of this function? I never saw a LPF with a zero.I simulated and plotted and it's in fact a LPF, and R3 has influence on fc. It's just that I don't see how to go on with the math.From what I found on my old notes from my classes i am using this function as general function for 2nd order filters:H(s) = N(s)/(s2/w2n+ s/Qwn+ 1]where N(s) determines the type of filter:N(s) = k; is a LPFN(s) = k*s2/w2n; is a HPFN(s) = k*s/Qwn; is a BDFN(s) = k*(1 - s2/w2n); is a notch filter

author: Wimberleytech
author_rank: Super Contributor
timestamp: April 30, 2018, 08:42:57 pm
content: The zero in the modified SK compensates for the roll off of the op amp. For an ideal opamp, the filter is still a LPF but with some peaking (depending on where the zero lies) and a first-order roll off (-20dB/decade).

author: Rigolon
author_rank: Regular Contributor
timestamp: April 30, 2018, 09:02:45 pm
content: Quote from: Wimberleytech on April 30, 2018, 08:42:57 pmI'm having trouble to understand this, the roll off shouldn't impact on the corner frequency right? If I want a better roll off I'll have to use a higher order filter, correct? For example, if I use two identical Sallen-key LPF I will have a 4th order filter (I know that it's better to not use identical filters) and have a better roll off than just 1 SK LPF.But this resistor is actually impacting on my corner frequency, I just can't find the equation for the corner frequency. All equations that I find/calculate doesn't include that resistor.

author: Wimberleytech
author_rank: Super Contributor
timestamp: April 30, 2018, 11:14:23 pm
content: Quote from: Rigolon on April 30, 2018, 09:02:45 pmIf you put an opamp in unity-gain configuration and observe its frequency response, you will see that it approximates a first-order response with a corner frequency at the unity-gain-bandwidth frequency (e.g., 1 MHz for a 741). So, an opamp is a FILTER!!So if you build a filter around an opamp, the frequency response of the amp itself comes into play. That is what the zero is compensating for in the TI article.

author: MarkF
author_rank: Super Contributor
timestamp: May 01, 2018, 01:44:53 am
content: Jumping in the middle of this conversation...Here is a passive LC Filter Design option that I've used:https://www-users.cs.york.ac.uk/~fisher/lcfilter/

author: Wimberleytech
author_rank: Super Contributor
timestamp: May 01, 2018, 01:21:22 pm
content: Quote from: MarkF on May 01, 2018, 01:44:53 amYes indeed! And how appropriate that you should post.One you have an RLC prototype, you can replace inductors and capacitors with active RC integrators using the LEAPFROG technique.RLC ladder filters are the least sensitive to component tolerance.LEAPFROG is not efficient in terms of active components (one opamp for every pole or zero). It is also difficult to troubleshoot when not working right.https://en.wikipedia.org/wiki/Leapfrog_filter

author: Benta
author_rank: Super Contributor
timestamp: May 01, 2018, 04:42:11 pm
content: Quote from: Rigolon on April 27, 2018, 05:02:26 pmJust to give you a flavour of how to work with the filter poles: the poles are always in the left side of the complex plane (except Cauer filters).For a Butterworth response, it's especially simple: all poles are equally spaced on a circle with centre at 0,0.For a second-order response they're at 135 and 225 degrees.For a third-order they're at 120, 180 and 240 degrees.For a fourth order they're at 112.5, 157.5, 202.5 and 247.5 degrees.And so on.IIRC, the Bessel and Chebychev poles are placed on an ellipse. Tables will help here.Cheers.

author: Wimberleytech
author_rank: Super Contributor
timestamp: May 01, 2018, 05:58:21 pm
content: Quote from: Benta on May 01, 2018, 04:42:11 pmVery nice explanation. I don't think you meant to imply that Cauer (aka eliptic) filters can have poles on the imaginary axis. There are zeros on the imaginary axis in Cauer filters (and Chebyshev Type II), but not poles.

author: Rigolon
author_rank: Regular Contributor
timestamp: May 02, 2018, 11:27:40 am
content: Thx Wimberleytech and Benta, it's this kind stuff that I want to learn.Another question, maybe this one is obvious:- When analyzing a circuit with several stages of filtering, can I look at each stage individually or should I just look at the Input on the first stage and the output from the last?

author: Benta
author_rank: Super Contributor
timestamp: May 02, 2018, 01:31:11 pm
content: It's much easier to extract the poles if you look at each first/second order stage separately.

author: Wimberleytech
author_rank: Super Contributor
timestamp: May 02, 2018, 01:32:15 pm
content: Quote from: Rigolon on May 02, 2018, 11:27:40 amYou can analyze each stage by itself and take the product of the impulse response of all stages to get the final transfer function IF each stage is isolated by a unity-gain buffer with infinite input impedance and zero output impedance. Does not have to be really infinite and really zero, but high compared to the other impedances in the circuit. When active biquad filters are cascaded, you have this situation because the output of each stage has essentially zero output impedance.

author: Rigolon
author_rank: Regular Contributor
timestamp: May 02, 2018, 02:49:24 pm
content: I see, If the stages are not isolated what I will have to do to get the TF?About that modified Sallen-key, I used the values that are on the circuit where I saw this kind of filter and found the poles approximately s' = - 840 and s"=-120,000. Which gives the cutoff frequencies of approximately fc' = 133.56Hz and fc" = 18,965Hz. But simulating it I got the -3dB at 12.7kHz, at 18.9kHz it's -4.3dB. It's this plausible?One more (maybe obvious) question:- When cascading filters I have to use the same corner frequency for each?

author: Wimberleytech
author_rank: Super Contributor
timestamp: May 02, 2018, 03:43:51 pm
content: Quote from: Rigolon on May 02, 2018, 02:49:24 pmYes, you will have to analyze the whole circuitQuoteshow me the circuit and post your simulation (if it is an LTSpice file)QuoteNo, see my sketch

author: Yansi
author_rank: Super Contributor
timestamp: May 02, 2018, 03:52:41 pm
content: Unless you want a Linkwitz-Riley crossover filter, that just happens to use squared butterworth response.

author: Rigolon
author_rank: Regular Contributor
timestamp: May 02, 2018, 04:26:27 pm
content: QuoteI'm more used to Proteus since I learned with it.But the image with the circuit and frequency response are attached below.In the case where fc is not the same for how do I know fc? Let's say I have a LPF with fc1 = 10kHz and another LPF with fc2 = 50kHz, the final fc it's equal to the smallest one or is there some kind of equation?

author: Benta
author_rank: Super Contributor
timestamp: May 02, 2018, 04:51:01 pm
content: Quote from: Yansi on May 02, 2018, 03:52:41 pmActually, a Linkwitz-Riley can useanysquared response. I've built a fourth-order Linkwitz-Riley with Bessel response.

author: Benta
author_rank: Super Contributor
timestamp: May 02, 2018, 04:59:39 pm
content: Quote from: Rigolon on May 02, 2018, 04:26:27 pmThis is where Bode plots and asymptotes come in. Your example would (assuming second order filters) result in a filter with a cutoff at 10 kHz with 40 dB/dec roll off, the roll off increasing to 80 dB/dec at 50 kHz.I'm suspicious of your Sallen-Key filter, R3 seems way too high. Shouldn't it be 100 ohms?

author: Rigolon
author_rank: Regular Contributor
timestamp: May 02, 2018, 05:07:44 pm
content: Quote from: Benta on May 02, 2018, 04:59:39 pmSo if I want a better roll-off isn't better to use the same fc? So I get 80 db/dec roll off?Or are there any advantages or reasons to use different fc?Quote from: Benta on May 02, 2018, 04:59:39 pmI'm using the values that are on the actual circuit, I have an old post that I explain a little how I got to this circuit.Not sure if the author was knowing what they were doing, because there are a lot of mistakes on the circuit, as resistors and capacitors grounded on both pins.There are capacitors on the output of each opamp going to ground, which for me is weird since it decreases the slew-rate of the opamp. Not sure if there any motive to use capacitors like that on the output of the opamps.I will post the whole circuit some time, it's just that I'm taking it by parts to focus and learn in depth about it and electronic in general.

author: Wimberleytech
author_rank: Super Contributor
timestamp: May 02, 2018, 05:28:59 pm
content: Quote from: Rigolon on May 02, 2018, 05:07:44 pmI ran your circuit using LTSpice and a LT1058 (close enough) and got the same -3db frequency you got. I think Benta is right. Changing R3 to 100 ohms gives a -3dB of 1kHz

author: Yansi
author_rank: Super Contributor
timestamp: May 02, 2018, 05:32:53 pm
content: Replace it with 0ohm. That is what should be there. (Sallen key 2nd order, bessel Q=0.5 fc=1.5kHz, R1=R2=10k, C1=C2=10n)

author: Rigolon
author_rank: Regular Contributor
timestamp: May 02, 2018, 05:50:38 pm
content: YansiI actually don't intend on using this kind of filter, it's just that it got me curious and since my main objective is to learn, and thanks to you guys I already learned a lot more than I did in my classes few years ago.Just so that it won't get forgotten in all the information and no one anwsers I will copy my last question:So if I want a better roll-off isn't better to use the same fc? So I get 80 db/dec roll off?Or are there any advantages or reasons to use different fc?

author: Wimberleytech
author_rank: Super Contributor
timestamp: May 02, 2018, 06:01:15 pm
content: Quote from: Rigolon on May 02, 2018, 05:50:38 pmIf you have four poles, it doesn't matter where they are...once you get a decade beyond the highest frequency pole, you will be rolling off at 80dB/dec.The advantage of using a different fc for each stage is that you can achieve one of the classic filter approximations (butterworth, chebyshev, etc).

author: Yansi
author_rank: Super Contributor
timestamp: May 02, 2018, 06:02:29 pm
content: Combining the same filter twice means -6dB at the cutoff frequency, meaning a different -3dB cuttoff point. Simply put: Combining two same filters with a -3dB cutoff fc will result in a different -3dB cutoff frequency.Higher order filters (bessel, cebysev, butterworth) require different pole positions, can not be approximated with a repeated block. Try some online calculators to see the results.Do not attempt more than 3rd order sallen key filter, the component precision required will become impractical. Higher orders need more sallen key stages.

author: Wimberleytech
author_rank: Super Contributor
timestamp: May 02, 2018, 06:32:09 pm
content: Quote from: Yansi on May 02, 2018, 05:32:53 pmThe reason he is using the modified SK is to compensate for GBW of the opamp. In one of the earlier posts, he references the TI application note discussing this.

author: Benta
author_rank: Super Contributor
timestamp: May 02, 2018, 06:36:32 pm
content: Quote from: Rigolon on May 02, 2018, 05:50:38 pmRefer back to my post #18.You keep focusing on fc, but this is not relevant for the single filter stages. The only fc that's interesting is the fc of the complete filter cascade. The individual stages will have different fc and often different Q.This is why you need to use the pole tables for the different responses (Butterworth, Bessel etc.). Each second-order section gets its own set of complex conjugate poles.Anyfilter type (Bessel etc., Cauer excepted) will at the end all have the same rolloff depending on filter order, the difference is what happens below and above the cutoff frequency.

author: Nitrousoxide
author_rank: Regular Contributor
timestamp: May 03, 2018, 11:19:23 am
content: Quote from: Rigolon on May 02, 2018, 04:26:27 pmI believe you can take the geometric mean of the two cascaded centre frequencies. i.e. sqrt(10*50) = 22.3607.edit: As mentioned before a bode plot would give you better information.

author: Wimberleytech
author_rank: Super Contributor
timestamp: May 03, 2018, 01:23:52 pm
content: Quote from: Nitrousoxide on May 03, 2018, 11:19:23 amIt depends on how fc is defined. Is it the -3dB point? That would be typical. Think about this...If you have a single pole LP filter with a -3dB point at 10kHz, then cascade it with a single pole LP filter having a -3dB point at 50kHz, will the -3dB frequency increase above 10kHz?Now, if compare terms of the standard second-order polynomial: s2+ W0/Q S + W02to s2+ 2W1W2S + W1W2then W0is geometric mean of W1and W2

author: Rigolon
author_rank: Regular Contributor
timestamp: May 03, 2018, 06:38:01 pm
content: QuoteI've actually never worked with these tables before, I asked about the fc because I was thinking how to build each stage using the math, but I guess doing this is more to researchers or experts on the matter. Since my goal is to learn about electronics in general and try to work as a developer someday, the best thing I do is to keep more simple and use tools that are already there. It's just that I get excited and want to learn all the details.Quote from: Wimberleytech on May 03, 2018, 01:23:52 pmI see.I thought fc was always the -3dB point, didn't know that are other ways to define it.

author: Audioguru
author_rank: Super Contributor
timestamp: May 03, 2018, 11:28:00 pm
content: Your second order lowpass filter with the two different frequencies has avery droopyrolloff. It starts cutting well below its -3dB cutoff frequency and gradually increases its slope until it has a 12dB per octave slope well above its -3dB cutoff frequency.I show a Butterworth response that has a MUCH sharper rolloff than yours.

author: LvW
author_rank: Frequent Contributor
timestamp: May 04, 2018, 05:19:48 pm
content: Rigolon - I just have entered the discussion about bandpass filters, and I must admit that I did not read all the contributions.I think I am rather familiar with filters (I have published a book in German about filters) and I, therefore, ask you if your problems have been solved at the time being?If not or if you not quite satisfied with the situation, you should give again a short overview about your requirements (filter specification):Order of transfer function, center frequency and bandwidth.If the order is unknown to you, you should specify damping requirements.

author: Nitrousoxide
author_rank: Regular Contributor
timestamp: May 05, 2018, 11:26:55 am
content: Quote from: LvW on May 04, 2018, 05:19:48 pmAlternatively, you could also specify the filter passband and stopband gain, bandwidth and ripple. (Ripple will be affected by the normalised transfer function coefficients, i.e. Butterworth for maximally flat). A good picture:

author: Rigolon
author_rank: Regular Contributor
timestamp: May 09, 2018, 04:16:06 pm
content: Nitrousoxide - Thx for the tip.LvW - Sorry for the late response, I live in a small town and when starts to rain it gets impossible to get online. Anyway, my questions so far were all awnsered, but as things go by I come back to ask some more questions.For now I will work on what I've learned here and research a bit about zero-phase filters. If there are any bibliography you guys could suggest on this topic I would appreciate it.

author: LvW
author_rank: Frequent Contributor
timestamp: May 10, 2018, 08:41:40 am
content: "zero-phase filters" ...please, can you give some explanation about the meaning of this expression? (Non-inverting bandpass?)

author: Nitrousoxide
author_rank: Regular Contributor
timestamp: May 10, 2018, 09:35:34 am
content: Quote from: LvW on May 10, 2018, 08:41:40 amAll filters have an associated phase response. Analog filters, or filters implemented in the continuous time domain have non-linear phase, it is a product of topologies and the nature of capacitive and inductive elements. Filters that are implemented in the digital domain, depending on the design and implementation technique (A large topic, ask if you want to know more) a filter may have a linear (FIR) or a non-linear phase (IIR).However, focusing on FIR filters for this example. Their usual topology consists of summed, weighted delay elements (convolution). This will introduce a delay of N filter taps (or coefficients). Zero phase filtering corrects for this, shifting the signal back by N samples.So it can be said that a zero phase filter is a linear phase filter with a phase slope of 0, this can only be done in the digital domain.