# [PD] Resonant filter using cpole~ czero~

Mathieu Bouchard matju at artengine.ca
Mon Feb 20 04:41:51 CET 2012

```Le 2012-02-19 à 22:31:00, Mike Moser-Booth a écrit :

> To clarify, think of the z-transform of the filter as H(z) = 1/A(z),
> where A(z) = 1 - 2r*cos(ω)*z^-1 + r^2*z^-2. If we decide c=1,
> b=2r*cos(ω), and a=r^2, we have A(z) = c - bz^-1 + az^-2. In order to
> apply the quadratic formula, those exponents need to be positive, so
> you have to multiply by (z^2)/(z^2), which leaves you with H(z) = z^2
> / (cz^2 - bz +a).

Alternately, with a backwards z transform, they're already positive, but
then you get a backwards transfer function.

>> code of [biquad~] in pd/src/d_filter.c. They don't come from manuals.
> You mean for [bp~]?

Yes. Dumb mistake.

> btw, you wouldn't happen to know where the source for [vcf~] is, would
> you? I'd like to know how that one works as well, but I can't find it.

Curiously (but not interestingly), it's in d_osc.c instead of d_filter.c.
This makes no sense and you shouldn't try to make sense of it. Just use
grep or any other means to search multiple files for a word, and you'll
find anything.

______________________________________________________________________
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
```