Sampling (signal processing)
In signal processing, sampling is the measurement of a continuous signal at a series of instants, usually evenly spaced, turning it into a sequence of numbers that a computer can store and process.[1:1][2:1] In digital audio, sound is sampled into a stream of numbers, each of which can be thought of as the position of a loudspeaker at one instant; compact discs take 44,100 such samples every second.[3:1] Together with quantization, which rounds each sample to a number of limited precision, sampling makes up analog-to-digital conversion.[4:1]
How much sampling is enough
The Nyquist–Shannon sampling theorem gives the condition for sampling to lose nothing. A signal with no frequencies above W is completely determined by samples spaced 1/2W apart, so the sampling rate must be more than twice the highest frequency present.[5:1][3:2] When that holds, sampling incurs no loss of information,[4:1] and the original signal can be rebuilt by adding together sinc-shaped pulses, one per sample, scaled to the sample values.[5:1][3:2] For audio this means that sampling affects neither frequency response nor phase, and the reconstructed signal is smooth and keeps the exact timing of the original.[6:1]
If the signal contains energy above half the sampling rate, that energy is not lost but shifted to a lower frequency, folded about half the sampling rate. This is aliasing.[3:3]
In practice
A practical sampling system has three stages: a prefilter before sampling, the sampling itself, and a postfilter after it.[1:2] The prefilter is the anti-aliasing filter, a low-pass filter that removes content above half the sampling rate.[6:1]
The theorem is an idealization. Real signals are never exactly band-limited, no ideal anti-aliasing or reconstruction filter exists, and the ideal sinc reconstruction is rarely used directly because the sinc function decays slowly.[1:1] Modern audio converters get very close all the same. They sample at a very high internal rate, so that a gentle analog filter suffices, finish the anti-aliasing with a digital filter, and then discard the surplus samples.[6:1][6:2] Michael Unser generalizes the classical theory to filters that are not ideal and to spline and wavelet signal models, treating sampling and reconstruction as a projection onto a space of representable signals.[1:2]
Sampling and quantization
Sampling discretizes time; quantization discretizes amplitude, rounding each sample to one of a finite set of values. Stanley Lipshitz and colleagues point out that the order of the two steps does not matter and that, unlike sampling of a band-limited signal, quantization generally degrades the signal.[4:1] Its effects are governed by the bit depth. Encoding each quantized sample as a binary number gives pulse-code modulation, the standard representation of sampled audio.[3:4][2:1]
- ^a ^b ↗ un-problems ^a ^b ↗ un-paradigm Unser, Michael (2000-04). Sampling—50 Years After Shannon. Proceedings of the IEEE. https://doi.org/10.1109/5.843002 https://infoscience.epfl.ch/record/63072.
- ^a ^b ↗ lc-definition Library of Congress (2022-04-19). Linear Pulse Code Modulated Audio (LPCM). Sustainability of Digital Formats: Planning for Library of Congress Collections. https://www.loc.gov/preservation/digital/formats/fdd/fdd000011.shtml.
- ^ ↗ js-intro ^a ^b ↗ js-theorem ^ ↗ js-aliasing ^ ↗ js-pcm Smith III, Julius O. (2007). Mathematics of the Discrete Fourier Transform (DFT), with Audio Applications. W3K Publishing. ISBN 978-0-9745607-4-8. https://ccrma.stanford.edu/~jos/mdft/.
- ^a ^b ^c ↗ lp-adc Lipshitz, Stanley P.; Wannamaker, Robert A.; Vanderkooy, John (1992-05). Quantization and Dither: A Theoretical Survey. Journal of the Audio Engineering Society. https://www.aes.org/e-lib/browse.cfm?elib=7047.
- ^a ^b ↗ sh-theorem Shannon, Claude E. (1949-01). Communication in the Presence of Noise. Proceedings of the IRE. https://doi.org/10.1109/JRPROC.1949.232969 https://web.cs.miami.edu/home/burt/learning/Csc524.092/docs/shannonpaper.pdf.
- ^a ^b ^c ↗ xi-sampling ^ ↗ xi-oversampling Montgomery, Christopher (2012-03-01). 24/192 Music Downloads ...and why they make no sense. Xiph.Org. https://people.xiph.org/~xiphmont/demo/neil-young.html.
Wikidata: Q210868