<div dir="ltr"><div><div><div>Thanks for the reply Miller. Out of curiosity, would you <i>not </i>recommend using it for any kind of audio data that goes to the output? Up until this realisation <br>I would rely quite heavily on [lop~] for any kind of sweepable (or static) low pass filtering needs, and I'm pretty sure many of the people I've worked with would do the same. <br>

<br>If that's the case could you recommend an alternative? It was only from your recent email that I realised [vcf~] had both a band-pass and low pass output, I had always assumed it was only band-pass. <br><br></div>

Is it intentional to not a bank of go-to filters? [biquad~] is the next one I would go to, but generating your own coefficients isn't that... err.. efficient when you're wanting some that just 'works' :)<br>

<br></div>Looking forward to hearing your input,<br><br></div>Cheers,<br>Joe<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 21 May 2014 17:31, Miller Puckette <span dir="ltr"><<a href="mailto:msp@ucsd.edu" target="_blank">msp@ucsd.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Joe -<br>
<br>
That code is an approximation that works well for low cutoff<br>
frequencies but badly for high ones.  (I should probably warn<br>
about this in the help window... that'll go on my dolist)<br>
<br>
cheers<br>
M<br>
<div class=""><br>
<br>
On Fri, May 16, 2014 at 12:58:31PM +0100, Joe White wrote:<br>
> Hi,<br>
><br>
> I've been looking at the [lop~] implementation (Pd-0.45-4) and noticed<br>
> something that seem weird to me.<br>
><br>
> In d_filter, line 176:<br>
><br>
> static void siglop_ft1(t_siglop *x, t_floatarg f)<br>
> {<br>
>     if (f < 0) f = 0;<br>
>     x->x_hz = f;<br>
>     x->x_ctl->c_coef = f * (2 * 3.14159) / x->x_sr;<br>
>     if (x->x_ctl->c_coef > 1)<br>
>         x->x_ctl->c_coef = 1;<br>
>     else if (x->x_ctl->c_coef < 0)<br>
>         x->x_ctl->c_coef = 0;<br>
> }<br>
><br>
><br>
> Is it correct that for:<br>
><br>
> y[n] = x[n] * a + y[n-1] * b<br>
><br>
</div>> *a = 2π * Fc / Fs*<br>
<div class="">> b = 1.0 - a<br>
><br>
> where Fc is the cut-off frequency and Fs the sampling frequency.<br>
><br>
> I appreciate the a coefficient is bounded afterwards but wouldn't that mean<br>
> that Fc values greater than Fs / 2π will have no impact on the sound being<br>
> processed.<br>
><br>
> For example if Fs is 44100, then Fc values above ~7020Hz will not affect<br>
> the filter.<br>
><br>
> Have I missed something crucial or could this a bug in the code?<br>
><br>
> The simple IIR filter described in<br>
> <a href="http://en.wikipedia.org/wiki/Low-pass_filter" target="_blank">http://en.wikipedia.org/wiki/Low-pass_filter</a> suggests that the actual<br>
> coefficient calculation should be more like:<br>
><br>
> a = 2π*Fc / (2π*Fc + Fs)<br>
><br>
> Looking forward to understand this more!<br>
><br>
> Cheers,<br>
> Joe<br>
><br>
> --<br>
> Follow me on Twitter @diplojocus<br>
<br>
</div>> _______________________________________________<br>
> <a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
> UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Follow me on Twitter @diplojocus
</div>