[PD] IIR Filter

geiger geiger at xdv.org
Thu Jun 29 11:30:23 CEST 2006


On Wed, 28 Jun 2006, Miller Puckette wrote:

> There are two possible solutions.  One is to locally set the block
> size to one, as in example G04.control.blocksize.pd in 3.audio.examples.
> The other is to use the powerful vexpr~ object.

I think performance wise using the biquad~ object is the best solution.
Check out the help patch for biquad~, it takes 5 arguments, fb1 fb2 ff1
ff2 and ff3.

set fb1 to -a[1], fb2 to -a[2] and ff1 to 1.

[biquad~ -a[1] -a[2] 1 0 0]

The arguments can only be changed on the message level in this case.

Günter

> On Tue, Jun 27, 2006 at 03:39:47PM +0200, Sylvain Le Beux wrote:
> > Hi list,
> >
> > I am trying to implement an IIR filter which has the following equation :
> >
> > Y[k] + a[1]Y[k-1] + a[2]Y[k-2] = X[k]
> >
> > where X[k] is here a dirac to obtain the impulse response of the filter
> > (of course, first two calculations are set with null samples)
> > I get stuck as I try to get the feedback loop of the filter and Pd send
> > me an "DSP loop detected" error message
> > I know (as I query the Pd archive) there's a way to achieve it by using
> > block~ but I can't really understand how it works.
> > I join my patch if anybody can't point me my mistakes or can improve my
> > implementation
> >
> > Thanks for nay help
> >
> > Sylvain
>
> > #N canvas 667 376 465 288 10;
> > #X obj 46 105 RII;
> > #X obj 46 65 dirac~;
> > #X floatatom 108 65 5 0 0 0 - - -;
> > #X floatatom 151 65 5 0 0 0 - - -;
> > #X obj 45 161 tabwrite~ RII;
> > #N canvas 0 0 450 300 graph1 0;
> > #X array RII 10 float 1;
> > #A 0 0 0 1 0 0 0 0 0 0 0;
> > #X coords 0 1 9 -1 200 140 1;
> > #X restore 230 66 graph;
> > #X obj 16 17 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
> > -1;
> > #X obj 16 40 t b b;
> > #X msg 38 198 \; RII resize 10;
> > #X connect 0 0 4 0;
> > #X connect 1 0 0 0;
> > #X connect 2 0 0 1;
> > #X connect 3 0 0 2;
> > #X connect 6 0 7 0;
> > #X connect 7 0 4 0;
> > #X connect 7 1 1 0;
>
> > #N canvas 125 589 458 308 10;
> > #X obj 62 137 z~;
> > #X obj 62 111 z~;
> > #X obj 62 183 outlet~;
> > #X obj 91 112 *~;
> > #X obj 62 44 inlet~;
> > #X obj 108 44 inlet;
> > #X obj 134 136 *~;
> > #X obj 151 44 inlet;
> > #X obj 118 72 +~;
> > #X obj 62 79 +~;
> > #X connect 0 0 6 0;
> > #X connect 0 0 2 0;
> > #X connect 1 0 0 0;
> > #X connect 1 0 3 0;
> > #X connect 3 0 8 0;
> > #X connect 4 0 9 0;
> > #X connect 5 0 3 1;
> > #X connect 6 0 8 1;
> > #X connect 7 0 6 1;
> > #X connect 8 0 9 0;
> > #X connect 9 0 1 0;
>
>
> > _______________________________________________
> > PD-list at iem.at mailing list
> > UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>




More information about the Pd-list mailing list