Cantabile Development Blog

Follow the development of music software Cantabile

Articles | Full Index | RSS Feed


Sinc Interpolators and Resampling

It's been a while since I've posted anything, so here's a quick update.

Firstly the Cantabile code base has been through a bit of a clean up.

Then for the last couple of weeks I've been working on a high-quality, high performance resampling library that will be used when playing audio files with a sampling rate that doesn't match the current sample rate of the audio driver.

The resampling algorithm that I'll be using is what's called a sinc-based, or band limited interpolator and is based on the papers by Smith, J.O. Digital Audio Resampling Home Page.

Because these routines can be computationally intensive, I've spent considerable time optimizing them:

  • Separate routines up and down sampling
  • Separate routines for interleaved vs non-interleaved audio
  • Separate routines for each of 1 through 8 channels and a generic version for 9 or more channels
  • Rewriting in highly optimized assembler the most common routines (ie: the mono and stereo versions), some using SSE and some using regular floating point math.
  • Lots and lots of testing and fine tuning.

In this process I also came across a problem with the Microsoft C++ x64 compiler when working with floating point math on newer Intel CPUs -which Microsoft has agreed to fix in the next version of the compiler. In the mean time I'm using assembler for the most critical routines and waiting on the fix for the other situations. There's more about this here on the KVR Audio Developer's Forum.

There's still a little more work in this area (mainly designing the sinc filters that will be used) before returning to Cantabile proper.

Posted on August 29, 2007

Share This

Leave A Comment

All comments will be reviewed for spam before being displayed.