- 2072 Asoj · 6 marks
Computer representation of sound
Short answer
Sound is digitised by PCM: sampling, quantisation and coding, following the Nyquist theorem. Example: 1 second of CD-quality stereo needs 44,100 x 16 x 2 = 1,411,200 bits = 176,400 bytes. A 3-bit quantiser turns 3.2, 5.8, 6.9, 4.1 into 011, 110, 111, 100.
Explain the computer representation of sound with example.
Sound is a continuous analogue pressure wave, so it must be converted into a sequence of numbers before a computer can store it. This conversion is called digitisation or pulse code modulation (PCM) and has three steps: sampling, quantisation and coding.
amplitude
| .--. .--.
| .' '. .' '. o = samples taken at
| o o o o equal time intervals
+----|----|----|----|----> time
T = 1/sampling rate
1. Sampling
The amplitude of the wave is measured at regular time intervals. The number of samples per second is the sampling rate (Hz). By the Nyquist theorem the sampling rate must be at least twice the highest frequency in the signal. Human hearing reaches about 20 kHz, so CD audio uses 44.1 kHz; telephone speech (up to about 4 kHz) uses 8 kHz.
2. Quantisation
Each sample is rounded to the nearest of a fixed number of levels. The number of bits per sample (resolution) decides the levels: 8 bits give 2^8 = 256 levels, 16 bits give 65,536 levels. The rounding causes quantisation noise, which falls as bits increase.
3. Coding
The quantised values are written as binary numbers (and optionally compressed) in a file such as WAV.
Example
Record 1 second of CD-quality stereo sound: 44,100 samples/s x 16 bits x 2 channels = 1,411,200 bits = 176,400 bytes per second. A 3 minute song therefore needs 176,400 x 180 = 31,752,000 bytes (about 31.8 MB).
For a 3-bit quantiser (8 levels, 0 to 7), samples of a wave at 3.2, 5.8, 6.9, 4.1 become 3, 6, 7, 4 and are stored as 011, 110, 111, 100.
Playback does the reverse: a DAC converts the numbers to voltages and a filter smooths them to an analogue wave.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Boundary representation of 3D objects · Computer Graphics, chapter 6 · asked 4×
- Space partitioning representation · Computer Graphics, chapter 6
- Parametric and non-parametric curve representation · Computer Aided Design, chapter 2