Logarithm Amp Explained?

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

CJ

Well-known member
Joined
Jun 3, 2004
Messages
16,120
Location
California
I am having a time trying to figure out how a log amp works.

I see that a transistor is used in place of a feedback resistor in an opamp circuit to vary the gain with the signal applied. But how does it do it?

I have seen the equation Eout=C + k log Iin mentioned as the transfer in a transistor. But which configuration transistor circuit? Common base? Common emitter?

I am guessing that as base current increases, a voltage on the transistor somewhere ( e-b maybe?) increases as the log of this current.

Here is a log amp. A transistor is used for each polarity of feedback signal. Q1 and Q2 are feedback transistors. How might these transistors be biased in an actual circuit? The grounded bases do not click in my head.
Do the transistors feed a current into the opamp or a voltage?
Thanks!

vca_1.jpg
 
You are looking at a too-advanced design.

Put a resistor and silicon diode in series. Say 10K and 1N1002. Put 10V-1,000V across them. Measure the voltage across the diode.

You already "know" the voltage will be "about 0.6V" no matter what the current. Maybe 0.5V to 0.7V. What is really happening is that the voltage is proportional to the LOG of the current. Large changes in current give small changes in voltage.

Let me see if SPICE will run tonight.
 
Ahh, I see! So those transistors are really being used as fancy diodes.

I know that the antilog circuit that follows uses transistors as diodes to rectify the "logged" signal after it has been generated, so those feedback transistors are being used the same way? Not as amplifiers, but as diodes?

How close to a true log function is this technique? And is it a base 10 deal or the natural log?

Thanks!
 
> Let me see if SPICE will run tonight.

Here's the rig:
diode-log.gif


Plotted linear-scale, you get a pretty curve. Plotted log on the input axis, it makes a straight line.

I started at 10V to make the ~0.6V diode-drop "small". Below 10V it is bent, but not much down to 1V.

Obviously 1V-1,000V is an awkward input range. However all we've really done is make a current out of the voltage. We can replace the 10K with a current generator. The cheapest (and often best) way is to use the standard Inverting Op-Amp configuration, use a resistor for input, but a diode for the feedback. Now you put a voltage in the resistor, the opamp forces a current through the diode, and the opamp output voltage is the diode voltage.

+/- errors. The opamp must have low offset voltage and input current. The diode must have low ohmic loss and low leakage current.

Using a transistor allows you to "amplify-away" some of the low-current errors. Base current is much less than collector current so ohmic losses don't hurt so much. (A more subtle reason: most diodes depart from simple log behavior, transistors have a much wider range of good log conformity.)

> How close to a true log function is this technique?

You have to calibrate one point, since you can't know the exact I/V parameter of a specific diode or transistor (except from knowing saturation current, which is nearly unmeasurable).

After that, it is very-exact over many orders of magnitude. Cowles 1966 suggests +/-10% over 2 orders of magnitude, but I have seen more recent statements of 1% over 6 OOM, which in your terms is 120dB range with accuracy you can hardly squint on a needle.

Oh, and there are at least two temperature terms. At a given current, voltage varies ~2mV/degree. You can rough-correct that with another transistor. And the slope of voltage/current changes: MOOG oscillators used a magic resistor to cancel that out. But you can make a heck of a studio PPM without any real temperature corrections.

> the antilog circuit that follows uses transistors as diodes to rectify the "logged" signal

Rectifiers? Then maybe to reduce leakage. Or to cancel temperature. But are you sure it isn't an anti-log stage?

> And is it a base 10 deal or the natural log?

There are no numbers on that thing. Log is log. "natural" or "10" only comes about when men put numbers on the log.
 
> it makes a straight line.

Same if the left-right axis is current.

But if you know log, then you know it can't be plotted to zero. The straight line does not fall to zero voltage at zero current. In fact it is asymptotic to the junction "saturation current". This is not the high-current where the device bottoms-out, it is the lowest possible current, a current that flows even when the junction is shorted-out. It is due to thermal energy (which means a function of absolute temperature).

My SPICE model for the 1N1002 gives 14.11E-9 or 14 nanoAmps for the saturation current. In real life, you will be in trouble a couple orders of magnitude above that. For one thing, the opamp's input devices also have saturation currents, and invariably operating currents that are significantly higher. Unless your diode is much larger than your opamp input devices, you usually run into opamp input current errors before the log device gets inaccurate.

For the fairly big 1N1002, this SPICE model shows bend above 100mA, or 1/10th of the device's commercial rating, a reasonable rule of thumb.

SPICE shows this model device giving 7 orders of magnitude as straight-log as the eye can see. I don't believe that: I know the SPICE model starts from the "perfect junction diode" and then adds enough errors to give useful answers at typical currents. The rise at >100mA is plausible, the perfection down to nanoAmps is very dubious (even with SPICE's perfect voltage and current sensors), and Bob Pease showed that real diodes are kinky at modest currents (they act like two diodes with a crossover; I'm not sure he really explained why).
 
Wow. That sure looks like a log curve to me. Thamks!

Here is the rest of the circuit. The logged output gets amplified times two, then the outputs are rectified and summed. This is just kind of a block diagram.

Tempeture, yes. Those feedback transistors are thermally coupled in the DBX 2001, as are the anti-log transistors.



vca_2.jpg
 
> logged output gets amplified times two

Well, duh. You are doing an RMS. The "S" is Square. 2*Log is the same as squaring. The "Mean" isn't obvious; I guess C 36 is conceptual averaging, good enough for patent purpose. Q3 Q4 are probably anti-logging, the "Root" function.

Temperature effects for 0, 25, and 50 degrees C (about freezing, room-temp, and Death Valley):

diode-log-temp2.gif


I've also re-plotted so the horizontal scale to 1V/dB as-if you were asking about a dB meter (not an dBx RMS detector, a fairly-different thing).

Top: You can see that you get huge temperature errors. But at the bottom I've added a diode running at same temperature and fixed 1mA current, and subtracted that from the log-diode voltage. Naturally the correction is perfect at 1mA. It is as much as a dB off at +/-10dB, 5dB out at -40dB. This means you can go to the worst places a normal technician will work, deliver a "0dB" line-up tone that is perfect, a +15dB peak less-than 2dB off from exactly +15dB, but if you try to set background crowd noise to -40dB on the meter it might be -45dB on ice, -35dB in the desert. Such accuracy is usually acceptable. If they want a perfect mix they should supply a heated/cooled trailer.

The dBx RMS part will have this much correction due to semi-cancelling transistors. I suspect the slope error also cancels (or mostly-cancels, due to the *2 factor).
 
Wow. That was fast!

Duh is right. log x^2 = 2 log x. it's been a while.

Very clever. But not for a Gemini telementary circuit guy I guess.

This is the Blackmer cell. Soon to become a zillion interations.

44 is replaced with a current source, etc etc.

36 and 37 neutralize a high end loss due to an effect I forgot.

Control the gain of the feedback transistors with a dc voltage and you have your basic VCA.

Now for a real lame question. Does audio pass thru this thing, or just a dc voltage used to control an amp?

I guess in later revs, this thing actually is configured to pass audio? :oops:

re: temp: i read that certain resistors were chosen for their coef. properties in order to compensate for tempeture effects.

So think twice before you swap out those 5 percenters for precisions, folks, there could be more than meets the eye.
 
Actually the net current does go to ~zero at zero bias I believe, and not just at absolute zero. If the diode is of really super-low bandgap material then you will develop a potential photovoltaically from almost any radiation field, true. The slope of the I/V curve at zero bias is the conductance that generates thermal noise. On the reverse bias side it quickly becomes a shot noise generator, and on the forward bias side a half-thermal noise generator w.r.t. the conductance. The great discussion of these matters is in the Oliver paper I reffed a while ago, Thermal and Quantum Noise, Proc. IEEE 53 (5) May 1965.

One of the things that most people don't take into account is the actual dependence of the saturation current on temperature. You will hear lots of rules-of-thumb, usually about a doubling of Is for every 10 degrees K. But there is a more complicated expression that I dug out of Sze (Physics of Semiconductor Devices), and it makes a big difference at really low temperatures---it makes the leakage less than the rule-of-thumb predicts.
 
[quote author="bcarso"] Oliver paper I reffed a while ago, Thermal and Quantum Noise, Proc. IEEE 53 (5) May 1965.
[/quote]
Can you scan it or put link to it ?
For me it is very interesting.
thanx,

xvlk
 
... Not simple log amp, log amp is for one quadrant,
this is two - quadrant circuit (BTW what is loq of negative number ????,
you need more than one wire, hehe)
[quote author="CJ"]
vca_2.jpg
[/quote]
It looks like extracted from some patent,
do you know PN ????

xvlk
 
> This is the Blackmer cell.
> you have your basic VCA.

No it's not. See Fig 3 on page 5 of this EDN article. That's the Blackmer VCA cell. It is the other module in a dbx. What you are looking at is the RMS module, probably another Blackmer idea, but not The Blackmer Cell.

> Does audio pass thru this thing, or just a dc voltage used to control an amp?

Audio goes in. Throbbing DC comes out.

Now I see how the RMS is done. The "RMS module" actually just does the Square. There is a cap (or dbx's super-cap) somewhere to get the Mean. The Blackmer VCA is actually an anti-log device, which effectively takes the Root of the original signal.

> what is loq of negative number ????

The log of a negative number is queer, but the square of a negative number is perfectly clear. This circuit does what a human calculator and log-table would do: cut-off the negative sign, compute the log of the absolute value, multiply by 2, and then stick (-1)*(-1) or + in front. "More than one wire" indeed.

> a more complicated expression ...makes a big difference at really low temperatures

I said "normal" technicians. You astro-radio guys who bathe your preamps in liquid gases are strange.
 
OK, I follow the log function of the diode concept.. But how do you implement that property into the feedback circuit of the op amp? I need an explanation like "the current into the op amp puts ourt a voltage of off pin 6 which feed the diode as a current, which gets transfered asd a volteg to the inpuut of the op amp" etc.
If I could get a grip on that, I think the rest would be a walk in the park.
Hopefully.
 
They dumbed it down enough for even me to partially understand here:

http://www.play-hookey.com/analog/logarithmic_amplifier.html

My understanding this is not a log amp problem, but rather an op amp problem, so I will try for that first.
 

Latest posts

Back
Top