How does your phone turn a goal celebration into numbers it can play back?
You record the roar after a goal at Wembley. Your microphone picks up a signal that changes continuously, yet your phone saves the clip as numbers. Which parts of that changing signal does the phone actually measure?
Think back to bitmaps. You stored a colour value at each position in a grid of pixels. For sound, the positions are moments in time. The microphone produces an analogue signal, which can vary continuously between those moments.
Watch the microphone signal curve across the graph. At one, three and five milliseconds, a dot marks the height right at that instant. The dots are two milliseconds apart. Taking these readings at regularly spaced instants is called sampling.
At three milliseconds, the dot sits two units below the zero line. Which number gives the amplitude at that instant? Pick the value you would read from the vertical axis.
Suppose you measure one point eight. In this example, the available levels are zero, one, two and three, so choose the nearest, two. Write two in binary as one zero. Using two bits for each sample gives you a sample resolution of two bits. Store the samples in time order.
Your sample rate tells you how many samples you take each second. On the first graph, the gap was two milliseconds, or zero point zero zero two seconds. To find how many samples you take in one second, divide one by zero point zero zero two. You get five hundred.
You record three seconds in mono, so there’s one channel. Multiply eight thousand samples per second by three to get twenty-four thousand samples. At eight bits per sample, that’s one hundred and ninety-two thousand bits. Divide by eight to get twenty-four thousand bytes of uncompressed sound data.
You record two seconds of uncompressed mono sound at sixteen thousand samples per second. Each sample uses eight bits. How many bytes does the sound data take up? Pick one answer, counting only the sample data.
When you see two sampling instants, you might be tempted to shade the area under the curve between them. That area has no role in the sample. At the time named in the question, find the curve and put one dot where they meet.