Resources | Subject Notes | Computer Science
This section explores how sound is represented digitally for use in multimedia applications. It covers the principles of sound waves, their conversion to digital signals, and common encoding methods.
Sound is a mechanical wave that propagates through a medium, typically air, as variations in pressure. These variations create compressions and rarefactions. The characteristics of a sound wave that we perceive as pitch and loudness are related to the frequency and amplitude of the wave, respectively.
To represent sound digitally, an analog-to-digital converter (ADC) is used. This process involves sampling the continuous analog sound wave at regular intervals and then quantizing the amplitude of the sampled signal.
The key parameters in ADC are:
The relationship between the sampling rate and bit depth determines the number of possible amplitude levels. The number of possible amplitude levels is $2^n$.
Quantization is the process of mapping the continuous range of amplitude values to a finite set of discrete levels. The amplitude of each sample is rounded to the nearest available quantization level. This introduces quantization error, which is the difference between the original analog signal and the digital representation.
Several encoding formats are used to store and transmit digital audio. These formats vary in terms of compression, quality, and file size.
These formats store the audio data without any compression. They offer the highest audio quality but require significant storage space.
Format | Description | File Size | Quality |
---|---|---|---|
WAV (.wav) | Uncompressed PCM audio. | Large | Excellent |
AIFF (.aiff) | Uncompressed PCM audio, commonly used on macOS. | Large | Excellent |
These formats use compression techniques to reduce the file size of audio data. Compression can be either lossy (discarding some audio information) or lossless (preserving all audio information).
Lossy compression formats achieve smaller file sizes by discarding audio data that is considered less perceptually important. Examples include:
Lossless compression formats reduce file size without discarding any audio information. The original audio data can be perfectly reconstructed from the compressed data. Examples include:
The digital representation of sound has specific characteristics:
Aliasing occurs when the sampling rate is insufficient to accurately represent the frequencies present in the original sound wave. This results in spurious frequencies appearing in the digital audio signal, which can be perceived as distortion.
To prevent aliasing, the sampling rate must be greater than twice the highest frequency component of the sound.