About Sampling
Introduction: The way from sound to MP3
We can hear because sound waves enter the ear and are transmitted to the brain. During that whole process the wave is analogue, or with another word, continuous. That means at every possible point in time the wave has a certain strength. That strength also may have any value. The number of possible time-strength pairs is infinite (really!).
However a computer cannot handle infinity. Therefore the wave has to be digitized. During that process sample points in time are chosen and at these sample points the strength is measured. A chip called an A/D converter is responsible for that and a sound card usually does little more than that. The process described above has a name: It is called Pulse Code Modulation or PCM.
All audio that enters a computer or another digital system will in the beginning be represented as PCM data. But, since PCM data still uses a lot of storage space, more intelligent ways of storing that information have been invented, among them MP3 or the GSM compression used in mobile phones. They basically use one of two principles.
The human ear does not hear everything that actually is inside the PCM data. MP3, ogg and AAC are all based on this property.
The PCM data is very redundant. That means that a value can nearly be calculated if the prior values are known. GSM and the ADPCM format found on Windows PCs use this property.
So the compression algorithms do the following. They calculate which parts of the PCM data they can leave out without changing the audio generated at playback time. To do so they usually need to do a lot of mathematically and computationally complex transformations and often the intermediate results have to be kept around for playback.
Further information (WWW Links)
mp3-tech: a lot of technical information about the mp3 file format
Wikipedia: Digital sampling Good article about how analogue signals are converted to digital signals.
