Difference between revisions of "Resampling"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
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). 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).
 
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).
Line 9: Line 9:
 
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]).
 
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=
+
==References==
 
* PeakPro 5 Sample Rate Converter Comparison with Other Audio Applications, Bias Inc., December 2005: http://www.bias-inc.com/products/peakPro5/resampling/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/

Revision as of 18:54, 8 November 2006

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). 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).

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 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.

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: ALSA sample rate conversion, ALSA uses a poor-quality linear interpolator).

References