Sound and Image Representation
Sound and Image Representation
Computers must convert analogue real-world data (sound waves, images) into digital binary data. This note covers how sound and images are represented, stored, and how quality and file size are affected.
---
Sound Representation
Sound is an analogue wave — it varies continuously. To store it digitally, it must be sampled.
Sampling
Sampling means measuring the amplitude (height) of the sound wave at regular intervals and recording each measurement as a binary number.
Key Terms
| Term | Definition |
|---|---|
| Sample rate | Number of samples taken per second, measured in Hertz (Hz) |
| Bit depth | Number of bits used to store each sample |
| Bit rate | Number of bits processed per second (sample rate × bit depth) |
| Duration | Length of the audio in seconds |
How Sampling Works
1. The analogue sound wave is measured at regular intervals (the sample rate)
2. Each measurement is rounded to the nearest available value (determined by bit depth)
3. The rounded values are stored as binary numbers
4. On playback, the binary values are converted back to an approximation of the original wave
Calculating Sound File Size
File size (bits) = sample rate × bit depth × duration (seconds)
For stereo, multiply by the number of channels (2).
Worked Example
A 30-second mono audio clip, sample rate 44,100 Hz, bit depth 16 bits:
- File size = 44,100 × 16 × 30 = 21,168,000 bits
- ÷ 8 = 2,646,000 bytes
- ÷ 1,024 = 2,583.98 KB
- ÷ 1,024 = 2.52 MB
Effect of Sample Rate and Bit Depth on Quality
| Change | Effect on Quality | Effect on File Size |
|---|---|---|
| Higher sample rate | More samples = smoother wave = better quality | Larger |
| Lower sample rate | Fewer samples = more jagged = worse quality | Smaller |
| Higher bit depth | More possible values = more accurate = better quality | Larger |
| Lower bit depth | Fewer values = less accurate = worse quality | Smaller |
Common Sample Rates
| Use | Sample Rate |
|---|---|
| Telephone | 8,000 Hz |
| FM Radio | 22,050 Hz |
| CD quality | 44,100 Hz |
| Professional | 96,000 Hz |
Nyquist Theorem
The sample rate should be at least double the highest frequency in the sound to capture it accurately. Human hearing goes up to ~20,000 Hz, so CD quality uses 44,100 Hz.
---
Image Representation
Digital images are made up of tiny dots called pixels (picture elements). Each pixel stores colour information as binary data.
Key Terms
| Term | Definition |
|---|---|
| Pixel | The smallest addressable element of an image |
| Resolution | The number of pixels in the image (width × height) |
| Colour depth | The number of bits used to store the colour of each pixel |
| Metadata | Additional data stored with the image (dimensions, file type, date) |
Colour Depth
The colour depth determines how many different colours each pixel can display:
| Colour Depth | Number of Colours | Use |
|---|---|---|
| 1 bit | 2 (black/white) | Simple icons |
| 2 bits | 4 | Very basic graphics |
| 4 bits | 16 | Simple diagrams |
| 8 bits | 256 | GIF images |
| 16 bits | 65,536 | High colour |
| 24 bits | 16,777,216 | True colour (photos) |
Formula: Number of colours = 2^(colour depth)
Calculating Image File Size
File size (bits) = width × height × colour depth
Worked Example
An image that is 1920 × 1080 pixels with 24-bit colour depth:
- File size = 1,920 × 1,080 × 24 = 49,766,400 bits
- ÷ 8 = 6,220,800 bytes
- ÷ 1,024 = 6,075 KB
- ÷ 1,024 = 5.93 MB
Effect of Resolution and Colour Depth on Quality
| Change | Effect on Quality | Effect on File Size |
|---|---|---|
| Higher resolution | More pixels = more detail = sharper image | Larger |
| Lower resolution | Fewer pixels = less detail = blocky image | Smaller |
| Higher colour depth | More colours = more realistic | Larger |
| Lower colour depth | Fewer colours = less realistic | Smaller |
---
Compression
Because media files are large, compression reduces file size for storage and transmission.
Lossy Compression
- Permanently removes some data
- Cannot be reversed to get the original back
- Smaller file sizes
- Examples: JPEG (images), MP3 (audio), MP4 (video)
- Best for: photos, music, video where slight quality loss is acceptable
Lossless Compression
- No data is lost — the original can be perfectly reconstructed
- File sizes larger than lossy but smaller than uncompressed
- Examples: PNG (images), FLAC (audio), ZIP (files)
- Best for: text, medical images, professional audio where accuracy matters
---
Exam Tips
- Always show your working in file size calculations — marks are awarded for the method
- Remember the formula: file size = sample rate × bit depth × duration (sound) or width × height × colour depth (images)
- Unit conversions: ÷ 8 for bits→bytes, ÷ 1,024 for bytes→KB→MB→GB
- Know the trade-off: higher quality = larger file size
- Be able to explain why increasing sample rate OR bit depth improves sound quality (they do different things)
- Know that metadata is not included in the basic file size calculation but does add to actual file size