So I've managed to do the inverse BLT idea. The filter works, but it explodes in fast modulation!! (i.e causes an overflow). Any modulation speed of filter cut-off higher than 2.5Khz will make it explode.

I don't want to jump to quick conclusions before I make sure i'm doing it right. May be some one can spot something wrong in a quick look. So here is the original normalized LP transfer function. :

i1.jpg

Doing inverse BLT:

i2.jpg

Therefore, coefficients are:

Code: Select all

```
b0 = (1.0+2*R*x+R*R);
b1 = (4.0-4*R*R);
b2 = 4.0-8*R*x+4*R*R;
a0 = 0;
a1 = 0;
a2 = 4*(R*R-2*R*x+1);
```

I avoided any resonance enhancements for simplicity. Doing TPT using the general purpose topology posted by matt42 above. The final code is:

Code: Select all

```
// Input is in0. and output is out0
// R is resonance from 0 to 1
// cut is cutoff from 0 to 0.5
// m1 and m2 are state/memory variables of the two integrators.
// All other variables are just temporary storage.
double x, a0,a1,a2,b0,b1,b2,p0,p1,p2;
x = cos(2.0*PI*cut);
// S domain coefficients
b0 = (1.0+2*R*x+R*R);
b1 = (4.0-4*R*R);
b2 = 4.0-8*R*x+4*R*R;
a0 = 0;
a1 = 0;
a2 = 4*(R*R-2*R*x+1);
// TPT filter
p0 = -2.0*((2*b1 + b2)*m1 + 2*b2*m2 - 2*in0)/(4*b0 + 2*b1 + b2);
p1 = 0.5*p0 + m1;
p2 = 0.5*p1 + m2;
m1 = 0.5*p0 + p1;
m2 = 0.5*p1 + p2;
out0 = a0*p0 + a1*p1 + a2*p2;
```

One could possibly plug any other transfer function by simply replacing a0,a1,a2,b0,b1,b2 with his own coefficients.

EDIT: just fixed a problem in the code

You do not have the required permissions to view the files attached to this post.