How sound is sampled and stored — sample rate, bit depth, bit rate and file sizes — and how lossy and lossless compression make files smaller. Revise the notes, try the interactive demos, then take the 15-question quiz.
Sound in the real world is an analogue signal — a continuous wave. Computers can only store digital data, so the sound must be converted by sampling: measuring the height (amplitude) of the wave at regular intervals and storing each measurement as a binary number. When the sound is played back, the samples are joined up to make a stepped copy of the original wave.
Grey = the original analogue wave. Coloured steps = the digital copy the computer stores. Push both sliders up and watch the steps hug the wave more closely.
| Term | Meaning | Effect of increasing it |
|---|---|---|
| Sample interval | How often the sound is sampled. Sampling every 5 ms rather than every 50 ms captures the wave more often. | A shorter interval gives a smoother, less ‘choppy’ result. |
| Sample rate / frequency | How many samples are taken each second, in hertz (Hz) or kilohertz (kHz). 48 kHz = 48,000 samples per second. | More accurate copy of the original sound, but a larger file. |
| Sample size / bit depth | The number of bits available to store each sample. | More precise amplitude values, so better quality — and a larger file. |
| Bit rate | The number of bits used per second of sound. | Generally better quality and more audible detail, but a larger file. |
| Bit rate | Bit depth | Channels | Sample rate | Typical use |
|---|---|---|---|---|
| 96 kbps | 16-bit | Stereo | 44.1 kHz | Voice recordings, podcasts, audiobooks |
| 128 kbps | 16-bit | Stereo | 44.1 kHz | Standard MP3 music quality |
| 320 kbps | 16-bit | Stereo | 44.1 kHz | High quality streaming audio |
| 1,411 kbps | 16-bit | Stereo | 44.1 kHz | Uncompressed CD quality (WAV/FLAC) |
Compression reduces the size of a file. This saves storage space on a device, reduces loading times on the internet, and lets files be uploaded, downloaded or attached to emails more quickly. There are two main types.
Permanently removes some data to reduce the file size by a large amount. The removed data cannot be recovered, so some quality is lost.
Used for: photos, music, video — e.g. JPEG, MP3, streaming.
Reduces file size without permanently removing any data, so the original can be rebuilt exactly. Only reduces the size by a smaller amount.
Used for: text, documents, software — e.g. ZIP, PNG, FLAC.
| Lossy | Lossless | |
|---|---|---|
| Positives |
|
|
| Negatives |
|
|
| Version | Approx. file size | Quality |
|---|---|---|
| Original JPG | 824 KB | Full detail |
| 50% lossy compression | 76 KB | Minor loss of fine detail |
| 80% lossy compression | 38 KB | Noticeably softer, less detailed |
As the compression level goes up, the file size drops sharply — but fine detail (edges, the small text, smooth shading) is lost and can’t be brought back.
| Situation | Best choice | Why |
|---|---|---|
| Storing songs on a phone | Lossy | Much smaller files → more songs fit in the storage, and they download faster. |
| Streaming on Spotify or Netflix | Lossy | Small files stream quickly with less buffering and use less data; the quality loss is barely noticed. |
| A photo for social media | Lossy | Uploads quickly; a tiny loss of detail isn’t noticeable on a phone screen. |
| A photographer’s original or a medical scan | Lossless | Every detail must be kept for editing or checking. |
| Program code, documents, spreadsheets | Lossless | Losing even one character would break the program or change the meaning. |