Close

A deeper dive into the amplifier design

A project log for Amply - A $10 desktop BT amplifier you'll love

Building a great sounding amplifier for your desk on the cheap

marco-tabiniMarco Tabini 3 days ago0 Comments



It has occurred to me that, in the Design Walkthrough, I never really explained how the amplifier itself works from an overall design perspective. I thought it would be useful to do that, so here we are.

To understand why Amply is designed the way it is, we need to start with our desired result. At the output of the amplifier, we ultimately want to drive a certain amount of power into the speakers. Assuming that our desired power is 10W, and that the speakers have an impedance of 8Ω, we can calculate the required voltage and current using the following formulas:

This means that our amplifier has two distinct requirements: It needs to take our input signal (which, at full volume, is around 1Vrms) and amplify it to around 9Vrms, and it needs to be able to provide around 1.12A of current to the speakers.

In addition, we also want to:

There is no single device that can do all these things at once, so we need to break down the problem into smaller pieces. Hence the use of an op amp, which provides the voltage gain, and a power stage, which provides the current gain. The op amp also has a very high input impedance, and can use negative feedback to control the gain and stability of the amplifier.

Voltage gain

As mentioned in the design walkthrough, the op amp is configured as an inverting amplifier. This is needed because, while the input signal includes both a positive and negative component, our amplifier is powered by a single supply, which means that the output can only swing in one direction relative to ground.

We solve this problem by creating a “virtual ground” at the mid-point of the supply voltage, and then allowing the output to swing around that point. The inverting configuration has the distinct advantage of allowing us to inject the virtual ground directly into the non-inverting input of the op amp, which means that we don't need to use a separate buffer stage to create this signal.

The gain of the inverting amplifier is determined by the ratio of the feedback resistor (RV1) to the input resistor (R1):

The negative sign indicates that the output is inverted relative to the input—for all practical purposes, we can ignore the sign in our application, so long as both the left and right channels are inverted in the same way.

In our case, the maximum possible gain with a 50kΩ feedback resistor and a 1kΩ input resistor is:

Current gain

While the op amp has no trouble providing the voltage gain we need, it really cannot provide more than a few tens of milliamps of current, which is nowhere near the 1.12A we need to drive the speakers. If we plugged its output directly into the speakers, the only sound we would hear is probably that of the op amp going up in smoke.

The power stage of the amplifier is responsible for providing the necessary current to drive the speakers. In our design, we use a Class AB push-pull configuration, which consists of two complementary transistor pairs (one NPN-based and one PNP-based) that work together to amplify the current. I have already mentioned how this works, so I don't want to spend too much time on it here.

The key point, however, is that the power stage primarily amplifies current, not voltage. As you can see here, we need to use two transistors for each leg of the push-pull stage because power transistors typically have a much lower gain than small-signal transistors like the 2N3904 and 2N3906. By using a compound pair, we effectively multiply the gain of the two transistors, which allows us to achieve the necessary current gain to drive the speakers. The Sziklai configuration is particularly advantageous in our case because it requires less base current than a Darlington pair, which means loading the op amp less and allowing it to operate more efficiently.

Stability

As the old saying goes, an amplifier is just an oscillator that hasn't started oscillating yet. In other words, if we don't manage the feedback and stability of our amplifier properly, it can easily go into uncontrolled oscillation.

In order to work as an oscillator, an amplifier needs to exhibit both a loop gain equal to 1 and a total phase shift of 360º around the feedback loop (called the Barkhausen criterion).

Our amplifier is unlikely to oscillate at audio frequencies, and probably not until well into the MHz range, but we still add a small capacitor in the feedback loop (C7) to ensure that the gain rolls off at high frequencies (around 80kHz in our case), which helps prevent potential oscillation issues and also prevents ultrasonic noise from being amplified and introducing unwanted artifacts into the audio signal.

We also add C9, which is a small capacitor connected between the output of the op amp and ground, to shunt high-frequency noise and reduce the amplifier's gain at very high frequencies. This helps tame parasitic oscillations and reduce RF interference, particularly from the Bluetooth receiver.

Moah powah!

Although Amply's 10W output is more than enough to annoy an entire house full of people, I imagine that at least some folks might look through the design and wonder if it's possible to achieve even more power.

By this point, I have hopefully made it clear that the output power is really just a function of the voltage and current that we can provide to the speakers. Therefore, if we want more power, we need to find a way to increase either the voltage or the current (or both).

It's interesting to note that, in our design, the op amp's output voltage is effectively the limiting factor of the maximum effective gain that our amplifier can achieve. The NE5532 can swing to within about 1.5V to 2V of the supply rails under light load, which means that with, say, a 12V supply, the maximum output voltage is only somewhere between 1.5V and 10.5V. Thus, there is always a non-negligible amount of headroom that we cannot use to drive the speakers.

A possible solution to this problem would be to explore the possibility of using a rail-to-rail op amp, which can swing much closer to the supply rails, and see if that allows us to achieve a higher effective gain. That's in the works, so stay tuned for updates on that front.

Even with a better op amp, however, we would still be limited by the maximum operating voltage. I don't think I know of any audio-class op amps that can operate at more than 40V, giving us a theoretical maximum output power of roughly 25W into 8Ω from a single-ended Class AB output stage, which is still a far cry from the hundreds of watts that commercial amplifier manufacturers love to advertise.

Discussions