A Class D amplifier is a switching amplifier that converts an analog audio signal into a high-frequency pulse-width modulated (PWM) square wave to drive speakers with over 90% efficiency. Unlike traditional Class AB designs that burn excess voltage as heat through linear transistors, building a DIY Class D amp fundamentally changes your circuit by replacing massive aluminum heat sinks and heavy iron transformers with tiny surface-mount MOSFETs and high-frequency inductors. The most common misconception on the workbench is confusing 'Class D' with 'digital' audio; the signal path is entirely analog, using continuous voltage comparisons, not discrete binary code.

The Core Mechanism: PWM and the Output Filter

To understand how a switching amp generates sound, you have to look at the comparator stage. Your analog audio signal (20 Hz to 20 kHz) is fed into one input of a high-speed comparator, while a high-frequency triangle wave (the carrier) is fed into the other. When the audio voltage is higher than the triangle wave, the comparator output switches to the positive rail. When it drops below, it switches to the negative rail. This generates a PWM square wave where the duty cycle directly represents the instantaneous audio voltage.

This raw PWM signal is a violent, high-frequency square wave that would instantly destroy a tweeter and sounds like harsh static. It must be smoothed back into a continuous analog waveform using an LC low-pass filter. The inductor resists rapid changes in current, while the capacitor smooths the voltage, effectively averaging the high-speed pulses back into the original audio wave.

Bench Tip: Most standard DIY Class D chips like the TPA3116D2 operate at a 400 kHz switching frequency. This places the carrier wave far above the 20 kHz human hearing limit, making the LC filter's job much easier and preventing audible switching noise.

By the Numbers: Efficiency and Heat Dissipation

The primary reason makers and manufacturers flock to Class D topology is thermal management. Let's run a worked numeric example to see exactly what this changes on your workbench when designing an enclosure.

Assume we are driving a 4-ohm bookshelf speaker to 50W RMS. In a linear Class AB amplifier, the output transistors act like variable resistors. Even under optimal conditions, Class AB efficiency peaks around 50% to 60%. Let's use 50% for easy math.

  • Power Drawn from Supply: 100W
  • Acoustic Power Output: 50W
  • Heat Dissipated: 50W (Requires a massive extruded aluminum heat sink and forced air cooling)

Now, look at the same 50W RMS output using a modern Class D topology operating at 90% efficiency. The MOSFETs are either fully on (low resistance) or fully off (zero current), meaning almost no power is wasted as heat.

  • Power Drawn from Supply: 55.5W
  • Acoustic Power Output: 50W
  • Heat Dissipated: 5.5W (Can be handled entirely by the PCB copper pour or a tiny TO-220 style clip-on fin)

This 45W difference in heat is why a 1000W car audio Class D amplifier can fit inside a chassis the size of a paperback book, while a 1970s Class AB receiver delivering 100W weighs 40 pounds and acts as a space heater.

Where You Meet This in Practice

You are likely already using Class D topology daily without realizing it. Because of the drastic reduction in size, weight, and heat, switching amplifiers have conquered specific market segments:

  • Active Subwoofer Plate Amps: Modules like the Dayton Audio SPA250 mount directly to the back of a speaker cabinet. A Class AB amp here would require deep cabinet intrusion for heat sink clearance and massive ventilation slots.
  • Portable Bluetooth Speakers: Battery-powered devices rely on Class D. A boost converter steps a 3.7V Li-ion cell up to 12V or 24V to feed a switching amp, maximizing battery life while delivering punchy audio.
  • Car Audio: Generating 1000W+ from a vehicle's 14.4V alternator rail is only practical with Class D. Linear amps would draw so much current and generate so much heat that they would melt standard automotive wiring harnesses.

Bench Scenario: Building a 100W DIY Class D Amp (And What Went Wrong)

Theory is clean; the workbench is messy. Here is a real-world scenario walkthrough of a common DIY build, highlighting a frequent failure mode.

The Setup: A maker buys a generic $18 TPA3116D2 2x50W breakout board online. They power it with a salvaged 24V 5A laptop power brick and connect two 4-ohm bookshelf speakers. According to the Texas Instruments TPA3116D2 Datasheet, 24V into 4 ohms should yield roughly 50W per channel.

The Numbers: Expected output is 2x50W RMS. The power supply is rated for 120W total (24V x 5A), which seems sufficient for the 111W total draw calculated in our efficiency math above.

The Outcome: At low volumes, the amp sounds crisp and detailed. But when the bass drops and volume increases, the audio harshly clips, and a high-pitched idle hiss becomes audible through the tweeters during quiet passages.

What Went Wrong: The issue is Power Supply Rejection Ratio (PSRR) degradation and unregulated supply sag. Cheap laptop bricks are unregulated; under heavy bass transients, the 24V rail sagged to 19V, causing immediate clipping. Furthermore, the laptop brick's own internal switching noise coupled onto the DC rail. While the TPA3116D2 has excellent PSRR at low frequencies, its ability to reject power supply noise drops significantly at higher frequencies. The brick's switching noise bypassed the amp's internal rejection and rode the PWM signal straight to the speakers.

The Fix:

Safety Warning: When upgrading to an open-frame power supply like a Mean Well unit, you are dealing with exposed mains voltage terminals. Always de-energize the circuit, verify dead with a multimeter, and ensure the chassis is properly earth-grounded before testing. Local electrical codes may require a licensed professional for permanent mains wiring.
  1. Add Local Energy Storage: Solder a 10,000µF 35V low-ESR electrolytic capacitor directly across the VCC and GND pads on the amp board. This provides instantaneous current for bass transients, preventing rail sag.
  2. Upgrade the Supply: Swap the laptop brick for a regulated Mean Well LRS-150-24 (approx. $25). This provides a rock-solid 24V rail under load and features built-in EMI filtering that prevents high-frequency noise from coupling into the audio path.

Frequently Asked Questions

Q: Do I need a DAC (Digital-to-Analog Converter) to use a Class D amp with my computer?
A: No. Despite the 'D' designation, Class D amplifiers are analog devices. They require an analog line-level input (like from a standard 3.5mm headphone jack or RCA outputs). If you are building a fully digital signal chain, you would need a DAC to convert the PC's digital audio to analog before it hits the Class D amp's comparator stage.

Q: Why do Class D amps specify a minimum load impedance (e.g., 'Do not use below 2 ohms')?
A: This comes down to the LC output filter and MOSFET shoot-through. Lower impedance speakers draw higher peak currents. If the impedance drops too low, the current spikes can exceed the MOSFET's safe operating area during the switching transitions, causing thermal runaway. Additionally, the LC filter's Q-factor changes with the load, which can cause severe frequency response peaking or instability if the speaker impedance is too low.

Q: Can I bridge two channels of a stereo Class D amp for more power?
A: Generally, no. Unlike some Class AB amps, most standard DIY Class D chips (like the TPA3116D2 or TPA3118) are designed as BTL (Bridge-Tied Load) internally per channel. Attempting to bridge the outputs of two separate channels will usually result in a dead short across the MOSFETs, instantly destroying the silicon. Always check the specific IC datasheet on Analog Devices or TI's application notes before attempting to bridge outputs.