My math and dsp is self taught, so I have a hard time understanding how in the Biquad Fits paper they arrive at:
Code: Select all
1. Single zero at DC: b0 + b1 + b2 = 0.
2. Maximum at ω0:
d
dω |H(z)|
2
|ω=ω0 = 0.
3. Unity gain at ω0: |H(z)|
2
|ω=ω0 = 1
The first requirement yields B0 = 0. The second and third requirements
imply
B1 + 4(φ0 − φ1)B2 − A0 + A1 + 4(φ0 − φ1)A2 = B1φ1 + B2φ2 A0φ0 + A1φ1 + A2φ2 = 1. (
Anyway, I figured to try something similar, because a problem with MZT is aliasing of the response, so that for band pass the peak value is off center.
I came up with the following:
1: find poles via MZT
2: add zero at DC
3: calculate gain squared at the center frequency and it's derivative there
4: Find an additional zero using a curve fit that sets the overall derivative of the system to zero at the center frequency
5: Combine the two zeros and adjust gain so center frequency is at unity
Here's the curve fit:
Code: Select all
//sorry for lazy variable naming g = gain squared and d = derivative
(sqrt((g*g - d*d)*sinw*sinw - 2.0*d*g*sinw) + g*sinw - d*cosw) / d
The problem is the sqrt() function. Everything works great, but once above 10 kHz the input to the sqrt() function quickly becomes massively negative (d outgrows g and due to the squaring the difference quickly becomes very large).
So, is this approached doomed, or should I take a look at adjusting the equation somehow?
Thanks,
Matt