I'm trying to derive the time-domain coefficients of a biquad filter based on its z-domain coefficients. The purpose is to import externally-generated EQ filters (in z-domain) into Max/MSP (in time-domain).

Could someone kindly explain how to do so?

Z-domain: $$H(z) = \frac{b_0+b_1 z^{-1}+b_2 z^{-2}}{a_0+a_1 z^{-1}+a_2 z^{-2}}$$

Time-domain: $$y[n] = a_0 x[n] + a_1 x[n-1] + a_2 x[n-2] - b_1 y[n-1] - b_2 y[n-2] $$

  • $\begingroup$ Two things. 1. you gotta learn to use $\LaTeX$ markup here. it's easy. 2. the common convention now puts $a_0, a_1, a_2$ in the denominator and the $b_m$ coefficients into the numerator. (i just figured out that you swapped it. Z-domain okay but Time-domain you swapped the $a_m$ and $b_m$) 3. these coefficients are coefficients. they are both time domain and frequency domain, as your "Z-domain" equations depicts. 4. there is the Audio EQ Cookbook. try googling it. and 5. i can't count to two. $\endgroup$ – robert bristow-johnson Jan 1 at 1:49
  • $\begingroup$ Thanks for updating with the correct formatting. I wasn't aware that Latex could be used here. Thanks for catching my mistake with the coefficients. From the answer below, I realize now that the value of, eg. a0, is not identical between H(z) and y(n). Thanks again! $\endgroup$ – Joel Jan 2 at 2:25

I'm not entirely sure what you are asking but if your Z-domain representation is $$H(z) = \frac{b_0+b_1 z^{-1}+b_2 z^{-2}}{a_0+a_1 z^{-1}+a_2 z^{-2}}$$

Then your difference equation is $$a_0 \cdot y[n] + a_1 \cdot y[n-1] + a_2 \cdot y[n-2] = b_0 \cdot x[n] + b_1 \cdot x[n-1] + b_2 \cdot x[n-2]$$

And solving for $y[n]$ we get $$y[n] = \frac{1}{a_0}(b_0 \cdot x[n] + b_1 \cdot x[n-1] + b_2 \cdot x[n-2] - a_1 \cdot y[n-1] - a_2 \cdot y[n-2]) $$

  • $\begingroup$ This explains it perfectly. Thank you! I had originally assumed that the coefficient values were identical between H(z) and y(n), and got really confused... I now understand how to calculate them correctly based on your explanation. $\endgroup$ – Joel Jan 2 at 2:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.