On Tue, Mar 19, 2013 at 03:02:19PM +0100, Tim Goetze wrote:
> > for (i = 0; i < nframes; i++)
> > {
> > g1 += w * (gt - g1 - a * g2);
> > g2 += w * (b * g1 - g2);
> > out [i] = g2 * in [i];
> > }
>
> Surely you realise this version executes exactly as many additions and
> multiplications per sample as a biquad?
Yes. In this case it's possible to remove one multiplication:
a = 0.07f;
b = 1 + a;
// ...
gm = b * gt;
for (i = 0; i < nframes; i++)
{
g1 += w * (gm - g1 - a * g2);
g2 += w * (g1 - g2);
out [i] = g2 * in [i];
}
But CPU usage is not the point. For a biquad the result
can depend on small differences between the coefficients,
with consequent loss of precision. It's a problem mainly
with LF filters. Try a 10 Hz highpass at 96 kHz.
Ciao,
-- FA A world of exhaustive, reliable metadata would be an utopia. It's also a pipe-dream, founded on self-delusion, nerd hubris and hysterically inflated market opportunities. (Cory Doctorow) _______________________________________________ Linux-audio-dev mailing list Linux-audio-dev@email-addr-hidden http://lists.linuxaudio.org/listinfo/linux-audio-devReceived on Tue Mar 19 20:15:01 2013
This archive was generated by hypermail 2.1.8 : Tue Mar 19 2013 - 20:15:01 EET