>
I need to set the gain of an opamp in inverting config to -10 dB, 0 dB and +10 dB by changing the feedback-resistor. How do I manage this with a two-pole on-off-on switch? Of course, the off-position should be the 0 dB gain...
Steve's (revised) diagram does just what you asked, except it only uses one pole. Unless you get paid by how many poles you buy, this is "better than you asked for."
One possible re-revision: instead of two 10K on the throws, use one 10K between the pole and the (-) input. Save $0.12! This (if near the chip) also decouples stray capacity which may cause clicks or instability. But there may be practical reasons to use the "extra" $0.12 resistor to simplify construction.
>
it will have different input impedence for 2 of the switch settings, also switching directly on the inverting input will cause very loud clicks.
Samuel didn't set a spec for impedance, or clicks, though we assume he would not want something horrible. Steve's impedances are reasonable in many modern systems. If 6K/20K shifts are a problem, try scaling everything up 10X or 100X. Few systems will object to 60K/200K load changes, though some op-amps may have bias-current offset issues.
If constant input impedance is vital:
{edit... see below}
>
I always thought -10dB with op-amps ment 10dB gain with inverted polarity..
When stating gain as a
numeric ratio, such as "1:10" usually written just "10", you use mathematical Multiplication. 1 volt in, gain of 10, 10 volts out. Here, the "-" works as polarity or sign: 1 volt in, gain of -10, -10 volts out.
AudioFools be darned, in audio the Polarity is never as important as the Magnitude. There is no use having the "right" polarity if the magnitude is too small to hear or too large to stand. 99 times out of 100, even with trained listeners, polarity can be either way and nobody can say which is right by listening. The deciBel system simply specifies magnitude ratio, and has no way to specify polarity. deciBels are positive numbers for ratio greater than one (gain), and negative numbers for ratios less than one (loss).
Voltage
Ratio _____ dB
100 _____ +40
10 ______ +20
3.2 _____ +10
1 ________ 0
0.32 _____ -10
0.1 ______ -20
0.01 _____ -40