Elliott Sound Products | LM358 /LM324 Opamps |
Everyone knows that the LM358 opamp (or the quad version, the LM324 which uses an identical internal circuit) can't be used for audio. You'll find countless forum queries and answers that tell you so, and in a way they are right. There are much better opamps available for sensible prices, and for the most part there's no good reason to use an LM358 in any audio circuit. However, this opamp has some useful characteristics, and it's very low power, which may well be just what you need. However, the modification shown here means that the IC is no longer a true 'low-power' device. This is due to the extra current drawn by the resistor that's added to convert the output stage to Class-A.
The problem you'll face without modification is distortion, which can easily exceed 0.5% THD (total harmonic distortion). However, there is a way to use the LM358/ LM324 in such a way that the distortion falls to the levels you'll get with 'audio class' opamps, and in some cases it may be less. The 'fix' is nothing more complex than a resistor! If it's selected properly, the opamp's output stage operates in Class-A, which (at least in theory) makes it very usable indeed. Interestingly, a couple of the application circuits in the datasheets show this extra resistor, but don't explain the reason it was included.
This does not make it a recommended device for audio though. It can be made to work very well with low distortion, but it's not particularly quiet (the opposite in fact), and it has a fairly leisurely slew-rate (i.e. it's not fast). However, if you happen to need a buffer or an extra 6dB or so of gain in a 'line level' circuit and have a spare ½ LM358 on a layout, it can be used without compromising the audio path. Any pretense at low power is lost though, because the Class-A current can be several milliamps - far more than the IC normally draws (about 500µA).
One of the more endearing features of the LM358 is its ability to operate from as little as ±1.5V up to ±16V. That's an operating range that is almost unheard of with most others, making it useful for a wide range of applications. By adding a resistor, we can improve it even further, by eliminating the inherent crossover distortion. While this is easily measured at 1kHz, it become easily visible on a scope trace with frequencies above 10kHz or so.
The trick shown here isn't new - it's been demonstrated in several websites (which I found after I'd run my own tests), but it's hard to find the information if you don't understand the problem already. In addition, people have claimed for years that the same modification will 'improve' many other opamps, but that's generally completely untrue for any device that's characterised for audio performance. One would be ill-advised to use the technique described with an NE5532, OPA2134, LM4562 or any other very low distortion opamp. They don't need you to add anything, because they are already very well behaved, and have minimal distortion. Trying to force them into Class-A is more likely to increase distortion than improve matters.
The circuit itself is straightforward (compared to 'better' opamps at least), and it's designed specifically for low-current operation. There are four current sources/ sinks, numbered I1 to I4 on the drawing. The input stage is unusual, in that it allows the inputs to operate with a voltage that's up to 500mV peak below the negative supply voltage. This is (potentially) useful if the IC is used with a single supply, with the negative supply pin connected to ground. The LM358 is a dual opamp, and LM324 is a quad, which shares the same circuit. The pinouts shown are for the LM358.
Figure 1 - LM358 (LM324) Internal Schematic (One Channel)
When you look at the schematic of the IC you can see why distortion is a problem. There's no bias network to ensure that Q6 and Q13 are 'pre-biased', and the output stage is Class-B. Crossover distortion is inevitable! You'd normally expect to see a bias transistor (or diodes) between the base of Q5 and Q13, but in the LM358/ LM324 the bases are shorted together, so there is zero bias current for the output stage. I4 is a current sink which is intended to maintain conduction through output transistor Q6. However, with a rather measly 50µA, it doesn't take much signal level before it ceases to be effective. With a total load of 10k (the following load plus feedback network), the maximum signal level is only -500mV peak before I4 can no longer provide enough current to prevent distortion.
The solution is simple, and requires nothing more than the addition of one resistor. I took some measurements, and with 10k feedback resistors as shown in Figure 2, the distortion (without R4) was only a little higher than my oscillator's residual (<0.01%) with output voltage up to 400mV peak (280mV RMS). Above that, the distortion climbed rapidly. Adding the output 'Class-A' resistor from the output to the negative supply reduced the distortion back to the residual, with no evidence whatsoever of any 'excess' distortion. Of course, this is not a panacea, and doesn't magically convert the LM358 to a true 'audio class' opamp, but it does mean that it can be used in a non-critical area if needs be.
Q7 is the output current limiter, which sets the maximum output current to 40mA (typical), although it might be as low as 20mA according to the datasheet. It's obviously important to ensure that the extra current drawn by the added R4 doesn't push the peak current to any more than around 10mA with maximum positive output, or the current limiter will create a 'new' opportunity for distortion. The minimum value of R4 with ±15V supplies is 3.3k, but try to keep the value as high as you can, consistent with minimum distortion.
Figure 2 - Test Circuit With Class-A Operation
The resistor (R4, highlighted) needs to be selected so that it will always have some current flow. This is determined by the expected output voltage and the feedback network in parallel with the following load. If you expect to drive (for example) a 3.3k load (the following stage) with up to ±6V (4.25V RMS), then make R4 3.3k too. With ±15V supplies, the quiescent current through R4 will be about 4.5mA, and driving a 3.3k load the current through R4 won't fall below 2.7mA. That means that Q13 (the negative output transistor in the IC) is now redundant - it doesn't do anything. The positive output device (Q6) handles the full audio waveform, so is operating in Class-A for the full signal swing.
Be careful though, because if the value of R4 is too low you'll cause excessive dissipation in Q6 of the opamp, which will lead to overheating and possible failure. Ideally the extra current will be just enough to handle the peak audio level expected with the load impedance you're using. As a result, this arrangement isn't recommended if you need to drive low impedance loads with any voltage greater than around 1V. It's up to you to work this out for yourself.
To show the crossover distortion, I first used a 10kHz sinewave, with the output adjusted for 2V RMS output. The distortion can just be seen with 1kHz, but it's just a tiny glitch in the waveform. At 10kHz the distortion is much more visible because the opamp isn't fast enough to compensate. The distortion offset due to the 50µA current sink is clear, because the crossover distortion is shifted by -1V relative to the zero volt position. The internal current sink is almost exactly 50µA, as the total impedance of the feedback network is 20k (2 × 10k in series). 50µA with 20k is 1V, the exact offset you can see on the scope trace.
Figure 3 - LM358, 10kHz Response
Although I created a simulator model of the LM358 using the IC schematic, the results were not in line with the results I measured, so the scope results are shown for the output signal (yellow trace) and distortion residual (violet trace). My distortion meter has a maximum sensitivity of 0.1% THD full scale, and it's possible to measure down to 0.01% with reasonable accuracy. The oscillator I used (Project 174) has a residual distortion that's well below my measurement limit. In fact it's so low that the distortion meter's output consists mainly of the fundamental, because the meter cannot null any further. This sets the lower limit for measurements at around 0.01% THD.
Figure 4 - LM358, Feedback Resistors Only (No Load)
Figure 4 shows the distortion without R4. It measured 0.31% on my distortion meter, with an output level of 2V RMS, the distortion meter's output is shown by the violet trace, and it measures 760mV RMS, with a peak level of 2.2V (positive) and 3.2V (negative). The distortion itself is a nasty waveform, and the sharp spikes indicate a serious (and sudden) discontinuity. Although the distortion level might seem to be 'ok' (compared to some valve amps for example), the spiky nature of the waveform makes it very audible. This was (and is) a limitation of distortion measurements when the measurement is presented as a simple percentage, without the benefit of a waveform that lets you see the nature of the distortion. When this is omitted, you have no idea what to expect!
Figure 5 - LM358, With 'Class-A' Resistor Added (No Load)
Once the extra resistor (R4) is added, the distortion falls back to the residual of the oscillator and distortion meter. That shows as <0.01%, both at the input and output of the opamp circuit. The distortion waveform shown in Figure 4 is essentially identical to that from the oscillator, and consists primarily of the fundamental! There are no sharp discontinuities, only the residual fundamental plus some low-level harmonics. This indicates that the LM358 has contributed no measurable distortion (with the test equipment I have to hand) in this test. I also tested the circuit with a 2.7k load, and the distortion didn't change appreciably (it was a fraction higher, but remained 'benign').
Unfortunately, I'm not in a position to be able to afford an Audio Precision analyser, so my measurements are somewhat limited. However, it's a reasonable assumption that if the LM358 didn't contribute any excess distortion that I could measure, its actual distortion is well below 0.01%. Considering what came before, this shows that converting the LM358 to Class-A offers a benefit that belies the simplicity of the solution.
No matter what you do, the LM258 is never going to be an 'audiophile' opamp. However, by forcing its output stage to operate in Class-A, it is far better than most people give it credit for. However, it's no longer a 'low-current' opamp, because the Class-A current needs to be greater than any expected load current. While it would (at least in theory) be 'better' to use a current sink in place of R4, that would add quite a few more parts, but without any tangible benefits.
The only reason you'd use an LM358 for audio circuitry is if there's no other choice (which is rather unlikely). However, if you happen to be stuck and have nothing else available, converting its output to Class-A is a workable solution. In case you were wondering, using a resistor from the output to the positive supply also works, but nowhere near as well. The PNP output transistor (Q13) has comparatively poor performance, so bypassing it with R4 gives much better results.
At one stage (the idea seems to have gone away for the most part), this mod was suggested for other opamps as well, with (completely unsubstantiated) claims that it would 'improve' performance. In the vast majority of cases with decent (low distortion) opamps, adding the resistor is more likely to make the performance worse, and especially for devices with a limited output current. The LM358 is a little different from many others, in that it can source up to 40mA during the positive part of the output seemingly without any noticeable stress.
The tests I did are not subjective, and requires no BS explanation of how it will improve the 'sound stage' or any other parameter so beloved by the subjectivist brigade (to whom measurements are usually an anathema). This is just simple, straightforward engineering, allowing the use of an otherwise unusable opamp to perform well enough to be used in an audio circuit. It's also instructive in its own right, because it shows that a very basic opamp can still give very good results if you understand the problem properly in the first place.
You now have the ability to use that otherwise unused half of an LM358 in your project for something useful. With the addition of just one resistor, you can improve its distortion performance by at least an order of magnitude (×10), at a cost of only a few cents. One thing you do need to ensure is a very clean negative supply, as the opamp has great difficulty removing any supply noise passed through the added resistor.