4.6 - Digital Sound: Sampling
How sound is stored on computers
Sound, like images, is stored on computers as a series of bits, which are the basic units of digital information (0s and 1s). Real-world sound starts as an analogue signal, which must be converted to digital form before a computer can handle it.
Analogue and digital sound signals
Sound in the real world is an analogue signal, meaning it is a continuous wave that varies over time.
In contrast, digital signals represent sound as discrete values, breaking the continuous wave into separate pieces of data that a computer can store and manipulate. This digital form is not a perfect copy of the original but an approximation, which can lose some fine details from the analogue version.
Key differences between analogue and digital sound
- Analogue sound - Continuous and variable.
- Digital sound - Made up of separate, measured points; it approximates the original curve.
- Why convert? - Computers require digital data for storage and processing, so analogue sound must be sampled to create a usable digital file.
The process of sampling
Sampling is the method used to convert an analogue sound signal into digital data. It involves measuring the amplitude of the sound wave at regular intervals and recording these measurements as binary numbers. This creates a digital approximation of the original wave, which can be stored as a sound file.
Steps in the sampling process
- Record the analogue sound wave as a continuous curve.
- Measure (sample) the wave's amplitude at fixed points.
- Convert each measurement into a digital value, creating a representation that roughly matches the shape of the original wave.
- Store these values as a digital file.
The more samples taken, the closer the digital version matches the analogue original, but it will always be an approximation, as some smaller details are lost between sample points.
Factors affecting the quality of digital sound files
The quality of a digital sound file depends on how closely it replicates the original analogue recording. Two main factors influence this: sampling frequency and sample size. Adjusting these can improve accuracy but also affects the file's overall size.
Sampling frequency
Sampling frequency, also known as sample rate, is the number of samples taken per second, measured in hertz (Hz). A common rate is 44,100 Hz, meaning 44,100 measurements per second.
Increasing the sampling frequency takes more measurements, making the digital sound closer to the original.
Sample size
Sample size, also called bit depth, is the number of bits used to represent each sample's amplitude. It determines the range of possible values for each measurement, similar to colour depth in images.
A higher sample size allows for a wider range of sound levels, making the digital sound closer to the original.
The trade-off between quality and file size
While higher sampling frequency and sample size create better-quality sound files that more closely resemble the original recording, they also increase the file size. This is because more data points and detailed values require more storage space in bits.