Why is the calculated current with P=VI and R=V/I not equal?

I'm just starting to learn electronics. I thought I'd start with a simple project of attaching a speaker to a Raspberry Pi (it supplies 3.3V). The speaker I've picked is an 8Ω 0.5W speaker. Now as I understand it, I need an amplifier in order to use this speaker. So I've picked a 3W amplifier.

I have to make sure that I don't use more than 0.5W so I don't blow up my speaker. The amplifier gives the following information:

3.3V into 8Ω @ 10% THD - 0.8W max
3.3V into 8Ω @ 1% THD - 0.6W max

As I understand it, THD (Total Harmonic Distortion) is the amount of false data being added to the output so not only would we want that to be lower for quality, but it seems that the lower it is, the less power consumed as well. (Bonus question: How can I make my THD be 1%?)

However, even if I can ensure a THD value of 1%, I still need to shave off .1W to save my speaker. I thought about adding a resistor in series with the speaker and it seems that a 1Ω or 2Ω resistor would do the trick but I can't figure it out mathematically.

While trying to figure this out, I calculated the current using P=IV (I = .6W / 3.3V = .182A) and using R=V/I (I = 3.3V / 8Ω = .413A). Why aren't the current values the same? (Side note: this happened to me when I was trying to solve Exercise 1.6 in The Art of Electronics as well.)

The main question I want answered is why aren't the current values the same, but if you could help me figure out how to save my poor little speaker, that would be great as well. =]

• If you calculate the resistance for your IV in the first calculation it results in 18 ohms, not 8. – Benjamin Wharton Nov 4 '16 at 5:41
• @Benjamin Exactly. And if you take the second current and plug it into the power equation, you get 1.36W instead of .6W. How can this be? – Aust Nov 4 '16 at 6:15
• I'm kind of gobsmacked by the described class-D operation. The IC is designed for filterless operation (on the output.) They depend upon the speaker characteristics, electrical and as an air transducer, plus human ear qualities (none of which they cannot possibly know all that well.) So I suspect your satisfaction may vary. AND -- a BIG AND -- I'd not recommend long leads.. at all. All I can imagine if you aren't careful about wiring is adding more they didn't understand plus radiation of all those switching frequencies! Egads. Lots of digital data to send, too, by the way. Keep it in mind. – jonk Nov 4 '16 at 6:43
• First, read Your The Art of Electronics from cover to cover. Audio amplifier with speaker is nor passive, nor linear element. Your simple equations are useless here. – Jakub Rakus Nov 4 '16 at 6:45
• You've misunderstood how speaker and amplifier specifications are described. "3.3V into 8Ω @ 10% THD - 0.8W max" means if you drive an 8Ω speaker (at 3.3V) at 0.8W then the THD will be 10%. That is, the more power you're putting through the system, the worse it sounds; as the components start to get driven at their limits, the signal degrades. THD is a byproduct, not a designable value, so there is no need to 'shave off 0.1W': just give the speaker less power! – CharlieHanson Nov 4 '16 at 9:36

I'm going to take a shot at answering your question and I'll defer to those who know better about class-D amplifiers. I know almost no details about them as I've never tried to make one. I basically know that they place a speaker across a MOSFET H-bridge, operate the MOSFETS as switches, and use ultrasonic frequencies. The output is averaged (well, other than with this one) by using a low-pass output filter (often Butterworth.) In this case, though, the IC doesn't suggest an output filter, instead claiming that it uses the electrical speaker characteristics, the additional filtering caused by its transducer effect driving energy into the air (dry, wet, at sea level, or at 1000 m, all treated the same), and by human audio transducer responses, limitations, and brain processing.

There's no inherent power supply rejection.. at all.. in a class-D. But perhaps that is finessed inside this IC using global negative feedback.

I'm not entirely confident about this particular IC approach. With unknown characteristics, they have to make "plausible" assumptions. So I expect variations in frequency response, etc. It's probably not at all important here, though.

With a traditional amplifier and rail-to-rail magical output drivers, not as a bridge-tied load, you figure that you need two rails, plus ground, with the two rails each being rated $V_{pk}\ge \sqrt{2 P R}$. (You usually add some for overhead, after that.) If you could somehow magically construct a good quality, low impedance center rail at 1.65 V (in between your 3.3 V and ground) and tie one side of your speaker to it, then you might expect as much as $170\:\textrm{mW}$ from your $8\:\Omega$ speaker. Not really, though, because your output driver would still require headroom. With a traditional bridge-tied load, you might expect to see as much as 4 times that, or $680\:\textrm{mW}$.

This class-D amplifier is like a bridge-tied load amplifier, except that it should be much more efficient than a bridge-tied amplifier would be. So it will dissipate less power itself while delivering power into a speaker.

A minor detail about class-D, as I understand things, is that efficiency goes down as you reduce the volume (by changing the digital data you are sending along.) But that's just a side-effect of the fact that they are very efficient when at fuller volume.

The bottom line here is that class-D amplifiers work great off of a single power supply rail because they work similarly to a bridge-tied load amplifier. They dissipate less power than a bridge tied amplifier, when delivering equivalent power into a given speaker, because they operate their active devices as switches and not in linear mode. They exhibit ultrasonic switching at their outputs, which are normally low-pass filtered in some way (either by an explicit output filter plus or by using the speaker and air as a low pass filter.) (If an explicit output filter isn't done then the wiring to the speaker should be kept very short.) And they probably can achieve closer-to-the-rail outputs with less headroom required. Other than that, they deliver similar (though slightly more) power to a speaker using a single rail as a bridge-tied load might achieve.

So:

1. Traditional amplifier uses two rails, one end of speaker at ground. A complementary emitter follower stage will likely require more operating headroom than a complementary common emitter. But either way, a few additional volts of headroom on either/both rails is required. Each rail is nominally $\ge \sqrt{2 P R}$, before such adjustments.
2. Bridge tied load uses one rail and ties the speaker between what amounts to a split-phase pair of H-bridge-like output stages. Again, these may either be complementary emitter follower or complementary common emitter designs, requiring a few additional volts. The single rail is nominally $\ge \sqrt{2 P R}$, before headroom adjustments.
3. Class D uses one rail and ties the speaker between two H-bridge output stages. These output stages are operated at ultrasonic frequency and often only require very little headroom to operate. The single rail is $\ge \sqrt{2 P R}$. Dissipates less amplifier power than the other two.

Don't worry about hurting your speaker. Operating correctly and at $3.3\:\textrm{V}$ at the rail and given the modest but still existing drops across the switches, it's very unlikely you will exceed $600\:\textrm{mW}$ into $8\:\Omega$. Besides, you can control the volume by adjusting the data values you send it. Just tweak the values down a bit, if worried.

Speaking of which, this device looks very, very data hungry to me. I think you will have lots of fun shifting data into it. And converting .WAV files or whatever else into that digital data that needs to be properly formatted for this IC. I suppose there is already software to handle all that for you, though.

Final note. I'm just making educated guesses here, as one hobbyist to another. As I said, if someone else knows this stuff cold and tells you I'm wrong.. chances are, I am. I don't have specific experience with class-D and I'm winging it, looking at the datasheet and just thinking for a moment about what arises in mind as a result.

Speakers are not characterized on an exact resistance.

$8\Omega$ is the given impedance and is just an approximate value of the resistance over the frequency range. There are many dips and bumps at different frequencies.

So don't put a speaker in a circuit expecting an exact value.

But you're going about this in the wrong way. What you're missing is that the amplifier characterization is based on the signal input to it. IF you put a lot of signal into it, the amp will duly amplify it, deliver 0.8W into the load and sound terrible (10% THD).

IF you put less signal into the amplifier, it will deliver 0.6W, and it will sound just fine (depending on how snobby you want to be).

This has to do with the fact that if you drive the amplifier into clipping, it will deliver 3.3V into the speaker for a longer period of time. This increases the power delivery (and the volume of the sound) but it also will increase the distortion and create harmonics that weren't in the original signal.

The best way to prevent this from happening is to limit the signal going into the amp to a level that will give you the power output you want. You need to consider the voltage gain of the amp (for a 3.3V output amp, this may be quite small) and keep your output signal somewhere in the ballpark of

$$P={V^2 \over R}=0.5W_{RMS} = {(X\;V_{RMS})^2 \over 8\Omega}$$

$$X = \sqrt{0.5W_{RMS} \times 8 \Omega} = 2 \; V_{RMS}$$

And for a sine wave (which music is not!),

$$\sqrt{2} \times 2 \; V \; RMS = 2.8V_{pk-pk}$$

This should give you a place to start. AoE talks about all of this, but it's easy to lose your way in the depths of the material.

The currents are not the same because the power is not the same. There are two different values of power at the resistor. A speaker isn't actually an 8 Ohm resistor, but let's assume it for your calculation. In the first case you limited the power to 0.6 Watt. In the second case, the power is 3.3^2/8=1.36 Watt. You are not going to see 3.3 Volts at the load if you limit it to .6 Watts. You will only see 2.2 volts.

Given that, the thing you want is called an L-pad. Using 2 resistors one in series and one in parallel will give the reduction you need but keep the 8 ohm. Search L pad and you will find the formulas you need.