Learn & build · Electronics · Chapter 16

Audio

Audio is the whole course in one signal chain. A microphone turns air pressure into a few millivolts, an amplifier (chapter 7's op-amps, then transistors that can push current) makes it big, and a speaker (chapter 14's motor, moving in a line instead of a circle) turns it back into air. Along the way it's chapter 8's filters, chapter 10's power supplies, chapter 13's PWM, and the ear as the final judge: you'll hear each amplifier's mistakes below.

In plain words: sound is the air pressure wiggling, 20 to 20,000 times a second. A microphone makes a voltage that wiggles the same way, an amplifier makes a bigger copy of that voltage, and a speaker uses the copy to push the air. Everything that goes wrong is the copy not being exact.

1. Microphones: pressure to voltage

A dynamic microphone is a speaker run backwards: a diaphragm moves a coil in a magnet's field and induces a voltage (chapter 3), no power needed, about 2 mV for speech. An electret capsule is a capacitor (chapter 2) whose one plate is the diaphragm, permanently charged; sound changes the gap and so the voltage, and a tiny built-in transistor needs a few volts of bias through a resistor to read it out. A MEMS microphone (every phone and laptop) is the same idea etched in silicon with its own ADC, sending numbers over I²S (chapter 13's buses again). Here's yours, if you let the page listen:

nothing is recorded or sent anywhere: the samples are drawn and dropped

🎯 Challenge: whistle a steady note and read its frequency.

2. Decibels: from millivolts to watts

Audio levels span a huge range, so they're counted in decibels, chapter 8's filter scale: every ×10 in voltage is +20 dB, every ×2 is about +6 dB. A dynamic mic gives ~2 mV, "line level" between devices is ~1 V, and a speaker at a loud party gets ~10 V across it. Each stage of a chain has a gain in dB, and the gains just add.

\[ G_\text{dB} = 20 \log_{10} \frac{V_\text{out}}{V_\text{in}} \]

A preamp turns a 10 mV microphone signal into 1 V. What's its gain in dB?

\(1 / 0.01 = 100\), and \(20 \log_{10} 100 = 40\) dB. Two ×10 steps, 20 dB each.

Sound's chain is pressure to millivolts to volts to current to pressure. Each stage's gain adds up in decibels, and every flaw is the copy not being exact.

3. Amplifier classes, drawn and played

The output stage has to push real current into a speaker, and the ways of doing it trade quality against heat:

class

🎯 Challenge: find the setting that sounds worst at a low volume, then the one that clips at a high volume.

Why is crossover distortion worse at low volume, while clipping is worse at high volume?

Distortion is the share of the output that isn't the input. A fixed-size flaw is a big share of a small wave; the rails are a limit only big waves meet. That's why THD (total harmonic distortion) specs always say "at 1 W" or similar.

4. Speakers: power into ohms

A speaker is a coil glued to a paper or plastic cone, sitting in a magnet's gap: the current pushes the coil in and out (chapter 14's force, \(F = B I \ell\)). Its impedance, usually 4 or 8 Ω, is mostly the coil's resistance (plus its inductance, which rises with frequency). Power is chapter 1's \(P = V^2/R\), with the RMS voltage (a sine's peak ÷ √2).

\[ P = \frac{V_\text{rms}^2}{R}, \qquad V_\text{rms} = \frac{V_\text{peak}}{\sqrt{2}} \]

Why divide by √2?
  1. At each instant a resistor turns \(v^2/R\) into heat. For a sine, \(v = V_\text{peak}\sin\theta\), where \(\theta\) is the spinning arrow's angle (chapter 6), so the power swings between zero and \(V_\text{peak}^2/R\).
  2. What heats the coil and moves the air is the average power over a cycle, so we need the average of \(\sin^2\theta\).
  3. An arrow of length 1 casts shadows \(\cos\theta\) and \(\sin\theta\) on two walls at right angles (chapter 6), so \(\sin^2\theta + \cos^2\theta = 1\) at every instant (chapter 2's right triangle).
  4. Over a whole cycle, \(\sin^2\) and \(\cos^2\) are the same wave shifted by a quarter turn, so they have the same average. Two equal averages that add to 1 are ½ each.
  5. Average power is \(V_\text{peak}^2 / 2R = (V_\text{peak}/\sqrt2)^2 / R\). The RMS voltage is the steady voltage that would heat the resistor just as much.
Where it breaks: √2 is only for sines

A square wave spends all its time at ±peak, so its RMS is the peak itself. At the same 12.6 V peak into 8 Ω, a sine delivers \(12.6^2 / (2 \times 8) \approx 9.9\) W and a square wave \(12.6^2 / 8 \approx 19.8\) W, twice as much. An amplifier that clips hard (section 3) flattens its sine toward a square, so it pushes more power into the speaker than its sine rating suggests, much of it at the high harmonics a square wave is made of. RMS is still the right idea; only the √2 changes with the shape.

What RMS voltage drives an 8 Ω speaker at 10 W?

\(V = \sqrt{P R} = \sqrt{80} \approx 8.94\) V RMS, a 12.6 V peak, so the amplifier's supply has to be at least ±13 V (or 26 V for a bridged class D). Doubling the loudness you hear takes about ten times the power.

A 4 Ω speaker on the same amplifier, at the same voltage, takes twice the power of an 8 Ω one. Why can that be a problem?

Twice the power means twice the current through the output transistors (\(I = V/R\)), and their heat grows with current. An amplifier rated for 8 Ω may overheat, or shut down, on 4 Ω. That's why speakers and amplifiers state their impedance.

That's Part I: every idea on its own, in a simulator. Part II builds real things from real chips, one project per chapter, each using the theory you now have: next, reading a schematic and building a 555 blinker. Chapter 21's speaker amplifier puts this chapter to work. And the radio course is where filters, mixing and audio meet again, in software.

Previous: Hands-on · All chapters: Learn & build.

Last updated