Re: [linux-audio-dev] Re: Nicola Bernardini's sound file library comments

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

Subject: Re: [linux-audio-dev] Re: Nicola Bernardini's sound file library comments
From: Eli Brandt (eli_AT_v.gp.cs.cmu.edu)
Date: ma elo    16 1999 - 10:20:58 EDT


est_AT_hyperreal.org wrote:
> Erik de Castro Lopo discourseth:
> > I'm looking to get signal-to-noise ratios of 120dB to match current
> > state of the art analog-to-digital and digital-to-analogue converter
> > technology. I'm not afraid to do some heavy maths and Octave is my
> > friend :-).
>
> Hmm..maybe I'll need to rip resampling out of libsndfile! I'm working
> as a total primitive here. First I did linear resampling. Then I did
> quadratic, deriving it from first principles because I didn't have a
> reference at hand. Are there better alternatives? Some kind of
> spline thing perhaps?

The ideal, and 120 dB S/N is aiming pretty close, is interpolation
with a sinc function, appropriately dilated in the subsampling case.
You can think of it as an analog reconstruction followed by resampling.
Julius Smith has theory and GPL'ed C code at
        http://www-ccrma.stanford.edu/~jos/resample/index.html

Spline and Lagrange-polynomial interpolation are impractical for
resampling of that quality. For less difficult jobs they're probably
faster, and certainly require less memory, than windowed-sinc --
I'd be curious to see a comparison. Note that any interpolant that
passes through all the original sample points, as they do, is
incorrect for subsampling (rate-lowering).

For particular ratios one ought to win by predesigning a multirate
(`polyphase') filter bank, but this will be awkward in general.
I don't know how to do this.

An interesting comparison of sox's implementation of linear, sinc, and
polyphase resampling:
        http://eakaw2.et.tu-dresden.de/~andreas/resample/resample.html

By the way, I think resampling could warrant a library of its own, or
at least support for memory-to-memory operations within a soundfile
library. Julius Smith's code is good to have out there, but it's not
packaged and polished for library use. It would be particularly nice
to be able to specify passband width and stopband attenuation, and
have it generate the necessary filter.

-- 
     Eli Brandt  |  eli+@cs.cmu.edu  |  http://www.cs.cmu.edu/~eli/


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:52 EST