๐Ÿ”Š Sound Representation Explorer

OCR Computer Science J277 - Mr Brown

Interactive Sound Sampling

A microphone captures sound as a continuous analogue wave. To store it on a computer, the wave must be sampled โ€” measured at regular time intervals โ€” and each measurement stored as a binary number. Explore how sample rate and bit depth affect the quality of the digital recording (and its file size) below!

Drag the slider to change the sample rate, and pick a bit depth to see the effect on quality.

Sample rate: 20 Hz

Click a sample dot (orange) to see its binary code.

๐Ÿ”‘ Amplitude Levels Key

Every sample's height (amplitude) is stored as one of these binary codes:

๐Ÿ“Š Sound Stats & Metadata

This slider sets the length of the (hypothetical) full recording, used to calculate its file size:

Duration: 3 seconds

Sample Rate

20 Hz

Bit Depth

2-bit

Amplitude Levels

4

Duration

3s

File Size

15 bytes

Sound file size = sample rate ร— bit depth ร— duration = 20 Hz ร— 2-bit ร— 3s = 120 bits

This is uncompressed โ€” the file size doesn't depend on what the sound actually is, only on these three settings!

MetadataValue
Sample rate20 Hz
Bit depth2-bit
Duration3 s
File size120 bits
Date created

๐Ÿ† Sound Representation Challenges

Challenges Complete

0

Total Points

0

Loading challengeโ€ฆ

๐Ÿ“š Master Sound Representation

๐ŸŽ™๏ธ From Analogue to Digital

Sound travels as a continuous analogue wave. A microphone converts this into a continuous electrical signal. Because computers can only store and process binary data, this signal must be sampled โ€” measured at regular time intervals โ€” and each measurement (the amplitude, or "height", of the wave at that instant) is stored as a binary number.

๐Ÿ“ถ Sample Rate

Sample rate is the number of samples taken per second, measured in Hertz (Hz). A higher sample rate captures the shape of the original wave more accurately, giving higher playback quality โ€” but produces a bigger file.

Sample rateTypical use
8,000 HzTelephone-quality speech
44,100 HzCD-quality audio
96,000 HzProfessional studio recording

๐ŸŽš๏ธ Bit Depth

Bit depth is the number of bits used to store each sample's amplitude value. With n bits, each sample can be one of 2โฟ possible amplitude levels.

Bit depthLevels possible
1-bit2
4-bit16
8-bit256
16-bit65,536 (CD quality)

Higher bit depth means the volume of each sample is measured more precisely, giving smoother, more accurate sound โ€” but a bigger file. Try it in the Playground and see the difference!

โฑ๏ธ Duration

Duration is simply how many seconds of audio the file contains. A longer recording contains more samples, so it produces a bigger file โ€” but duration has no effect on the quality of the sound itself.

๐Ÿงฎ Calculating Sound File Size

Sound file size = sample rate (Hz) ร— bit depth (bits) ร— duration (seconds)

This gives the size in bits โ€” divide by 8 for bytes, and by a further 1000 for KB.

Example: a 10 second recording at 44,100 Hz with a 16-bit depth:
44,100 ร— 16 ร— 10 = 7,056,000 bits = 882,000 bytes โ‰ˆ 882 KB

๐Ÿ“‹ Metadata

Metadata is extra information stored with a sound file, separate from the sample data itself โ€” for example its sample rate, bit depth, duration and the date it was created. It's what lets software play the recording back correctly.

โœ… What to Remember for the Exam

  • Analogue sound must be sampled and stored in binary before a computer can use it.
  • Sample rate = number of samples per second, measured in Hz; higher sample rate = closer to the original sound but bigger file.
  • Bit depth = bits per sample; possible amplitude levels = 2โฟ; higher bit depth = more accurate volume but bigger file.
  • Duration = length of the recording in seconds; longer duration = bigger file, but no change in quality.
  • Sound file size = sample rate (Hz) ร— bit depth (bits) ร— duration (seconds).
  • Metadata stores extra info (sample rate, bit depth, duration, etc.) alongside the sample data.