[openbeos] Re: Resampling algorithms for audio mixer

  • From: cyanh256@xxxxxxxxxxxx
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Tue, 27 Nov 2007 19:50:09 GMT

> > The other thing I noticed while skimming through was that
> > there doesn't seem to be any kind of encoder state
> > preservation between calls to the resampling function.
[snip]
> 
> *hehe*
> 
> This is one thing I checked quite well (I hope). It should work on
> little buffers without problems (if you take a closer look the
> interpolation "continues" also where it is "normally" impossible by
> assuming unchanged slopes/coefficients).
> A problem, instead, is heavy upsampling (I'd say more than 4x), since
> the last values of each output buffer are guessed as described above,
> but I think that this problem is common to all interpolators around
> (maybe not if you use FFT - one could also consider some "shadow zero
> values" at the beginning and end of the input buffer, or use the 
> input
> buffer as it was circular).

The approach you're using sounds like a good method to resample,
for instance, an audio file. With a self-contained piece of audio, the
start and end are very well-defined, so it's safe to predict what the
samples before and after the file are.

My concern is when we're resampling buffers on-the-fly -- any
assumptions which are made about what lies before and after
the current buffer will impact the resampling accuracy at the
very start and end.
A good test for this would be to write two programs, one which
resamples an entire audio file (10 megs or so) using a buffer size
of, say, 32 samples, and another program that resamples the
audio using a buffer size of 300, both using the same resampling
function.
For best results, the two files produced by these two programs
need to be bit-for-bit matches.


I'll let you know when I've done some listening tests; there should
be some time soon.

- Cyan

Other related posts: