Skip to content
Crayon CS

Make it comfy

Lesson style

Quick mode shows the key picture, a summary and the practice. Good for a refresher.

Theme
Font

Both fonts are designed to be easy to read. Some readers with dyslexia prefer Lexend.

Text size
Spacing
Animations

Lesson 6 of 7 · about 10 min

Sound and video as numbers

Sound is a wave. Computers measure its height thousands of times a second and store each measurement as a number. Video is a fast flipbook of pictures plus sound.

🧭 What you need first: Pictures as numbers

The story

A sound is air wobbling back and forth: a smooth, wavy line. Computers can’t store a smooth line; they store numbers.

So they do what a nurse does with a patient’s temperature: measure it at regular moments and write each reading down. Measure often enough, carefully enough, and the list of numbers is so close to the original wave that your ears can’t tell the difference.

Two questions decide the quality:

  1. How often do you measure? (the sample rate)
  2. How precisely do you write down each measurement? (the bit depth)

Another way: a flipbook

A flipbook isn’t really moving. It’s separate drawings shown quickly. Draw enough pages and the motion looks smooth. Sampling sound is the same trick: separate measurements, played back fast enough to sound continuous.

Another way: a ruler with marks

If your ruler only has centimeter marks, you round everything to the nearest centimeter. Add millimeter marks and you’re more precise. Bit depth is how many marks your ruler has.

Play with it

Measure a sound wave

Drag the sliders. Fewer samples or fewer bits makes the orange staircase a worse copy of the blue wave. Press Hear it to listen to the difference.

Blue: the real sound wave. Orange: what the computer stores.

Try 2 bits and few samples: crunchy! Then max both out.

Real CD audio: 44,100 samples per second × 16 bits (65,536 levels) × 2 speakers = 10.6 MB per minute, before compression like MP3 shrinks it about 10×.

Name it

The real words

  • Analog signals are continuous (a real sound wave, a vinyl record’s groove). Digital signals are lists of numbers. See analog vs digital.
  • Sampling: measuring the wave at regular intervals. The sample rate is measured in hertz (Hz), samples per second. CD audio uses 44,100 Hz.
    • Why 44,100? A rule called the Nyquist–Shannon theorem says you must sample at more than twice the highest frequency you want to keep. Humans hear up to about 20,000 Hz, so a bit over 40,000 samples per second captures everything we can hear.
  • Bit depth: how many bits each sample gets. 16 bits = 65,536 levels. Rounding to the nearest level is called quantization, and too few levels sounds crunchy.
  • Size = sample rate × bit depth × channels × seconds. One minute of CD audio ≈ 44,100 × 2 bytes × 2 channels × 60 ≈ 10.6 MB.
  • Video is a sequence of images called frames, shown 24 to 60 times per second, plus audio. Uncompressed HD video would be over 10 GB per minute. Codecs like H.264 compress it by storing only what changes between frames.
Build it

Calculate a file size

A voice memo records 8,000 samples per second, 8 bits (1 byte) per sample, in mono. How big is 10 seconds?

Challenge

Why 44,100?

Dogs can hear up to about 45,000 Hz. To record sounds dogs can hear, what's the minimum sample rate?

Remember it

What does increasing the bit depth improve?

Got it?

Finish the lesson to color it in on your map and collect its concept cards.

Did this lesson click?