# [PD] Resonant filter using cpole~ czero~

Mathieu Bouchard matju at artengine.ca
Sun Feb 19 19:04:19 CET 2012

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

>> a = -r²
>> b = 2r*cos(ω)
>> c = 1 (an overall gain is applied separately, which is like scaling a,b,c
>> all at once)
>
> I don't think this is entirely accurate. I think a and c should be
> switched here, though of course when finding b²-4ac that doesn't
> really matter.

It depends whether you write ax²+bx+c or a+bx+cx². Both forms are
convenient, and the latter expands better in cases of variable degrees
(letters don't get renamed when adding a term), but the former is more
common for cases that have only a degree fixed at 2 or 3.

> Also, when applying a gain to a recursive filter, it's not really the
> same as scaling all the coefficients. If you were to scale them first,
> then the gain would affect the feedback portions of the filter. Applying
> the gain after means the feedback samples are not scaled by the gain.

Those filters are all linear. This means that you can effectively commute
them with a constant gain [*~] without any difference. However, it will
make a difference when the gain of [*~] changes quickly while the main
input changes too.

> If you think of it in terms of its transfer function, it would look
> more like this: H(z) = g*(1 / (1 - 2r*cos(ω)*(z^-1) + r^2 * z(^-2) ))

Well, I was thinking of it in terms of 1/H(z) or 1/gH(z).

But are you sure that you got the signs right in the denominator ?

>> It seems that [bp~] is a mere combination of a [lop~], a [hip~] and a
>> [*~] (plus the calculation of their coefficients).
>
> But [hip~] isn't an all-pole filter. It has a zero at DC.

oops.

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