2nd order Butterworth filter - Page 1
Forum section: electronics / projects

author: emmanuelcrova
author_rank: Newbie
timestamp: December 01, 2020, 06:55:38 pm
content: Hi everyone, my name is Emmanuel, I am from Italy, and this is my first message in this forum.I am performing some research about the Buttherworth filter for my BS Degree thesis in Electronic and TLC Engineering.I found myself quite stucked with the project since I can't easily figure out an important concept about the parameters of this specyfic type of filter; to give an idea of what I am talking about, the whole project is related to a digital signal generated by a ROM beeing filtered through a second order filter (i.e. Butterworth) and its implementation on a FPGA with the use of some external components to set some parameters (I am going to use some potentiometers to set, for instance, the values of frequency and amplitude for the input wave; at this moment I want to set up the regulation of Q factor and the cutoff frequency for the filter. This last point is driving me mad, since I cannot find a correlation between the choice of some poles/zeros and those parameters).So, this is basically my question: How do poles and zeros are related to Q factor and frequency cutoff in a second order butterworth filter? Is there any formulas or theorical concept I am missing?I mean, using the below representation of direct-form-I filter how can I regulate and choose the a0,a1,a2,b0,b1 coefficients starting from the Q and the cutoff frequency for the filter?I know that I can find many online software doing the stuff for me, but I need the math behind them since what I will try to perform is to generate all these coefficients programmatically running a script.I will share more info on my project if neededSorry for my confused ideas, I am not a real genius in electronics, I know

author: Benta
author_rank: Super Contributor
timestamp: December 01, 2020, 07:54:10 pm
content: This reply only concerns 2nd order filters.For higher orders, it can get complicated.First, Butterworth is not a specific filter, it's just a transfer function with a Q optimised for maximally flat amplitude response.There are others: Bessel, Chebyschev, intermediates etc. and they all share the same transfer function, but have different Qs (or damping factors =1/Q).Butterworth is nice in three respects:1: maximally flat amplitude response.2: super-easy to calculate.3: the -3 dB point (=cut off frequency) coincides with wo.Downsides: bad phase- and impulse response.If you want to get into the nitty-gritty of this, complex calculus is needed. Don't know if you want to go there, but it's not too difficult.

author: emmanuelcrova
author_rank: Newbie
timestamp: December 01, 2020, 08:05:10 pm
content: Thank you for your help BentaQuote from: Benta on December 01, 2020, 07:54:10 pmmaybe yes, maybe no. I don't know if it is too far away from what I need to understand for the purpose of my project. I need for sure to understand what is the correlation between Q (= 0.707 as I choose to use Butterworth), cut off frequency and the parameters a0, a1, a2, etc. How can I obtain tose coefficients knowing that the only parameter I can manipulate (according to fixed Q) is cutoff frequency?

author: Benta
author_rank: Super Contributor
timestamp: December 01, 2020, 08:33:16 pm
content: So basically, your issue is transforming from the complex s-domain (complex frequency) to the z-domain (discrete time).I can help you with the s-domain, but not with the z-domain.In the s-domain, Q is a constant, I suspect this is also the case in the z-domain.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 01, 2020, 08:36:24 pm
content: Here is an answer to a question...can't tell for sure if it is your question or mine.Write the s-domain transfer function for a butterworth filter (lp shown below)Apply a z transform (I chose the bilinear transform)Write the equation for the direct form transfer function in z domain.Set the two equal and solve for coefficients after picking a sampling frequency.My stuff here is normalized to one radian per second.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 01, 2020, 09:00:24 pm
content: As an alternative, you can let Octave do the work for youhttps://tttapa.github.io/Pages/Mathematics/Systems-and-Control-Theory/Digital-filters/Discretization/Discretization-of-a-fourth-order-Butterworth-filter.htmlf_s = 1000; % Sample frequency in Hzf_c = 2*pi; % Cut-off frequency in Hzorder = 2; % Order of the butterworth filteromega_c = 2 * pi * f_c; % Cut-off angular frequencyomega_c_d = omega_c / f_s; % Normalized cut-off frequency (digital)[b, a] = butter(order, omega_c_d / pi); % Design the Butterworth filterdisp('a = '); disp(a); % Print the coefficientsdisp('b = '); disp(b);H = tf(b, a, 1 / f_s); % Create a transfer functionbode(H);

author: mawyatt
author_rank: Super Contributor
timestamp: December 02, 2020, 07:15:26 pm
content: If you like to play around with Butterworth filters, here's one I did that was published in EDN and Walt Jung's Active Filter handbook ~40 years ago. This realizes the 3rd order Butterworth transfer function (S^3+2S^2+2S+1) with equal values for Rs and Cs. If you inter-change the Rs and Cs it transforms from a LP to HP.Have fun with the analog filters, they are becoming a lost artBest,

author: Benta
author_rank: Super Contributor
timestamp: December 02, 2020, 09:46:59 pm
content: The OP is looking for solution in the digital domain. It's best to read the full thread.

author: emece67
author_rank: Frequent Contributor
timestamp: December 03, 2020, 09:54:41 am
content: .

author: mawyatt
author_rank: Super Contributor
timestamp: December 04, 2020, 01:49:52 pm
content: Quote from: emece67 on December 03, 2020, 09:54:41 amZverevis an excellent theoretical and practical reference for all sorts of analog filters. It's very old, and not a quick reference, but for those involved in complex analog filter designs became a very valuable resource. It has sections on Helical and Crystal filters, which are hard to find elsewhere.Best,

author: mawyatt
author_rank: Super Contributor
timestamp: December 04, 2020, 02:48:56 pm
content: Quote from: Benta on December 02, 2020, 09:46:59 pmIt seems the OP is interested in the Butterworth filter, which BTW is not a digital domain function but a pure analog function!"I am performing some research about the Buttherworth filter for my BS Degree thesis in Electronic and TLC Engineering.""So, this is basically my question: How do poles and zeros are related to Q factor and frequency cutoff in a second order butterworth filter? Is there any formulas or theorical concept I am missing?"And wants to know the math behind the filter transformation, which involves the basic analog Butterworth function to start with."I know that I can find many online software doing the stuff for me, but I need the math behind them since what I will try to perform is to generate all these coefficients programmatically running a script."So as you say, it's best to read (including you!) the full thread as the OP is not only looking for a digital domain solution as you say but has other questionshighlightedabove!!I pointed out a simple 3rd Order analog Butterworth filter unique with equal Rs and Cs, that is easy to build and test, and provides the 3rd Order Butterworth Polonominal. The value here is understanding the relationship between the Butterworth Polynominal, Q Factor (FD), also damping factor (TD), being able to derive a simple circuit to study and realize the Butterworth function in a simple easy to build circuit with equal value R & C components.If you study this circuit you will find it naturally factors the 3rd Order Butterworth Polynominal (S^3 + 2*S^2 + 2*S +1) into a 1st Order (S+1) and 2nd Order (S^2 + S + 1) Polynominal, and one can study how these interplay. It even allows the very practical effects of where to locate the two Polynominals to allow the maximum dynamic range, and how to implement this with only 2 unity gain amps and the consequences of such. I've used this circuit long ago when I was an Adjunct teaching the 1st graduate level courses in RFIC design as part of a homework assignment, where we were studying bringing conventional lower frequency analog functions into the RF/MW frequency ranges which are today more common.Since the OP is a student looking into Butterworth filter research as stated, this circuit might prove useful and allowing some "hands on" with the analog filter and provide a knowledgable baseline to compare the digital implementation in the research for the BS Degree Thesis.Best,

author: Benta
author_rank: Super Contributor
timestamp: December 04, 2020, 03:52:15 pm
content: The OP is looking for a Butterworth transfer function in the z-domain.

author: emmanuelcrova
author_rank: Newbie
timestamp: December 05, 2020, 12:44:34 pm
content: Hi,a big thanks to everyone who just tried to give his effort to solve my questionI need a further help to better understand the theory behind it.I am going to attach a couple images reporting what I was basically searching for, this is a paper from a NASA scientist I found online. I am just wondering where these calculation come from, I tried to google them but with no success. My question is, do you have some paper or link that explain how to get these results, starting from why do you factor out 1/2 from the general equation arriving to the constraints given for certain values. I want to take those results as certain and correct, of course, but I sholud further document them in my paperwork, as you can imagine.Thanks again for your precious help

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 05, 2020, 03:01:05 pm
content: This looks like it was derived using impulse invariant transform ( set z=e^(jwT) )