
Home  Forums  Rules  Articles  The diyAudio Store  Gallery  Blogs  Register  Donations  FAQ  Calendar  Search  Today's Posts  Mark Forums Read  Search 
miniDSP Low cost, modular Digital Signal Processor (DSP) kits for the DIYer from miniDSP. 

Thread Tools  Search this Thread 
12th November 2011, 08:45 PM  #1 
diyAudio Member
Join Date: Mar 2007
Location: California

advanced biquad programming: how to set gain for each biquad?
I am developing some tools for calculating the IIR transfer function coefficients for the biquads in the MiniDSP. So far I have successfully figured out how to calculate the coefficients for first and second order filter functions and a "gain block" (e.g. b0=gain, all other coefficients=0). I developed my calcs using some of the "cookbook" type of documents that are floating around the web.
The one thing I can not seem to figure out, is how to have a filter with a gain of than unity implemented together in the same biquad. I know in analog filter transfer functions I can just multiple the numerator coefficients by the voltage gain that I want to use, and that does the trick. This does not seem to work for an IIR filter. For example, in a single biquad, I want to describe a 2nd order high pass filter with Q=0.7071, corner frequency 500Hz, and voltage gain of 0.707. How to I include the over all biquad gain in my coefficient calculations? I'd like to know a general way to do this for any first or second order filter function. Thanks in advance. Charlie 
14th November 2011, 06:59 AM  #2 
diyAudio Member
Join Date: Dec 2009

Charlie,
If you want to combine Gain (GdB) to one of your biquad filter, there is a simple way. Simply "Multiply" your numerators (all b0, b1, b2) to the linear gain value. (Glin) e.g. H(z) = Glin * (b0 + b1z1 + b2z2) / ( 1+a1z1 + a2z2) So Glin = 10^(GdB/20) Makes sense? DevTeam
__________________
www.minidsp.com  Low cost & modular audio DSP kits for DIYers  Follow our tweets @ minidsp 
18th November 2011, 03:35 PM  #3 
diyAudio Member
Join Date: Mar 2007
Location: California

Thanks for your reply. You are correct.
I discovered my mistake: in the nomenclature I was following, the numerator coefficients of the transfer function are denoted b0, b1, b2 for IIR filters but are denoted a0, a1, a2 for analog filters. I was just multiplying the wrong set of coefficients! Charlie 
Thread Tools  Search this Thread 


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Tantalum cap to set gain in LM386  FenderBender11  Chip Amps  37  3rd July 2011 10:23 PM 
Biquad calculations for custom filter design  pjpoes  MultiWay  46  22nd January 2011 03:06 AM 
Using a Voltage Meter to set your amp gain?  Flyin11  Car Audio  29  2nd February 2008 09:03 PM 
How to set AC current gain in AlephX ?  yoke  Pass Labs  11  26th August 2004 08:12 AM 
New To Site?  Need Help? 