# Variable Gain Stages

This chapter deals with amplifier stages that are required to have a variable gain, usually over a wide range of +20 dB, +30 dB, or more. It does not include volume controls, which typically only have a maximum gain of +10 dB or so and have their own chapter (Chapter 13). Nor does it include balanced microphone preamplifiers, which can have a variable gain range of 80 dB or more, and also have their own chapter (Chapter 17).

These amplifier stages are very common in audio electronics. A typical application would be a guitar amplifier input that has to cover a range of playing styles and pickup sensitivities. Another major use is in compact mixers that have only one control performing the functions of both input gain control and channel fader.

The examples given in this chapter have a maximum gain of +30 dB. In some places, it is assumed that ideally the gain law would be linear in dB. This not always the case; if the gain control will spend almost all its working life at mid settings, making the gain change faster at high and low settings will allow the middle gain range to be more spread out, giving easier adjustment.

Pot rotation is described here as the Mark on a scale calibrated 0–10, so Mark 5 is the middle setting and Mark 10 the maximum. No provisions are made for turning anything up to 11 (Spinal Tap reference).

## Amplifier Stages With Gain From Unity Upwards: Single-Gain Pot

In many cases a minimum gain of unity (0 dB) is quite acceptable, and this simplifies matters considerably. A series-feedback amplifier configuration can be used, which inherently has a minimum gain of unity, and can also provide a high or very high input impedance. In contrast, a shunt-feedback amplifier can have gain adjustable down to zero but will have a relatively low input impedance, which may vary with the gain setting. This can be addressed by putting a unity-gain buffer in front of the gain control, but its noise is being added at the most sensitive part of the circuit, and this is usually not a very good idea.

If we require gain from unity upwards, this is best achieved by varying the amount of negative feedback. The simplest way to control the feedback factor is to make one of the resistors in the feedback network variable. Figure 8.1a shows how not to do it; this works OK at high gains, but at low gains, the resistance of RV1 is low and, in conjunction with R2, puts an excessive load on the opamp output. If the opamp is happy with a 1 kΩ load, then R2 could be increased to 1 kΩ, with the value of RV1 increased proportionally. That will solve the loading problem but gives a relatively high-impedance feedback network that will be noisy.

The method shown in Figure 8.1b is often a better choice. The variable resistor is now in the bottom arm of the feedback network. This means that the opamp output can never see a load less than R3 + R2. The downside is that at low gain settings, the impedance seen by the inverting input is relatively high; at high gain settings, it reduces to the value of R2. Thus the equivalent input noise is lower at high gains, keeping the noise output low.

If a linear pot is used for RV1, the gain law is a long way from linear in dB, as shown in Figure 8.2. When the control is turned clockwise, virtually nothing happens for the first 80% of rotation, and 20 of the 30 dB gain range is constricted into the last 10% of rotation. The obvious answer is to use an anti-log pot, where the resistance changes more rapidly at the start of rotation. This is demonstrated in Figure 8.2, where the gain laws are compared with the dotted ideal linear-in-dB line; the pot laws are anti-log C and ant-log D as used by Alps. Both are a considerable improvement on linear, making the control usable, but the D-law is clearly the better of the two. However, even the D-law is some 6 dB away from the ideal line for most of the pot rotation.

It appears as if the C-law may be implemented with two resistance slopes on the track and the D-law with three, though this is speculative. Be aware that it is usually necessary to read the law of a pot from a rather small graph on the data sheet, so the accuracy is limited.

The gain does not go down as far as unity (0 dB), because this would require the maximum value of RV1 to be infinite. That is a limitation of this configuration, though in many cases a minimum gain of 1 or 2 dB would not be a big problem.

Both circuits in Figure 8.1 have the disadvantage that the gain depends on the track resistance of the pot, which is unlikely to have a tolerance closer than ±20%. This makes stereo gain control tricky –channel balance will be poor, especially if dual or triple slopes are used.

A better gain control law can be obtained from a linear pot if it is arranged so that the entire track is always in the feedback network, with the wiper position deciding how much of it is in the upper feedback arm and how much in the lower. This is illustrated in Figure 8.3; the a-version uses the pot alone, while the b-version has pot-loading resistor R3 added to give some control over the law shape.

The resulting gain laws for linear, C-law, and D-law pots are shown in Figure 8.4. Because both halves of the pot are controlling the gain, a linear pot gives a better law than when it is used only as a variable resistance. To a first approximation, variations in track resistance will cancel out and not affect the gain. Also, now the gain can be reduced to exactly unity.

As Figure 8.4 shows, the linear law gain increases by 12 dB in going from 9 to 10, whereas in Figure 8.2 it increases by 21 dB. The new law is more usable, but still a long way from the dashed linear-in-dB line. Using a C-law pot gives a much closer fit to the ideal line, the resulting gain law being only 2 or 3 dB away over most of the pot travel. Using a D-law pot now gives worse results, further away from and above the ideal line.

It may be that only linear pots are available. In this case, the circuit of Figure 8.3b will be useful.

The loading resistor R3 has no effect on the minimum or maximum gain but increases the gain in the centre portion of pot travel. This is demonstrated in Figure 8.5.

When the pot wiper is at the top of the track (i.e. minimum gain), R3 is connected from the opamp output to ground through R2 and so directly loads the opamp. This puts a minimum value on it if good opamp distortion performance is to be preserved. The lowest recommended value with a 5532 opamp is 620 Ω, but improve the gain law over R3 =1 kΩ, as shown in Figure 8.5. With 620 Ω, there is a good linear-in-dB law from 0 dB to +20 dB, but the last 10 dB of gain comes in too fast. In applications where this amount of gain is rarely needed, this may be acceptable. The only way to prevent improve it is to use C- or D-law pots, as demonstrated in Figure 8.4.

## Amplifier Stages With Gain From Unity Upwards: Dual-Gain Pot

If only linear pots are available, a better approach to a linear-in-dB law can be obtained by using a dual pot, with the sections cascaded, as in Figure 8.6a. This gives a modified square-law gain characteristic (modified because of the loading effect of the second pot section on the first pot section), which fits very well with our 0–30 dB ideal line, especially when loading resistor R3 is added as in Figure 8.6b.

Figure 8.7 shows that the gain law for the circuit of Figure 8.6a is close to the dashed ideal line, being within 2 dB of it. Adding a 4k7 loading resistor R3 increases the gain slightly in the middle of the pot travel and puts the gain law nicely on top of the ideal line. This is more than good enough for the normal use of audio equipment.

You might think that because there are two 5 kΩ pots, it would be necessary to halve the value of R2 to get the same +30 dB maximum gain; this is not so. At maximum gain, the first half of the pot is short circuited by the wiper position of the second half of the pot and plays no part in setting the gain.

## Combining Gain Stages With Active Filters

Combining one stage with another so that less total parts are needed to perform two functions is certainly good practice economically but rarely done unless really necessary, because it is usually difficult to design a stage so that the two functions do not interact or interfere with each other. An application in which a special effort to do it is worthwhile is the stereo input module of a mixing console, which has to fit approximately twice the amount of circuitry into the same space. The facilities available often have to be simplified somewhat, if only to avoid unwelcome quadruple pots. Here I demonstrate combining a variable-gain stage with an active filter.

Figure 8.8 shows a second-order high-pass filter with -3 dB cutoff at 50 Hz and a Q of 0.707 (Butterworth maximally flat) combined with a variable gain from unity to 10 times (0 to +20 dB). This is the sort of gain range that might be found on a mixing console line input, and the high-pass filter is used to reduce mic proximity effect and environmental rumblings. The Sallen and Key filter is conventional except that both R2 and the inverting input of A1 are driven from the wiper of pot RV1; this means the filter characteristic does not change with the gain. The cutoff frequency is nominally 50 Hz, but actually nearer 48 Hz as a result of using E24 resistors; this is of no consequence. The -3 dB point is of course with reference to the passband gain, whatever it might be set to be. The maximum gain is actually +20.8 dBu, which is as close as you can get with E24 resistors and E3 pot values; customers might complain about slightly too little gain range, but they won’t complain about a little more than spec.

Filters like this need to be switched out when not required; since the stage also gives gain, it cannot simply be by-passed by a changeover switch. Instead, SW1 performs this function very neatly, removing the filter action without affecting the gain control. Note that it is not necessary to switch both capacitors out separately; only one switch section is required, which is very desirable, as it means a 2 c/o switch can be used rather than a more expensive 4-c/o part.

There will be a small offset voltage at the top of R1 due to the opamp bias current. It is assumed that there is a DC blocking capacitor at the output of the previous stage so no current will flow through SW1 and there will be no clicks when it is operated.

Other combined stages described in this book are a combined balanced line input and balance control (see Chapter 18) and a tone control combined with a balance control (Chapter 15).

## Amplifier Stages With Gain From Zero Upwards: Single-Gain Pot

Sometimes a minimum gain of unity is unacceptable; it has to go down to zero. Such input stages are commonly used in compact mixers with only one control per channel performing the functions of both an input gain control and a channel fader. Therefore, not only must the stage have a reasonably wide gain range, but that gain must go down to zero.

This means that an ideal gain law cannot simply be linear in dB, because at one end it has to go down to -infinity dB. What we can do is have a linear-in-0dB law down to a certain point, say the 20% point (Mark 2) and then make the gain fall rapidly to zero from there; see Figure 8.9.

The ideal line used here passes through 0 dB at Mark 2, and +30 dB at Mark 10. Its equation is:

$y\text{\hspace{0.17em}}=\text{\hspace{0.17em}}3.75x\text{\hspace{0.17em}}-\text{\hspace{0.17em}}7.5$ (Equation 8.1)

The required functionality can be obtained with a single-gang pot, as shown in Figure 8.9; the wiper is grounded, so the left-hand part of the pot track controls the gain, while the right-hand part controls the attenuation introduced after the gain stage. As the control is turned counter-clockwise, the resistance in series with R2 increases, while at the same time, the loading on R4 is increased, increasing the attenuation.

The result for both C- and D-law pots is shown in Figure 8.10, along with an ideal line that hits 0 dB gain at Mark 2 of rotation. The C-law result is closer to the ideal line around the middle of pot travel, but the D version is not much worse. Both laws give a rapid gain increase between Mark 8 and Mark 9, but this may be no disadvantage if, as is likely in most cases, the upper gain extremes are less commonly used.

Note that the output is in general not at a low impedance; the maximum output impedance (at maximum gain) is 33 kΩ in parallel with 5 kΩ, which equals 4.34 kΩ. If the next stage requires a low-impedance drive (such as an EQ stage), then you will have to add a unity-gain buffer.

Ideally, as the control is turned counter-clockwise, the gain should reduce smoothly to unity, after which the attenuation starts from unity and increases until the output is zero. This is not feasible with an ordinary pot, though something could perhaps be contrived using special balance pots that have half the track made of low-resistance material (see Chapter 14). With the circuit here, there is always a combination of gain and attenuation; they overlap. This reduces the headroom because it breaks the rule about not amplifying then attenuating. I have always called this the overlap penalty; it has nothing to do with football.

Assume that we have our gain control set halfway, i.e. at Mark 5. In this case, the gain is +17.4 dB and the attenuation afterwards is -6.7 dB, giving an overall gain of +10.7 dB. But … the amplifier will clip, assuming +22 dBu (10 Vrms) is its maximum output, when the input level is only +4.6 dBu. If there was no overlap penalty, then the maximum input would be 22–10.7 = + 11.3 dBu, which is 6.7 dB greater than +4.6 dBu. This demonstrates that the amount of headroom lost is the amount of attenuation.

Figure 8.11 shows the attenuation given by Figure 8.8 for C- and D-law pots; the minimum loss of headroom is 1.6 dB, but it rapidly gets worse as the pot is turned counter-clockwise. The D-law gives more attenuation in the middle part of the pot travel and so the headroom loss is more severe. If we consider Mark 3, the headroom loss is 12 dB with the C-law and 17.5 dB for the D-law. Thus if either gain plot in Figure 8.10 is acceptable, you should go for the C-law, as it will give you 5.5 dB more headroom at this gain setting.

Apart from headroom issues, there is another disadvantage if this circuit is used in a stereo format. Log or anti-log pots have poor matching compared with linear ones due to the extra tolerances involved in making two- or three-slope resistive pot tracks. Gain matching between two stereo channels is not likely to be good.

The offness with the pot fully counter-clockwise will not be very good compared with a simple pot, because in pots, the resistance between track and wiper is greater than the end resistance where the track is connected to the terminals, and at Mark 0, all of the current from R4 flows through it to ground. With ordinary parts, -65 dB should be achievable.

## Amplifier Stages With Gain From Zero Upwards: Dual-Gain Pot

The loss of headroom and problems of stereo matching mentioned earlier caused me to look for a better way. There is no obvious way of doing anything else with a single pot, but if we allow ourselves a dual pot, there are interesting possibilities, one of which is shown in Figure 8.12. A dual linear pot is used to reduce the stereo matching problems. The first half of the pot controls the feedback to the amplifier, varying the upper and lower feedback arms together, as in Figure 8.3. This gives a better control law than just varying one arm, but the gain is still too low in the middle, coming up fast at the end; see the “Lin” trace in Figure 8.4. This is compensated for by the attenuation law implemented by the second half of the pot, which has a powerful pull-up resistor R4, which reduces the attenuation at mid-travel and so reduces the headroom loss. It looks very much like half of a panpot (see Chapter 22). Be aware that R4 is connected almost directly from the amplifier output to ground at low gains, and the loading effect on the amplifier must be considered. If you are using 5532s, then a 5 kΩ pot and a 1 kΩ pullup resistor are about as low as you want to go if a good distortion performance is to be preserved. This is demonstrated in Figure 8.13, where the upper trace is the gain and the lower trace the attenuation. The trace in the middle is the combination of the two.

The attenuation is much less over most of the control range due to the effect of R4. Without R4, the attenuation would be –6 dB at Mark 5; with it, the attenuation is only –2.5 dB. Compare 2.5 dB of headroom loss with 6.7 dB loss for the one-pot circuit of Figure 8.8. Comparing Figure 8.10 with Figure 8.12, the headroom loss is much reduced over all but the lowest gain settings.

However … comparing Figure 8.9 with Figure 8.13, we can see that the combined gain law of the latter is much less of a linear-in-dB straight line, rising quite steeply from +12 dB at Mark 8 to +30 dB at Mark 10. We have said earlier that faster action at the control extremes is not necessarily a disadvantage, but this is too much. There is not much we can do with the attenuation stage, as it already has a pullup resistor R4, so we had better focus on the gain law.

This can be modified to pull the gain up in mid-travel by adding a pulldown resistor R3, as shown in Figure 8.14. This gives us the gain law in Figure 8.15, with the overall gain at mid-travel (Mark 5) increased from +3 dB to +11 dB. This gives a rather nicer overall gain law, though still with a rather quick rise at the high gain end, going from +17 dB at Mark 8 to +30 dB at Mark 10. This is about as far as we can go with this approach, as R3 is connected almost directly from the amplifier output to ground at low gains; at the same time, R4 is putting its worst loading on the amplifier. What helps us here is that when the loading is at its worst, the gain is zero, and no distortion will get through to the output.

Once again, how close the output can get to zero is limited by the wiper-to-track resistance of the attenuator pot, and something like -65 dB is likely.

The stereo balance of two of these circuits will be much improved over that obtained with log and anti-log pots, but it will not be perfect. This is because while the fixed resistors can be chosen as 1% parts, the tolerance of linear pot tracks is rarely better than 20%. The only way to deal with this, assuming more accurate pots are not an option, is to use a configuration like the Baxandall volume control, in which the effect of pot track tolerances is completely cancelled out; see Chapter 13. Unfortunately, the Baxandall control is a shunt-feedback configuration and does not offer a high input impedance. It’s great for a volume control, having been used by me for gains up to +26 dB, but not so good as an input stage.

## Switched-Gain Amplifiers

In Chapter 9, we see that the appropriate gain (at 1 kHz) for an MM input with pretensions to quality is between +30 and +40 dB, giving maximum inputs at 1 kHz of 316 and 100 mVrms, respectively. Lower gains give an inconveniently low output signal and a greater headroom loss at HF due to the need for a lower HF correction pole frequency. Higher gains give too low a maximum input.

The nominal output for 5 mVrms input (1 kHz) from a +30 dB stage is 158 mVrms and from a +40 dB stage is 500 mVrms. Bearing in mind that the line signals between pieces of equipment are, in these digital days, usually in the range 1–2 Vrms, it is obvious that both 158 mVrms and 500 mVrms are too low. If we put a fixed gain stage after the MM input stage, it will overload first, and the maximum inputs just quoted are no longer valid. It is therefore desirable to make such a stage switchable in gain to cope with differing conditions of cartridge sensitivity and recorded level. One of the gain options must be unity (0 dB) if the maximum MM inputs are to be preserved; having less than unity gain is pointless, as the MM stage will clip first. It would of course be possible to have continuously variable gain controlled by a pot, but this brings in difficult issues of stereo level matching; these are described in Chapter 13 on volume controls. It is not in my opinion necessary to have finer control of the post-MM-input gain than 5 dB steps.

If we are dealing with just MM inputs, then not many gain options are required. If we assume a +30 dB (1 kHz) MM stage with its nominal 158 mVrms output, then we need 6.3 times or +16 dB of gain to raise that level to 1 Vrms. This suggests that gain options of 0 dB, +5 dB, +10 dB, and +15 dB are all that are needed, with the lower gains allowing for more sensitive cartridges and elevated recording levels.

However, it will be seen in Chapter 10 that MC cartridges have a much wider spread of sensitivities than the MM variety, and if the MM input stage followed by the flat switched-gain stage is going to be used to perform the RIAA equalisation after a flat +30 dB MC head amp, a further +20 dB gain option in the switched-gain stage is required to ensure that even the most insensitive MC cartridges can produce a full 1 Vrms nominal output.

The stage in Figure 8.16 is derived from my Elektor 2012 preamp [1] and gives the gain options specified. The AC negative feedback is tapped from the divider R51–R60, which is made up of pairs of resistors to achieve the exact gain required and to reduce the effect of the resistor tolerances. The DC feedback for the opamp is always through R50 to prevent the opamp hitting the rails when switching the gain; the blocking capacitor C50 is more than large enough to prevent any frequency response irregularities in the audio band. Assuming the source impedance is reasonably low, an LM4562 will give better noise and distortion results than a 5532 section.

The correct setting for the gain switch can be worked out by considering cartridge sensitivity specs and recording levels, but the latter are usually unknown, so some form of level indicator is very useful when setting up. A bar-graph meter seems a bit over the top for a facility that will not be used very often, and a single LED indication makes more sense. For this reason, the Log Law Level LED was developed, giving about as much level information as can be had from one LED. It is fully described in Chapter 23 on metering. It is desirable that any level indication can be switched off, as not everyone thinks that flashing lights add to the musical experience.

## Reference

[1] Self, Douglas “Preamplifier 2012” Elektor, Apr/May/Jun 2012