Re: [linux-audio-dev] gain curves, interpolation, etc.

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] gain curves, interpolation, etc.
From: Jack O'Quin (joq_AT_io.com)
Date: Wed Nov 29 2000 - 19:09:40 EET


Thanks, Paul. That's essentially what I was thinking. It's good to
know I'm not reinventing the wheel. :-)

I'm still not sure the roundoff error is really much of a problem in
practice. But, it's fun to think about stuff like that, and important
to keep in mind, particularly when dealing with floating point
calculations. Most of my experience is with operating systems. Not
much "float" programming there. Mostly, a handful of specialists
handle what small amount there is (eg: libc, libm).

Paul Sladen <paul_AT_sladen.org> writes:

> On 28 Nov 2000, Jack O'Quin wrote:
>
> > [bla...bla about effecitent interpolation methods
> >
> > Does anyone know what to do about it?
>
> Yes!
>
> 1. Compute the actual value from the polynomial every 8/16/32 samples.
>
> 2. Linearily interpolate between.
>
> -*-
>
> #define GRANULARITY ( 32 )
> #define GRANULARITY_OVER_1 ( 1/32 )
>
> for(;;)
> {
> x = 2*t^3 + 3*t^2 - t + 10;
> dx = (x - lastx) * GRANULARITY_OVER_1;
>
> *out++ = *in++ * (x += dx);
>
> t += GRANULARITY;
> lastx = x;
> }
>
> -*-
>
> Not fine enough? -- Lower the granularity;
>
> Not fast enough? -- Raise the granularity;

My guess is that it may be possible to calculate the GRANULARITY from
the ratio of "x" to "dx". As long as they are commensurate, there is
little problem. When "dx" is relatively tiny, careful handling may be
needed.

Regards,

-- 
  Jack O'Quin
  Austin, Texas, USA


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Nov 29 2000 - 20:11:29 EET