Op-amp subtractor: problems supplying a fixed base voltage to be subtracted

The context is that of a simple sound-level meter. An electret mike, pre-amp (transistor), amplify with a 386 op-amp, detect the envelope of the waveform, and the output the level to an ammeter. (Simple reflection of the level, with no need for a logarithmic response.)

After the envelope stage is complete, the quiet signal is at 4.0V, and with sound in the room it jumps to 4.5-5.0V. Up to there, everything seems fine.

But before I show this signal on a meter, I want to subtract the 4.0V of quiet signal, using a 741 op-amp (the photo's a bit fuzzy, but should suffice):

This requires me to provide a fixed 4.0V to R1 on pin 2, but I'm failing to do that. I tried a simple voltage divider (shown on the left), but I see two problems when I connect my voltage divider (point A, above) to the R1 resistor on the inverting pin 2:

• the voltage at A drops by 1.5V
• the voltage at A is no longer fixed. It reacts to sound level.

What am I missing?

My voltage divider shares the same +9V and ground as the main circuit.

Here is a link to the schematic.

When you hook up the voltage divider to the amplifier, the divider has to supply some current through R1. Because the R values in the divider are so high, this makes a big voltage change at "A".

From the point of view of the input to the amplifier at "A", the op-amp's noninverting input (pin 2) is held at a fixed voltage by the feedback action of the circuit. It's a lot like a virtual ground except not at 0 V.

You can solve this by using much lower values in the voltage divider (say, less than 1/10 of the R1 value, depending how accurate you want the voltage to be) or by adding an additional voltage follower buffer between the divider circuit and the op-amp circuit.

• Works fine now. – John May 25 '13 at 16:56
• @JohnO, what solution did you use? – The Photon May 25 '13 at 16:57
• 1) I increased R1, R2 to 120K and 150K respectively; 2) the voltage divider now splits the 9v with 1000 ohm and 762 (=680+82) ohm resistors. Seems fine now. – John May 25 '13 at 17:01

You have a problem, however. The 4.0v value you want to subtract may or may not be constant. Does it change with temperature? Will it drift over time (hours, or even years)? Odds are that it will change. What you want is a way to subtract any mostly-DC signal, not just subtract 4.0000v.

Fortunately, there is a simple solution. Use a capacitor! When used in this application, it is called a DC Blocking Cap and it is very common to see them in audio circuits. Basically, a cap has an almost infinite resistance at 0 Hz, and the resistance decreases as the frequency gets higher. Here is an example circuit:

simulate this circuit – Schematic created using CircuitLab

The resistor is required to "restore" the DC value of the audio signal. If we didn't have a resistor then the DC level could end up to be something we don't want. In this case we're grounding the other side of the resistor so that our DC value will be 0v. Sometimes you might want the DC level to be something other than 0v, and you can do that by connecting the resistor to something other than ground.

Sometimes, when used in an opamp circuit, the resistor is optional because something with the rest of the opamp circuit fulfills that role.

This circuit is also a passive high-pass filter, and the cutoff frequency depends on the values of the C and R. The higher the values, the lower the cutoff frequency will be. I would start with 22 uF and 20K, but you could easily get away with 4.7u and 10K. For audio applications we try to get the cutoff frequency of this filter to be below 20 Hz.

The normal type of cap to use is an Aluminum Electrolytic. These caps are polarized, but are often used in an unpolarized way for this application. While technically not "correct", it is an accepted practice in consumer and most pro-audio products so long as you are not running significant power through the cap. Even so, try to orient the cap so that it is "more correct".

For your application, you can place a DC blocking cap somewhere in your signal chain. Maybe even in several places. I can't say exactly where, since you didn't give us schematics of your circuit. But my first guess would be after the transistor based preamp.

• How would a DC blocking cap interact with an envelope detector? Once the envelope is present, would that preclude the use of such a cap, since the envelope signal is dc-varying (as opposed to ac)? – John May 25 '13 at 19:11
• I seem to have a fair result, by placing the high-pass filter after the amp, and before the envelope detector. But the signal isn't as strong. I will post a schematic. – John May 25 '13 at 19:40
• @JohnO Yes, before the envelope detector is best. You could put it after the envelope detector, but it depends on the timing characteristics of the envelope and the cutoff frequency of the high pass filter. – user3624 May 25 '13 at 21:13