Re: [linux-audio-dev] implementing EQ

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] implementing EQ
From: Eli Brandt (eli_AT_v.gp.cs.cmu.edu)
Date: ke marras 10 1999 - 19:02:19 EST


est_AT_hyperreal.org wrote:
> Hmm..how does the filter you showed coeficcients for compare to
> butterworth filters? Also, I don't understand how using them in
> parallel can be avoided.

That code gives boost/cut filters, which have unity gain at DC and
Nyquist, and for example +6dB at 1 kHz. It's because they're
unity-gain outside the target area that you can run them in series.
(I'm vague on what "Butterworth" means for a biquad, except that I
guess its Q would be 1/sqrt(2) or something.)

The formulas are from Robert Bristow-Johnson's article:
http://www.harmony-central.com/Effects/Articles/EQ_Coefficients/
which also has graphs of what these filters do.

Also, shelving filters, snarfed from a post of his to music-dsp:

    A = sqrt[ 10^(dBgain/20) ] = 10^(dBgain/40)

    omega = 2*PI*frequency/sample_rate

    cs = cos(omega)
    sn = sin(omega)

    Q = sn/[ ln(2)*bandwidth*omega ] (if bandwidth is specified
        instead of Q)

    alpha = sn*sinh[ 1/(2*Q) ]

    beta = sqrt[ (A^2 + 1)/S - (A-1)^2 ]

lowShelf: b0 = A*[ (A+1) - (A-1)*cs + beta*sn ]
                b1 = 2*A*[ (A-1) - (A+1)*cs ]
                b2 = A*[ (A+1) - (A-1)*cs - beta*sn ]
                a0 = (A+1) + (A-1)*cs + beta*sn
                a1 = -2*[ (A-1) + (A+1)*cs ]
                a2 = (A+1) + (A-1)*cs - beta*sn

highShelf: b0 = A*[ (A+1) + (A-1)*cs + beta*sn ]
                b1 = -2*A*[ (A-1) + (A+1)*cs ]
                b2 = A*[ (A+1) + (A-1)*cs - beta*sn ]
                a0 = (A+1) - (A-1)*cs + beta*sn
                a1 = 2*[ (A-1) - (A+1)*cs ]
                a2 = (A+1) - (A-1)*cs - beta*sn

-- 
     Eli Brandt  |  eli+@cs.cmu.edu  |  http://www.cs.cmu.edu/~eli/


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:23:25 EST