[linux-audio-dev] Re: Bandlimited interpolation suitable for realtime audio generation (multi-voice) ?

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

Subject: [linux-audio-dev] Re: Bandlimited interpolation suitable for realtime audio generation (multi-voice) ?
From: Julius Smith (jos_AT_w3k.org)
Date: ti elo    31 1999 - 13:57:04 EDT


Hi Benno,

Your analysis of bandlimited interpolation requirements is correct, and your appraisal of the general trade-offs appears fairly complete.

We normally use bandlimited interpolation for offline sampling-rate conversion. For real-time work, we generally use either linear-interpolation + oversampled wavetables, or highly optimized conversion filters for certain fixed sampling-rate ratios.

Emu (now part of Creative Labs) samplers have been doing bandlimited interpolation in VLSI for many years. Other samplers lacking special interpolation hardware tend to use simple linear interpolation, and they might also cross-fade from one table to another as the conversion ratio goes beyond a certain point. (Have a separate table for each octave, say, and oversample by a factor of 2.)

The NeXT computer had optimized filters for real-time conversion among the various sampling rates supported in the hardware (8, 22, and 44 kHz). Having a DSP56001 signal processing chip on every motherboard made this very smooth, but when it was busy, the 68040 was able to do real-time conversions without too much trouble most of the time. However, there was no explicit support for real-time operation in the '040.

For a Linux real-time environment on the PC, I think I would recommend the use of oversampled wavetables and linear interpolation. It can be surprising how good simple linear interpolation sounds with an oversampling factor of two or more. Your proposal for polynomial interpolation, oversampling by 2, and limiting to one octave is a higher quality version of what I'm suggesting.

As processors get more powerful, it might make sense to introduce an option for turning on bandlimited interpolation at various compute levels for real-time use. What I've always wanted was to be able to say to the audio service "keep audio processing less than or equal to x% of total bandwidth", and have the system allocate compute-power up to that limit. Thus, during a solo passage, some heavy-duty interpolation might be running, while during multivoiced "pads", the system might only be able to afford linear interpolation for that many voices under the current bandwidth budget. A similar "budget" system could be applied to memory usage. I've worked with some game designers, for example, who have requested that audio consume no more than 10% of the processor bandwidth, since they want the rest for graphics. A budget-based approach is just what they wanted. Of course, the musicians among us might want to devote almost 100% of the processor to audio, and they should be able to shoot for that and get the
 best results they can.

Cheers,
Julius

At 06:21 PM 8/31/99 +0200, Benno Senoner wrote:
>Hello,
>I went on Julius Smith's Digital Audio Resampling page
>http://ccrma-www.stanford.edu/~jos/resample/
>
>I must say the bandlimited interpolation sounds very good even after a +/-2
>octave transposition.
>I studied the PDF a bit, and it seems that the algorithm needs
>a number of multiply-adds of
>(2* Nz +1)* max { Fs,Fs'}
>Nz is set to 13 in the example ,
>Fs is the original sample frequency and Fs' the target sample freq.
>This means about
>27 * max { Fs,Fs'}
>playing a sample at the half pitch (ie. Fs'= 88100 Fs=44100)
>has a cost of about 54 multiply-adds per sample.
>playing at 1/4 of the original pitch ( -2 octaves transposition), will result
>in 108 multiply-adds per sample.
>
>Now my question is:
>is this resampling method suitable for software based realtime samplers
>implemented on a PC ?
>
>The main problem of simple interpolations like linear,cubic etc. is that
>if you play the sample at higher pitches, you enter into the aliasing area,
>which could result in disturbing noise, if the sample contains high-freq
>components.
>
>I bencharked the "resample-1.4" example , and converting a
>4 min 44Khz 16bit stereo wav, took about 3 min on my PII400.
>This would mean not more than 5 voices, which is not acceptable
>for a software based sampler, since we need at least 20-30
>voices ( let's say on a PII400) for decent playback.
>(Of course we need spare CPU cycle to perform all kind of other operations)
>
>Another solution could be to allow (or guarantee no aliasing noise) a max
>upwards transposition of 1 octave, using a polinomial interpolation,
>and render the audio internally at twice the output frequency
>(let's say 88200 instead of 44100), and then apply a lowpass filter at 20khz
>to the sum of all voices.
>The drawback would be that all internal processing stages must run at twice
>the sampling rate or alternatively modules which are known not to run into the
>aliasing area, could output 2 equal samples, but the needed memory bandwidth
>would still be twice as normal.
>
>Does anyone know how hardware samplers solve these problems ?
>( to keep audioquality high , and processing usage low)
>
>If we should chose standard interpolation methods (for efficiency reasons),
>which interpolation method is the one which has the best price/audioquality
>ratio ?
>( cubic / spline ? )
>Any good URLs out there ?
>
>comments ?
>
>regards,
>Benno.
>
>--
>Benno Senoner
>E-Mail: sbenno_AT_gardena.net
>Linux low-latency audio / scheduling latency benchmarks
>http://www.gardena.net/benno/linux/audio
>


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

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:25:53 EST