Resampling: Difference between revisions

From Hydrogenaudio Knowledgebase
No edit summary
m (fix broken link (accidentally made this https instead of http before, which doesn't work))
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
==Resampling or Sample Rate Conversion==
== Resampling or Sample Rate Conversion ==
Digital audio is always sampled, which means that any digital audio file is created with a fixed sample rate (and resolution). [[Red Book]] [[Compact Disc Digital Audio|Audio CD]]'s sample rate is 44.1kHz (16-bits resolution). Audio on [[DVD]]s is sampled at 96kHz (24-bit resolution). '''Resampling''' or ''Sample Rate Conversion'' is required when one wants to convert a digital audio file (i.e. an analog audio signal that has already been digitized) from a given sample rate into a different sample rate (resolution can stay the same or change). Upsampling (aka interpolation) is the process of converting from a lower to higher sample rate (e.g. from 44.1 kHz to 48 kHz); downsampling (aka decimation) is the process of converting from a higher to a lower sample rate (e.g. from 96 kHz to 48 kHz).


Digital audio is always sampled, which means that any digital audio file is created with a fixed sample rate (and resolution). Redbook Audio CD's sample rate is 44.1kHz (16-bits resolution). Audio on DVDs is sampled at 96kHz (24-bit resolution). Resampling or Sample Rate Conversion is required when one wants to convert a digital audio file (i.e. an analog audio signal that has already been digitized) from a given sample rate into a different sample rate (resolution can stay the same or change). Upsampling (aka interpolation) is the process of converting from a lower to higher sample rate (e.g. from 44.1kHz to 48kHz); downsampling (aka decimation) is the process of converting from a higher to a lower sample rate (e.g. from 96kHz to 48kHz).
Changes in bit depth, e.g. from 16-bit to 24-bit, or from 24-bit to 16-bit, may be performed at the same time as resampling, but care should be taken to avoid conflating the two principles. ''Resampling'' or the more specific terms ''upsampling'' or ''downsampling'' usually mean sample rate conversion only.


Resampling can also be used to describe resolution changes (changes in bit depth, e.g. from 16-bit to 24-bit, or from 24-bit to 16-bit).
Low-quality resampling algorithms, whether upsampling or downsampling, can introduce artifacts which are clearly audible in the resampled audio file. A typical low-quality, but extremely fast resampling algorithm will just be based on linear interpolation. High-quality resampling algorithms use more CPU time, since they require translation to the frequency domain. Modern PC processors (~2 GHz clock) can easily deal with very high-quality resampling in real time. Sound cards that do resampling in real time require a good DSP.


Low-quality resampling algorithms, whether upsampling or downsampling, can introduce artifacts which are clearly audible in the resampled audio file. A typical low-quality, but extremely fast resampling algorithm will just be based on linear interpolation. High-quality resampling algorithms use more CPU time, since they require tranlation to the frequency domain. Modern PC processors (~2GHz clock) can easily deal with very high-quality resampling in real time. Sound cards that do resampling in real time require a good DSP.
Resampling is very often required and is in fact part of the audio mastering process for CDs, since professional audio equipment uses 96kHz or 192kHz for masters, whereas the Red Book Audio CD spec uses a 44.1 kHz sample rate. Different media are recorded at different sample rates (CD at 44.1kHz, DAT at 48kHz, DVD audio at 96 kHz, etc). Digitally mixing different sources sampled at different rates will require resampling to a common rate and resolution.


Resampling is very often required and is in fact part of the audio mastering process for CDs, since professional audio equipment uses 96kHz or 192kHz for masters, whereas the RedBook Audio CD spec uses a 44.1kHz sample rate. Different media are recorded at different sample rates (CD at 44.1kHz, DAT at 48kHz, DVD audio at 96kHz, etc). Digitally mixing different sources sampled at different rates will require resampling to a common rate and resolution.
Many PC audio cards (most notably the 10k1 and 10k2 based Creative Labs ones) and AC97 codecs can only input, output or internally process audio data at 48kHz and forcefully resample any digital audio data at one stage or another. Sometimes the audio software or the drivers will add a resampling step (e.g. ALSA when software mixing, see [http://www.hydrogenaudio.org/forums/index.php?showtopic=47591 this thread]).


Many PC audio cards (most notably the 10k1 and 10k2 based Creative Labs ones) and AC97 codecs can only input, output or internally process audio data at 48kHz and forcefully resample any digital audio data at one stage or another. Sometimes the audio software or the drivers will add a resampling step (e.g. ALSA when software mixing, see this thread: [http://www.hydrogenaudio.org/forums/index.php?showtopic=47591 ALSA sample rate conversion, ALSA uses a poor-quality linear interpolator]).
== References ==
 
* Digital Audio Resampling Home Page: https://ccrma.stanford.edu/~jos/resample/
==References==
* PeakPro 5 Sample Rate Converter Comparison with Other Audio Applications, Bias Inc., December 2005: http://www.audiodesignguide.com/DAC_final/peakResamplingWhitePaper.pdf  
* PeakPro 5 Sample Rate Converter Comparison with Other Audio Applications, Bias Inc., December 2005: http://www.bias-inc.com/products/peakPro5/resampling/peakResamplingWhitePaper.pdf
* Sample Rate Conversion Comparisons (96kHz to 44.1kHz): http://src.infinitewave.ca/
* Sample Rate Conversion Comparisons (96kHz to 44.1kHz): http://src.infinitewave.ca/
* iZotope 64-bit SRC Precise Sample Rate Conversion: http://www.izotope.com/tech/src/
* iZotope 64-bit SRC Precise Sample Rate Conversion: https://web.archive.org/web/20120410075718/http://www.izotope.com/tech/src/
* Sox Sampling rate conversion. W. G. Unruh 2006: http://axion.physics.ubc.ca/soundcard/resample.html
* Sox Sampling rate conversion. W. G. Unruh 2006: http://www.theory.physics.ubc.ca/soundcard/resample.html
* An Analysis of Sample Rate Conversion in Sox, Andreas Wilde, 19. Dec. 2003: http://www.leute.server.de/wilde/resample.html
* An Analysis of Sample Rate Conversion in Sox, Andreas Wilde, 19. Dec. 2003: http://www.leute.server.de/wilde/resample.html
* Understanding Digital Signal Processing, Second Edition, Richard G. Lyons, 2004
* Lyons, Richard G. Understanding Digital Signal Processing. Indiana: Prentice Hall, March 2004: Edition: 3rd ISBN 0-13-108989-7
* Secret Rabbit Code (aka libsamplerate): http://www.mega-nerd.com/SRC/index.html
* Secret Rabbit Code (aka libsamplerate): http://www.mega-nerd.com/SRC/index.html
[[Category:Signal Processing]]

Latest revision as of 00:33, 6 January 2019

Resampling or Sample Rate Conversion

Digital audio is always sampled, which means that any digital audio file is created with a fixed sample rate (and resolution). Red Book Audio CD's sample rate is 44.1kHz (16-bits resolution). Audio on DVDs is sampled at 96kHz (24-bit resolution). Resampling or Sample Rate Conversion is required when one wants to convert a digital audio file (i.e. an analog audio signal that has already been digitized) from a given sample rate into a different sample rate (resolution can stay the same or change). Upsampling (aka interpolation) is the process of converting from a lower to higher sample rate (e.g. from 44.1 kHz to 48 kHz); downsampling (aka decimation) is the process of converting from a higher to a lower sample rate (e.g. from 96 kHz to 48 kHz).

Changes in bit depth, e.g. from 16-bit to 24-bit, or from 24-bit to 16-bit, may be performed at the same time as resampling, but care should be taken to avoid conflating the two principles. Resampling or the more specific terms upsampling or downsampling usually mean sample rate conversion only.

Low-quality resampling algorithms, whether upsampling or downsampling, can introduce artifacts which are clearly audible in the resampled audio file. A typical low-quality, but extremely fast resampling algorithm will just be based on linear interpolation. High-quality resampling algorithms use more CPU time, since they require translation to the frequency domain. Modern PC processors (~2 GHz clock) can easily deal with very high-quality resampling in real time. Sound cards that do resampling in real time require a good DSP.

Resampling is very often required and is in fact part of the audio mastering process for CDs, since professional audio equipment uses 96kHz or 192kHz for masters, whereas the Red Book Audio CD spec uses a 44.1 kHz sample rate. Different media are recorded at different sample rates (CD at 44.1kHz, DAT at 48kHz, DVD audio at 96 kHz, etc). Digitally mixing different sources sampled at different rates will require resampling to a common rate and resolution.

Many PC audio cards (most notably the 10k1 and 10k2 based Creative Labs ones) and AC97 codecs can only input, output or internally process audio data at 48kHz and forcefully resample any digital audio data at one stage or another. Sometimes the audio software or the drivers will add a resampling step (e.g. ALSA when software mixing, see this thread).

References