Class-D amplifier from parts
Compare the audio with a fast triangle wave and you get pulses whose width follows the audio (PWM). Two MOSFETs switch the speaker side hard between 0 and 12 V, wasting almost nothing; an LC filter removes the 20 kHz switching and leaves the amplified audio.

Open this lesson in the labFree, in your browser, no account needed.
How it works
The duty swings ±(audio peak ÷ triangle p-p) = ±25 % about 50 %, so the switch node’s average swings ±3.0 V around 6 V.
The LC filter (f₀ = 7.34 kHz) passes 1 kHz almost unchanged (×0.903), and C_block removes the 6 V: about 2.71 V peak across 8 Ω, 459 mW.
Gain = 12 V ÷ 4 V = 3 from a 1 V peak input; efficiency is high because the MOSFETs are either fully on or fully off.
Try it on the bench
- Raise the audio to 3 V p-p: 75 % modulation. Above 4 V p-p it clips.
Parts on the bench
- Bench power supply
- 2 × Function generator
- Comparator
- Resistor
- P-channel MOSFET
- N-channel MOSFET
- Toroidal inductor
- Film capacitor
- Electrolytic capacitor
- Speaker
In the course
Electronics Engineering, module “Op-amps and feedback”.