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: Benno Senoner (sbenno_AT_gardena.net)
Date: Fri Dec 01 2000 - 17:54:35 EET


Hi,
I'm probably a bit late here, but I discussed about this stuff with Olli
Niemitalo and Paul Kellet sometime ago while talking about EVO's modulation
capabilites.

The result was to use linear interpolation.
Why ?
Well if we use variable granularity, then we can cover linear curve segments
with a triple of { start_value, delta_vale , duration_in_samples }
( I call it envelope_t)
 If we need to emulate exponential fades then simply use a
granularity of let's say 32 samples.
(basically you sample your desired gain curve with a sampling rate which is
1/32th of the audio samplingrate, and simply calculate an arrary
of envelope_t values.

That way you can apply arbitrary gain curves while adding only 5-10% in terms
of the track's memory consumption.
One, while calculationg envelope_t values, could dynamically adjust the
granularity in the segments where the curve is changing fast, but not go below
 the 32sample granularity.

With a max 32sample granularity, you can have volume modulations at up to
600-700Hz which MORE THAN ADEQUATE for volume modulation stuff,
since we aren't building an FM synth here.
And I challenge anyone to hear the difference of a sample-by-sample volume
modulation or a volume modulation which uses linear segments with a granularity
of a new segment each 32 samples.

The ear is simply not capable of detecting the shape of these fast volume
changes (this because of the finite resolution of the ear), and as Olli would
call it, the resulting wave would sound "perceptually perfect".

If someone is able to demonstrate the contrary, then please ....

cheers,
Benno.

On Wed, 29 Nov 2000, Paul Sladen wrote:
> 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 : Fri Dec 01 2000 - 20:45:25 EET