8

The only 'authoritative' web reference (=very often linked) for calculating the coefficients for digital biquad filters seems to be this:

http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt

Does anywone knows if there is out there any othe good reference or tutorial explaining the role and usage of the parameters Q, BW, dbGain ?

For example: when shoud I use Q instead of BW in specifications ? And what exactly is the meaning of Q? For what I see it's related to the bandwidth of passband filters (in which unit? Hz or normalized frequency?), but maybe I'm wrong. If not, how are they related ?

When and how should I specify the dbGain param? If I build a bandpass filter with the above formulas, I get a gain higher than around f0. How to correctly scale the a,b coeffs to obtain a unitary gain ?

Here some other interesting info about Bandwidth (BW) and Q specifications

http://www.rane.com/note170.html

EDIT after answers

For what I see, one effect of the Q is to raise the selectivity on the center frequency, so a biquad bandpass with a higher Q should be more selective than a biquad with a lower one cutting down heavily the off-center frequency. BUT, in the example I have a singal with tho alternating sine wave with frequency 1000 and 3000 hz (FS is 44100):

Sines 1 and 3 kHZ

If i filter around the 3000 hz using a bandpass with a Q=2 I get a pretty good signal with little ripples in the bandstop (bandpass biquad coeff: b=[0.0939, 0, -0.0939], a=[1.0, -1.6492,0.8122])

Biquad Q = 2

So I decide to raise the Q up to 20 to lowering the ripples, but all I obtain is this ! (bandpass biquad coeff: b=[0.0103, 0, -0.0103], a=[1.0, -1.8014, 0.9795])

Biquad Q = 20

Why the Q=20 biquad bandpass seems to raise the frequency in the bandstop instead of cut it off and why it spreads even more the center frequency ? Why doesn't it make my signal sharper ? Is there a way to mitigate these issues ?

Thanks for the help !

Yozek
  • 338
  • 1
  • 4
  • 10
  • Most of these questions can be answered quickly and easily with a simple Google search. E.g. "Q" or "Q factor" is a long-established way of defining filter "sharpness" which pre-dates DSP: http://en.wikipedia.org/wiki/Q_factor – Paul R Oct 07 '12 at 00:36

1 Answers1

4

A biquad is simply a two-pole IIR filter, where both the numerator and denominator of the transfer function are quadratic equations. Thus, you can factor the coefficient equations, and then use any reference regarding a filter's behavior related to pole/zero placements in the Z-plane to determine the behavior.

One tutorial method I recall was a software package where you could drag the poles and zeros around and see a plot of the resulting response.

Q is a term from classic analog filter design which relates the inverse of bandwidth relative to center frequency. So, given a known center frequency, the use of Q or bandwidth (depending on your exact interpretation or measurement method) is roughly interchangeable (after reciprocating one of them).

hotpaw2
  • 35,346
  • 9
  • 47
  • 90
  • Thanks for suggestions. Googling around I've found this page explaining a bit more the derivation of biquad filters from analog prototype: http://www.earlevel.com/main/2003/03/02/the-bilinear-z-transform/

    There's a biquad calculator useful for verify the obtained results: http://www.earlevel.com/main/2010/12/20/biquad-calculator/

    – Yozek Oct 10 '12 at 08:47