# [PD] biquad~ with elementary filters [was: Re: dinosaurs ...]

Frank Barknecht fbar at footils.org
Mon Sep 15 15:56:00 CEST 2008

```Hallo,
Charles Henry hat gesagt: // Charles Henry wrote:

> On Mon, Sep 15, 2008 at 7:49 AM, Damian Stewart <damian at frey.co.nz> wrote:
> > dude, that's not 'easy'. i can barely remember how the quadratic formula
> > works with pen and paper, let alone in C, and let alone to the point where i
> > could confidently transfer from C to Pd. i'd have no idea where the bugs
> > were... and indeed, no idea
>
> Use pen and paper.  Then, take your results and make implementations
> in Pd (or C, your choice).  This is a good exercise, so I'll leave it
> to you to do the derivation.  I'm more than happy to help.  I do this
> stuff all the time.
>
> 1. Solve for x in
> a*x^2 + b*x + c =0
> (use "completing the square")  This is how you derive the quadratic formula.

Okay, that's easy (or can be looked up e.g. here:

> 2. Then, solve
>
> ff1*z^2 + ff2*z^1 + ff3 = 0
> and
> 1*z^2 - fb1*z^1 - fb2 = 0
> using the result from (1)

Easy now as well.

> 3.  Then, solve for fb1, fb2, ff1, ff2, ff3 in terms of the poles/zero
> locations from (2)

After (2) I have something like this:

x = (-b +- sqrt(b*b - 4*a*c)) / 2*a

zf = (-ff2 +- sqrt(ff2*ff2 - 4*ff1*ff3)) / 2*ff1
zb = (-fb1 +- sqrt(fb1*fb1 - 4*fb2)) / 2

This gives me four complex numbers zf+, zf-, zb+ and zb-, right?

Now in a biquad~-clone with czero~/cpole~, the values for fb1, fb2, ff1,
ff2, ff3 would be known so I also could calculate zf and zb now.

But what I still don't get is how to feed this into a patch as below as
coefficients to make a biquad~ clone:

[*~] ?
|
|   ? ?
[czero~]
| |
| | ? ?
[czero~]
| |
| | ? ?
[cpole~]
| |
| | ? ?
[cpole~]

This still has several question marks. :(

Ciao
--
Frank

```