[PD] can [bp~] be obtained with biquad coefficients?

patrice colet colet.patrice at free.fr
Sat Apr 12 14:25:59 CEST 2014


Le 12/04/2014 08:45, Alexandre Torres Porres a écrit :
> > change the [fexpr~] to something like
> > [fexpr~ $x[0] + ($f2 * $y[-1]) + ($f3 * $y[-2])]
>
> f*ck, I'll be damned, now my patch that implements [bp~] with [fexpr~] 
> seems to work, it's attached. Thanks!

thanks for the share, when I tried to implement filters with expr and 
biquad I haven't been able to get it working fully (some clics appeared 
when changing frequency)... Your implementation works very well in both 
cases, "chapeau bas"

>
> > it's pretty easy to see that from the code you quoted
>
> I can't really see it from the code itself. And, well, remember I 
> mentioned about the biquad code?
>
>     {
>         t_sample output =  *in++ + fb1 * last + fb2 * prev;
>         if (PD_BIGORSMALL(output))
>             output = 0;
>         *out++ = ff1 * output + ff2 * last + ff3 * prev;
>         prev = last;
>         last = output;
>     }
>
> Well, I made a silly confusion mistake and thought the first line was 
> feedforward  (and then equivalent to the bp~). But still, it could be 
> it for all I can tell. How can you actually see wether is feedback or not?
>
> Anyway, the patch works and I can also make it on biquad, it's all 
> attached.
>
> > after all it's a resonating filter and therefore needs a feedback path.
>
> I wouldn't know about that, but that's how you convinced me you knew 
> what you were talking about :)
>
> Thanks again
>
>
> 2014-04-11 16:46 GMT-03:00 volker böhm <vboehm at gmx.ch 
> <mailto:vboehm at gmx.ch>>:
>
>
>     On 11.04.2014, at 16:48, Alexandre Torres Porres wrote:
>
>     > ""last" and "prev" are the last two _output_ samples.
>     > i don't know fexpr~ very well, but it looks like you try to
>     access the last _input_ samples."
>     >
>     > In [fexpr~] you can access input samples with $x variables and
>     output samples with $y. So you're correct. I'm going for the input
>     samples.
>     >
>     > But I did it because I believe "last" and "prev" in this formula
>     are in fact about input samples.
>
>
>     no, and it's pretty easy to see that from the code you quoted:
>
>     > > t_sample output = *in++ + coef1 * last + coef2 * prev;
>     > >
>     > >         *out++ = gain * output;
>     > >
>     > >         prev = last;
>     > >
>     > >         last = output;
>
>
>     after all it's a resonating filter and therefore needs a feedback
>     path.
>     so it somehow has to take outgoing samples back in.
>
>
>     > So I feel pretty strong about getting this [fexpr~] right. Is
>     there anything I did not take into consideration?
>
>     yes, calculate coef1, coef2 and gain by using the formulas from
>     the code,
>     change the [fexpr~] to something like [ fexpr~ $x[0] + ($f2 *
>     $y[-1]) + ($f3 * $y[-2]) ],
>     (where $f2 and $f3 would be coef1 and coef2 resp.)
>     apply the gain factor afterwards,
>     and you are done.
>
>     vb
>
>
>
>
>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140412/2b9970a8/attachment.htm>


More information about the Pd-list mailing list