advanced biquad programming: how to set gain for each biquad? - diyAudio
Go Back   Home > Forums > Commercial Sector > Manufacturers > miniDSP

miniDSP Low cost, modular Digital Signal Processor (DSP) kits for the DIYer from miniDSP.

Reply
 
Thread Tools Search this Thread
Old 12th November 2011, 09:45 PM   #1
diyAudio Member
 
Join Date: Mar 2007
Location: California
Default 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
  Reply With Quote
Old 14th November 2011, 07:59 AM   #2
minidsp is offline minidsp  Hong Kong
diyAudio Member
 
minidsp's Avatar
 
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 + b1z-1 + b2z-2) / ( 1+a1z-1 + a2z-2)

So Glin = 10^(GdB/20)

Makes sense?

DevTeam
__________________
www.minidsp.com - Low cost & modular audio DSP kits for DIYers - Follow our tweets @ minidsp
  Reply With Quote
Old 18th November 2011, 04: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
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


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


New To Site? Need Help?

All times are GMT. The time now is 10:00 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright ©1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2