1
$\begingroup$

I am trying to resample an audio signal in my application. It will be between 48kHz and 96kHz audio (both upsampling and downsampling).

Looking at the Wikipedia page for resampling I see there are two approaches:

  1. Decimation and upsampling
  2. Polynomial interpolation e.g. Lagrange

My questions are:

  1. The upsampling Wikipedia page states

    Smooth out the discontinuities with a lowpass filter, which replaces the zeros.

    How does inserting L-1 zeroes between the original sample and then passing it through a low pass filter magically replace the zeroes to become interpolated samples?

  2. If I decide to use polynomial interpolation (Lagrange) do I need to use a low pass filter when downsampling to remove the high frequency signals that are above the Nyquist frequency? What about during upsampling? Why or why not?

  3. All the implementations of resampling I see on the internet are "IIR" filters. Are there any "FIR" resampling filters? If so, why is one seemingly more popular than the other?

  4. My application works by resampling 'chunks' of audio randomly instead of a continuous stream (which is why I want to use a FIR resampling filter as there is no continuity). Is this a good idea or should I change my application to use a IIR resampling filter on a continuous stream of audio?

Thanks all

$\endgroup$
1
$\begingroup$

I prefer bandlimited reconstruction or Sinc interpolation (actually windowed Sinc) to create a new set of samples at an arbitrary sample rate (ratio does not need to be a rational fraction).

See: https://ccrma.stanford.edu/~jos/pasp/Windowed_Sinc_Interpolation.html

And here's my pseudo-code implementation: http://www.nicholson.com/rhn/dsp.html#3

Certain polynomial interpolators can approach starting to look like a window-Sinc interpolation kernel (but I can't find the reference currently. Anyone?)

For many ratios, a windowed-Sinc interpolator can be implemented as a poly-phase FIR filter. If the ratio involves very small numbers in the fraction, then an IIR filter using up-plus-down sampling (or vice versa) may require less MACs than a poly-phase FIR of equivalent quality (in the olden days, a typical computer couldn't compute dozens of transcendental functions and hundreds of MACs per audio sample in real time like most smartphones can today).

One problem with working in chunks is handling the edge effects (filter start-up and tail transients), which may require some sort of overlap-add/save methodology to cover up.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.