CITATION — REFERENCE ENTRY
Digital Audio Resampling Home Page — Center for Computer Research in Music and Acoustics (CCRMA), Stanford University
- Key
- smith-resample
- Authors
- Smith III, Julius O.
- Issued
- 2020-9-17
- Type
- webpage
- Container
- Center for Computer Research in Music and Acoustics (CCRMA), Stanford University
Raw CSL JSON
{
"URL": "https://ccrma.stanford.edu/~jos/resample/",
"note": "Quotes checked against the PDF version (resample.pdf); the theory section expands Smith and Gossett's 1984 ICASSP paper 'A flexible sampling-rate conversion method'.",
"type": "webpage",
"title": "Digital Audio Resampling Home Page",
"author": [
{
"given": "Julius O.",
"family": "Smith III"
}
],
"issued": {
"date-parts": [
[
2020,
9,
17
]
]
},
"accessed": {
"date-parts": [
[
2026,
11,
26
]
]
},
"container-title": "Center for Computer Research in Music and Acoustics (CCRMA), Stanford University"
}
Claims
-
Resampling needs signal values between the existing samples. Because an audio signal is assumed band-limited below half the sampling rate, Shannon's theorem says it can be reconstructed exactly by bandlimited interpolation; graphics methods such as Lagrange interpolation, cubic splines and Bézier curves are not ideal for audio, where what matters is the audibility of interpolation error.
"In general, the problem is to correctly compute signal values at arbitrary continuous times from a set of discrete-time ... samples of ... the signal amplitude. ... Since the original signal is always assumed to be bandlimited to half the sampling rate, ... Shannon’s sampling theorem tells us the signal can be exactly and uniquely reconstructed for all time from its samples by ... bandlimited interpolation. ... The above methods are suitable for graphics and other uses, but they are not ideal for digital audio. ... In digital audio, what matters is the audibility of interpolation error between samples."
-
Classical sampling-rate conversion interpolates by an integer factor L and decimates by an integer factor M, converting by any rational ratio L/M with a lowpass filter whose cutoff depends on the larger of L and M; this is less convenient for arbitrary times or ratios that change smoothly. When the new rate is lower, the lowpass cutoff must be placed below half the new rate.
"In these techniques, the signal is first interpolated by an integer factor L and then decimated by an integer factor M . ... This provides sampling-rate conversion by any rational factor L/M . ... The conversion requires a digital lowpass filter whose cutoff frequency depends on max{L, M }. ... this formulation is less convenient when it is desired to resample the signal at arbitrary times or change the sampling-rate ... conversion factor smoothly over time. ... When the new sampling rate Fs′ is less than the original rate Fs , the lowpass cutoff must be placed below half the new ... lower sampling rate."
-
Julius Smith's resampling algorithm evaluates a signal at arbitrary times and handles smoothly changing rates, as in audio scrubbing, by interpolated look-up in a table of lowpass-filter coefficients, one table serving every conversion ratio. Because the ideal lowpass impulse response is infinitely long, it must in practice be windowed to a finite length.
"This tutorial describes a technique for bandlimited interpolation of discrete-time signals which supports signal evaluation ... at an ... “arbitrary” time, and which performs well for smoothly changing sampling rates, such as needed for digital audio ... “scrubbing.” The method is based on interpolated look-up in a table of filter coefficients, ... A single pre-computed filter table handles all interpolation times and sampling-rate conversion ratios. ... The summation in Eq. (1) cannot be implemented in practice because the “ideal lowpass filter” impulse response hs (t) ... actually extends from minus infinity to infinity. ... It is necessary in practice to window the ideal impulse response so as to make it ... finite."
-
Free resamplers include Smith's resample (LGPL), Erik de Castro Lopo's libsamplerate ('Secret Rabbit Code', using the same basic algorithm), libresample (used in Audacity), SoX with its libsoxr library, and the Python package resampy; implementations can be compared at src.infinitewave.ca.
"There is also SoX5 (which uses libsoxr, the SoX resampler library) to change sampling ... rates by this method. ... Check out http://src.infinitewave.ca/ for a large list of implementations and their relative performance. ... resampy: https://github.com/bmcfee/resampy ... It is released under the GNU Lesser General Public License (LGPL). ... Erik de Castro Lopo’s “SecretRabbitCode” libsamplerate11 ... Same basic algorithm ... libresample12 (LGPL) (version 1.3 released Jan. 7, 2004) by Dominic Mazzoni (used in ... Audacity)"
Available in