Difference between revisions of "Resampling"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
(References: Removed dead link, resources no longer reachable.)
m (fix broken link (accidentally made this https instead of http before, which doesn't work))
 
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
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). [[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).
  
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).
+
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.
 
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.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.
+
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 [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 [http://www.hydrogenaudio.org/forums/index.php?showtopic=47591 this thread]).
  
 
== References ==
 
== References ==
* Digital Audio Resampling Home Page: http://ccrma-www.stanford.edu/~jos/resample/
+
* Digital Audio Resampling Home Page: https://ccrma.stanford.edu/~jos/resample/
* PeakPro 5 Sample Rate Converter Comparison with Other Audio Applications, Bias Inc., December 2005: X
+
* PeakPro 5 Sample Rate Converter Comparison with Other Audio Applications, Bias Inc., December 2005: http://www.audiodesignguide.com/DAC_final/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
 
* Lyons, Richard G. Understanding Digital Signal Processing. Indiana: Prentice Hall, March 2004: Edition: 3rd ISBN 0-13-108989-7  
 
* Lyons, Richard G. Understanding Digital Signal Processing. Indiana: Prentice Hall, March 2004: Edition: 3rd ISBN 0-13-108989-7  

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