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: Erik de Castro Lopo (erikd_AT_zip.com.au)
Date: ma elo    16 1999 - 14:43:14 EDT


Eli Brandt wrote:

<snip>

> 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.

Yep, I've got a basic windowed sinc interpolator prototype going in
Octave which upsamples by 2 and has about 70dB SNR. I just found an error
in the scaling of the filter coefficients which probably accounts for
some of extra resampling image in what should be the stop band.

> 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.

The Julius O. Smith paper suggests linear interpolation between points
generated by two windowed sinc filters. I'm going to be doing something
like this but I'll also be looking at fitting a polynomial to four
points obtained from windowed sinc filters.

> 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.

As a first pass, I'll be writing my SRC in Octave (much like Matlab
but GPL) and contributing it to the Ocatve project. I also planned
to write a web page discussing how I got to where I did. Hopefully
my paper will offer a more introductory explanation of SRC.

Anyway, once the Octave code is going I was going to re-write it in
C and hook it up into libsndfile. I had thought of making it a
separate library but it seemed strange to have such a obscure piece
of technology in its own library.

Erik

-- 
+-------------------------------------------------+
     Erik de Castro Lopo     erikd_AT_zip.com.au
+-------------------------------------------------+
"Reality is just a crutch for people that can't handle CyberSpace!!"
- Hank Duderstadt


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