### Bilinear Transform Substitutions Source: https://github.com/git/freeverb3/blob/master/doc/Audio-EQ-Cookbook.txt Explanation of the substitutions used in the bilinear transform for converting analog filter designs to digital, including trigonometric identities. ```mathematica FYI: The bilinear transform (with compensation for frequency warping) substitutes: 1 1 - z^-1 (normalized) s <-- ----------- * ---------- tan(w0/2) 1 + z^-1 and makes use of these trig identities: sin(w0) 1 - cos(w0) tan(w0/2) = ------------- (tan(w0/2))^2 = ------------- 1 + cos(w0) 1 + cos(w0) ``` ```mathematica resulting in these substitutions: 1 + cos(w0) 1 + 2*z^-1 + z^-2 1 <-- ------------- * ------------------- 1 + cos(w0) 1 + 2*z^-1 + z^-2 1 + cos(w0) 1 - z^-1 s <-- ------------- * ---------- sin(w0) 1 + z^-1 1 + cos(w0) 1 - z^-2 = ------------- * ------------------- sin(w0) 1 + 2*z^-1 + z^-2 1 + cos(w0) 1 - 2*z^-1 + z^-2 s^2 <-- ------------- * ------------------- 1 - cos(w0) 1 + 2*z^-1 + z^-2 ``` ```mathematica The factor: 1 + cos(w0) ------------------- 1 + 2*z^-1 + z^-2 is common to all terms in both numerator and denominator, can be factored out, and thus be left out in the substitutions above resulting in: 1 + 2*z^-1 + z^-2 1 <-- ------------------- 1 + cos(w0) 1 - z^-2 s <-- ------------------- sin(w0) 1 - 2*z^-1 + z^-2 s^2 <-- ------------------- 1 - cos(w0) In addition, all terms, numerator and denominator, can be multiplied by a common (sin(w0))^2 factor, finally resulting in these substitutions: 1 <-- (1 + 2*z^-1 + z^-2) * (1 - cos(w0)) s <-- (1 - z^-2) * sin(w0) s^2 <-- (1 - 2*z^-1 + z^-2) * (1 + cos(w0)) 1 + s^2 <-- 2 * (1 - 2*cos(w0)*z^-1 + z^-2) The biquad coefficient formulae above come out after a little simplification. ``` -------------------------------- ### Low-Shelf Filter Biquad Coefficients Source: https://github.com/git/freeverb3/blob/master/doc/Audio-EQ-Cookbook.txt Formulas for calculating the biquad coefficients for a digital low-shelf filter. These are derived using the bilinear transform. ```mathematica lowShelf: H(s) = A * (s^2 + (sqrt(A)/Q)*s + A)/(A*s^2 + (sqrt(A)/Q)*s + 1) b0 = A*( (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha ) b1 = 2*A*( (A-1) - (A+1)*cos(w0) ) b2 = A*( (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha ) a0 = (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha a1 = -2*( (A-1) + (A+1)*cos(w0) ) a2 = (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha ``` -------------------------------- ### Peaking Equalizer Biquad Coefficients Source: https://github.com/git/freeverb3/blob/master/doc/Audio-EQ-Cookbook.txt Formulas for calculating the biquad coefficients for a digital peaking equalizer filter. These are derived using the bilinear transform. ```mathematica peakingEQ: H(s) = (s^2 + s*(A/Q) + 1) / (s^2 + s/(A*Q) + 1) b0 = 1 + alpha*A b1 = -2*cos(w0) b2 = 1 - alpha*A a0 = 1 + alpha/A a1 = -2*cos(w0) a2 = 1 - alpha/A ``` -------------------------------- ### Notch Filter Biquad Coefficients Source: https://github.com/git/freeverb3/blob/master/doc/Audio-EQ-Cookbook.txt Formulas for calculating the biquad coefficients (b0, b1, b2, a0, a1, a2) for a digital notch filter. These are derived using the bilinear transform. ```mathematica notch: H(s) = (s^2 + 1) / (s^2 + s/Q + 1) b0 = 1 b1 = -2*cos(w0) b2 = 1 a0 = 1 + alpha a1 = -2*cos(w0) a2 = 1 - alpha ``` -------------------------------- ### All-Pass Filter (APF) Biquad Coefficients Source: https://github.com/git/freeverb3/blob/master/doc/Audio-EQ-Cookbook.txt Formulas for calculating the biquad coefficients for a digital all-pass filter. These are derived using the bilinear transform. ```mathematica APF: H(s) = (s^2 - s/Q + 1) / (s^2 + s/Q + 1) b0 = 1 - alpha b1 = -2*cos(w0) b2 = 1 + alpha a0 = 1 + alpha a1 = -2*cos(w0) a2 = 1 - alpha ``` -------------------------------- ### High-Shelf Filter Biquad Coefficients Source: https://github.com/git/freeverb3/blob/master/doc/Audio-EQ-Cookbook.txt Formulas for calculating the biquad coefficients for a digital high-shelf filter. These are derived using the bilinear transform. ```mathematica highShelf: H(s) = A * (A*s^2 + (sqrt(A)/Q)*s + 1)/(s^2 + (sqrt(A)/Q)*s + A) b0 = A*( (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha ) b1 = -2*A*( (A-1) + (A+1)*cos(w0) ) b2 = A*( (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha ) a0 = (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha a1 = 2*( (A-1) - (A+1)*cos(w0) ) a2 = (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.