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: Paul Sladen (paul_AT_sladen.org)
Date: Wed Nov 29 2000 - 11:42:41 EET


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;

      for( i=0; i < GRANULARITY; i++)
        *out++ = *in++ * (x += dx);

      t += GRANULARITY;
      lastx = x;
  }

-*-

Not fine enough? -- Lower the granularity;

Not fast enough? -- Raise the granularity;

HTH,
Paul

--
e: paul_AT_sladen.org   t: 0115 922 7162


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 - 12:52:48 EET