Re: [linux-audio-dev] Resampling

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

Subject: Re: [linux-audio-dev] Resampling
From: Alexander Ehlert (alexander.ehlert_AT_uni-tuebingen.de)
Date: Wed Aug 08 2001 - 19:27:18 EEST


Hi Benno,

> Alex, I'm not sure if I understood the functioning of your resampler correctly:
> can you specify only integer factors or fractional values too ?

by increasing the blocksize of the fft, you can virtually do any
resample frequency. OK an example, we use a 2048 samples fft.
This gives us 1024 real and 1024 imaginary coefficients. Now we can
just go on and drop one frequency band by the other by removing
a real/imag pair. Lets assume 44100Hz, 2048 blocksize, reduce blocksize
to 1700 -> new frequency = 1700/2048*44100 = 33603 Hz, or bsize 1698 gives
36162 Hz. By just increasing the blocksize you can get smaller steps, but
ok. Performance decreases. But that should suffice for most applications.

> For fractional values I have no clue how to do this (eg: "resample the
> frequency bands ? ))

Yeah maybe, but how would you interpolate between bands?

> FFT even if fftw is fast, with 8way overapping you would not be able to do more
> than 1-2 streams on realtime on a PIII box.
No way??? I can do 16times oversampling with 32768 blocksize in realtime
on my Celeron300 laptop. And thats just overkill. 8times oversampling,
2048 samples will be fine for a lot of stuff. And you certainly can do
more than 2 streams!

> I'm not interested in high quality offline resampling (like in an audio editor)
> but more in the resampling algorithms used in softsynth.

> AFAIK almost none uses the sinc interpolation since it is too cpu hungry.
> Most softynths work without any filtering otherwise they would not achieve
> 50-100 voices on a PII/III box.

Yeah, you would a sinc interpolation with folding anyway and for that
you use the fft overlap method too. The DSP Guide at www.dspguide.com
has a real good explanation, how to avoid time aliasing problems.

> Perhaps an IIR filter would suffice ? We had a similar discussion (fast
> interpolation) on music-dsp some time ago but no clear response came out.

Yeah, but IIR can be a bit unstable with the time. I have implemented
a generic iir core for glame. It's actually only exported as
lowpass/highpass/bandpass. But it could do more. But I have to use
double precision internally to get numerical stability. Just using
float tends to muck around with some filter coefficients.
FIR is a good alternative, but you have to do a compromise. Numerical
stability(FIR), good performer(IIR) ?

To get IIR stable with float one could at a softshaper in the feedback,
but I haven't done any experiments yet. Just hacking GUI code right now :P
Glame got a real nice file importer now with resample&normalize on
import. But stoop. Don't try, they're both broken right now :)
I'll fix that today/tomorrow. First I have to try out a nice Technics
Synthie I just borrowed from a friend(with realtime analog physical
modelling).

Cheers, mag

-- 

Noise proves nothing. Often a hen who has merely laid an egg cackles as if she laid an asteroid. -- Mark Twain


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

This archive was generated by hypermail 2b28 : Wed Aug 08 2001 - 16:29:04 EEST