Hyperbolic tangent transfer function

J

John Popelish

Guest
Okay, please forget I mentioned toob sound. Thank you.

Does anybody have any suggestions for me on the best way to build a
precise, stable, symmetrical hyperbolic tangent transfer function
generator?

I have built (but not yet quantified the errors on) a circuit based on
the LM13700 dual transconductance amplifier. How can I do it better?
 
John Popelish wrote:
Okay, please forget I mentioned toob sound. Thank you.

Does anybody have any suggestions for me on the best way to build a
precise, stable, symmetrical hyperbolic tangent transfer function
generator?
Yes.

AD->uP->programing->DAC

Yeh....long live analogue...

Kevin Aylward
informationEXTRACT@anasoft.co.uk
http://www.anasoft.co.uk
SuperSpice, a very affordable Mixed-Mode
Windows Simulator with Schematic Capture,
Waveform Display, FFT's and Filter Design.
 
On Mon, 09 May 2005 23:08:49 -0400, John Popelish <jpopelish@rica.net> wroth:

Okay, please forget I mentioned toob sound. Thank you.

Does anybody have any suggestions for me on the best way to build a
precise, stable, symmetrical hyperbolic tangent transfer function
generator?

I have built (but not yet quantified the errors on) a circuit based on
the LM13700 dual transconductance amplifier. How can I do it better?
If I wanted to synthesize an arbitrary monotonic function, I'd start
with a string of diodes and resistors. PWL. Not piece-wise linear, but
piece-wise logarithmic.

Jim
 
John Popelish wrote:
Okay, please forget I mentioned toob sound. Thank you.

Does anybody have any suggestions for me on the best way to build a
precise, stable, symmetrical hyperbolic tangent transfer function
generator?

I have built (but not yet quantified the errors on) a circuit based on
the LM13700 dual transconductance amplifier. How can I do it better?
It seems many posting here don't seem to be aware that the basic diff
pair is a tanh() function.

Iout = Ie.tanh(Vin/2Vt)

This will be quite accurate over many decades. So, why do anything at
all? Its all done!

Kevin Aylward
informationEXTRACT@anasoft.co.uk
http://www.anasoft.co.uk
SuperSpice, a very affordable Mixed-Mode
Windows Simulator with Schematic Capture,
Waveform Display, FFT's and Filter Design.
 
On 10 May 2005 05:38:02 -0700, "Tim Shoppa" <shoppa@trailing-edge.com>
wrote:

precise, stable, symmetrical
hyperbolic tangent transfer function generator?

For what range of inputs and what precision?

tanh(x)=x is pretty good for (within a few %) for x<0.3.

tanh(x)=1-2*exp(-x*2) is good to a couple of percent for x>1. For that
matter, tanh(x) = 1 is good to a percent for x>3 :).

In between it's a matter of blending :).

I think there's a section in the MIT Radiation Lab Volume 19 book
"Waveforms", that talks specifically about tanh and generically about
synthesizing nonlinear functions out of real-world compoents. I'll see
if I can dig it up. (Are these scanned and on the web anywhere?)

Tim.
Without checking my math, I do believe that an ordinary bipolar
differential pair has TANH for a transfer function.

Pretty small range, but can be built out. Look into some of Barrie
Gilbert's paper's.

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| E-mail Address at Website Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.
 
Kevin Aylward wrote:
John Popelish wrote:

Okay, please forget I mentioned toob sound. Thank you.

Does anybody have any suggestions for me on the best way to build a
precise, stable, symmetrical hyperbolic tangent transfer function
generator?


Yes.

AD->uP->programing->DAC

Yeh....long live analogue...
I am passing the signal through this transfer function to prepare it
for an A/D converter. Using a 10 bit A/D this will give me something
between 12 and 16 bit resolution for the central 10% of the span, and
something like 6 bit resolution at the peaks. Creating the transfer
function with a 16 bit A/D DAC combination kind of defeats the purpose.
 
Tim Shoppa wrote:
precise, stable, symmetrical
hyperbolic tangent transfer function generator?


For what range of inputs and what precision?

tanh(x)=x is pretty good for (within a few %) for x<0.3.

tanh(x)=1-2*exp(-x*2) is good to a couple of percent for x>1. For that
matter, tanh(x) = 1 is good to a percent for x>3 :).

In between it's a matter of blending :).

I think there's a section in the MIT Radiation Lab Volume 19 book
"Waveforms", that talks specifically about tanh and generically about
synthesizing nonlinear functions out of real-world compoents. I'll see
if I can dig it up. (Are these scanned and on the web anywhere?)
Thank you. I would like to see that.

It is my understanding that an ordinary differential amplifier made
with two junction transistors produce a tanh transfer function as the
difference of their collector currents, based simply on the physics of
their operation. See bottom of page 8:
http://ee215-files.stanford.edu/handouts/HO17_215W05_DiffAmp_2pp.pdf

The simplest way to extract this transfer function seems to be an
integrated transconductance amplifier, like the LM13700 (or CA3080),
but all those current mirrors add rather unspecified errors to the
front end transfer function.
 
Kevin Aylward wrote:
John Popelish wrote:

Okay, please forget I mentioned toob sound. Thank you.

Does anybody have any suggestions for me on the best way to build a
precise, stable, symmetrical hyperbolic tangent transfer function
generator?

I have built (but not yet quantified the errors on) a circuit based on
the LM13700 dual transconductance amplifier. How can I do it better?


It seems many posting here don't seem to be aware that the basic diff
pair is a tanh() function.

Iout = Ie.tanh(Vin/2Vt)

This will be quite accurate over many decades.
This is what I am counting upon.

So, why do anything at all? Its all done!
There is a temperature term in there to be dealt with. My original
post called "Toob Sound?" described how I use the two spare darlington
transistors in the LM13700 chip and the voltage drop across the gain
control current mirror to devise a chip temperature control loop.
That seems to work pretty well. But all the current mirrors between
the differential pair and the current output are not very well
characterized, so I am worried about the final accuracy.

I could surround a differential pair with a few opamps and subtract
the two collector currents with that and eliminate the current mirror
errors, but I still need to control the temperature of the
differential pair. Perhaps I can get a dual pair and use one as a
heater to control the temperature of the other. I hate to have to
build an oven around the device.
 
Jim Thompson wrote:

Without checking my math, I do believe that an ordinary bipolar
differential pair has TANH for a transfer function.

Pretty small range, but can be built out. Look into some of Barrie
Gilbert's paper's.
I would like very much to read Gilbert's papers, but I keep running
into IEEE requests for my membership number (which I don't have).
 
John Popelish wrote:
I could surround a differential pair with a few opamps and subtract the
two collector currents with that and eliminate the current mirror
errors, but I still need to control the temperature of the differential
pair. Perhaps I can get a dual pair and use one as a heater to control
the temperature of the other. I hate to have to build an oven around
the device.
Okay, so the entire purpose of this tanh exercise is to do signal
companding, right? Any particular purpose for prefering tanh(x) over
the usual log(x) way of doing it? Also, what are your bandwidth and
cost requirements? One or the other must be pretty severe if just going
to a 16 bit ADC isn't a far easier option.
 
Kevin Aylward wrote:
John Popelish wrote:
Okay, please forget I mentioned toob sound. Thank you.

Does anybody have any suggestions for me on the best way to build a
precise, stable, symmetrical hyperbolic tangent transfer function
generator?

Yes.

AD->uP->programing->DAC

Yeh....long live analogue...
It will be quite an effort to get a stable output voltage, since the
differential amplifier transfer function has the factor (Vin/2Vt) in it, Vt
being the temperature voltage around 25.5mV at room temp.. Transistors need
to be matched, I recommend LM198 there can be an offset pot. With 0.1mA the
input impedance is 80k. You can use a PTC with +3300ppm to compensate for
the Ut temperature dependency.
The circuit is also useful to convert a triangle wave to a sin. the best
conversion is with +/- 2.8Ut=72mV. then the distortion is minimal 1.3%, but
can be lowered with an additional diode pair to 0.4%.
I paste you again my proposition here:


+15V
o
|
_V_
.---|___|---.
| 1k |
.-. .-.
| | | | R2_
| |R1 | |R1 +-|___|-GND
+/-10V '-'150k '-'150k |100k
o | | | |\
| | +-------+---|+\
.-. | | | >-+--o Uout
| | +-----------)-------+---|-/ | +/-10V
| |19k | | | |/ |
'-' | | | __100k|
| |/ \| +-|___|--+
+----| LM198 |-+ R2
| |> <| |
.-. | | ===
| / +-----+-----+ GND Uout=Ie x R2 tanh (Uin/2Ut)
,/| |
/-'1k | Ut=25.5mV
|PTC / \
| ( Ie)100uA
=== \_/
GND |
o
-15V
(created by AACircuit v1.28 beta 10/06/04 www.tech-chat.de)


--
ciao Ban
Bordighera, Italy
 
Ban wrote:
It will be quite an effort to get a stable output voltage, since the
differential amplifier transfer function has the factor (Vin/2Vt) in
it, Vt being the temperature voltage around 25.5mV at room temp..
Transistors need to be matched, I recommend LM198 there can be an
offset pot. With 0.1mA the input impedance is 80k. You can use a PTC
with +3300ppm to compensate for the Ut temperature dependency.
The circuit is also useful to convert a triangle wave to a sin. the
best conversion is with +/- 2.8Ut=72mV. then the distortion is
minimal 1.3%, but can be lowered with an additional diode pair to
0.4%. I paste you again my proposition here:


+15V
o
|
_V_
.---|___|---.
| 1k |
.-. .-.
| | | | R2_
| |R1 | |R1 +-|___|-GND
+/-10V '-'150k '-'150k |100k
o | | | |\
| | +-------+---|+\
.-. | | | >-+--o Uout
| | +-----------)-------+---|-/ | +/-10V
| |19k | | | |/ |
'-' | | | __100k|
| |/ \| +-|___|--+
+----| LM198 |-+ R2
| |> <| |
.-. | | ===
| / +-----+-----+ GND Uout=Ie x R2 tanh (Uin/2Ut)
,/| |
/-'1k | Ut=25.5mV
|PTC / \
| ( Ie)100uA
=== \_/
GND |
o
-15V
(created by AACircuit v1.28 beta 10/06/04 www.tech-chat.de)
Should be LM194 or 394

--
ciao Ban
Bordighera, Italy
 
Rob Gaddi wrote:
John Popelish wrote:


I could surround a differential pair with a few opamps and subtract
the two collector currents with that and eliminate the current mirror
errors, but I still need to control the temperature of the
differential pair. Perhaps I can get a dual pair and use one as a
heater to control the temperature of the other. I hate to have to
build an oven around the device.


Okay, so the entire purpose of this tanh exercise is to do signal
companding, right?
Right.

Any particular purpose for prefering tanh(x) over
the usual log(x) way of doing it?
The signal swings both ways from zero.

Also, what are your bandwidth and
cost requirements?
Right now, cost is not a factor, because I am exploring alternatives.
The bandwidth is less than 100 Hz. The signal spends 99+% of the
time within a few percent of zero. I am working on a means to connect
a seismometer to a PC, and one way involves using the very inexpensive
and available 10 bit converter sold by DataQ:
http://www.dataq.com/products/startkit/di194rs.htm

One or the other must be pretty severe if just going
to a 16 bit ADC isn't a far easier option.
Right now, it is more of an educational exercise than a product.
 
On Tue, 10 May 2005 13:52:54 -0400, John Popelish <jpopelish@rica.net>
wrote:

Rob Gaddi wrote:
John Popelish wrote:


I could surround a differential pair with a few opamps and subtract
the two collector currents with that and eliminate the current mirror
errors, but I still need to control the temperature of the
differential pair. Perhaps I can get a dual pair and use one as a
heater to control the temperature of the other. I hate to have to
build an oven around the device.


Okay, so the entire purpose of this tanh exercise is to do signal
companding, right?

Right.

Any particular purpose for prefering tanh(x) over
the usual log(x) way of doing it?

The signal swings both ways from zero.

Also, what are your bandwidth and
cost requirements?

Right now, cost is not a factor, because I am exploring alternatives.
The bandwidth is less than 100 Hz. The signal spends 99+% of the
time within a few percent of zero. I am working on a means to connect
a seismometer to a PC, and one way involves using the very inexpensive
and available 10 bit converter sold by DataQ:
http://www.dataq.com/products/startkit/di194rs.htm

One or the other must be pretty severe if just going
to a 16 bit ADC isn't a far easier option.

Right now, it is more of an educational exercise than a product.
Hi,

For that bandwidth, it would be better to use an ADC with 16 or 18
bits.

If you really want to use the (I agree, very cheap) datalogger you
mentioned, here's an idea: You could feed your signal to CH1, and also
a 10x version of it to CH2, using a simple amplifier. Depending on the
input circuitry, you might need protection zeners (two in anti-series,
from line to the 0 V node, at each channel input that would otherwise
be "overloaded"). You would then have two waveforms to look at: one 1x
and one 10x. During the time intervals where the 10x saturates, you
would look at the 1x. You could work out some signal processing (at
the PC) to (more or less) seamlessly convey them into one displayed
signal. You could use the time when none of the channel saturates to
"cross-calibrate" the dependencies (you would be calibrating your
analog amp).

Since the datalogger has four channels, you could extend the idea to
have {1x, 5x, 10x and 50x} simultaneous resolutions, for instance.

Best,
Mochuelo.
 
On Tue, 10 May 2005 21:48:46 +0200, Mochuelo <hola@que.tal> wrote:
Depending on the
input circuitry, you might need protection zeners (two in anti-series,
from line to the 0 V node, at each channel input that would otherwise
be "overloaded").
Well, if the output saturation voltage of your amp is lower than the
max input voltage of the channel input, of course you don't need
anything.
 
Mochuelo wrote:
On Tue, 10 May 2005 13:52:54 -0400, John Popelish <jpopelish@rica.net
wrote:


Rob Gaddi wrote:

John Popelish wrote:


I could surround a differential pair with a few opamps and subtract
the two collector currents with that and eliminate the current mirror
errors, but I still need to control the temperature of the
differential pair. Perhaps I can get a dual pair and use one as a
heater to control the temperature of the other. I hate to have to
build an oven around the device.


Okay, so the entire purpose of this tanh exercise is to do signal
companding, right?

Right.


Any particular purpose for prefering tanh(x) over
the usual log(x) way of doing it?

The signal swings both ways from zero.


Also, what are your bandwidth and
cost requirements?

Right now, cost is not a factor, because I am exploring alternatives.
The bandwidth is less than 100 Hz. The signal spends 99+% of the
time within a few percent of zero. I am working on a means to connect
a seismometer to a PC, and one way involves using the very inexpensive
and available 10 bit converter sold by DataQ:
http://www.dataq.com/products/startkit/di194rs.htm


One or the other must be pretty severe if just going
to a 16 bit ADC isn't a far easier option.

Right now, it is more of an educational exercise than a product.


Hi,

For that bandwidth, it would be better to use an ADC with 16 or 18
bits.

If you really want to use the (I agree, very cheap) datalogger you
mentioned, here's an idea: You could feed your signal to CH1, and also
a 10x version of it to CH2, using a simple amplifier. Depending on the
input circuitry, you might need protection zeners (two in anti-series,
from line to the 0 V node, at each channel input that would otherwise
be "overloaded"). You would then have two waveforms to look at: one 1x
and one 10x. During the time intervals where the 10x saturates, you
would look at the 1x. You could work out some signal processing (at
the PC) to (more or less) seamlessly convey them into one displayed
signal. You could use the time when none of the channel saturates to
"cross-calibrate" the dependencies (you would be calibrating your
analog amp).

Since the datalogger has four channels, you could extend the idea to
have {1x, 5x, 10x and 50x} simultaneous resolutions, for instance.

Best,
Mochuelo.
Thanks for an interesting possibility that still allows the use of
this data logger.
 
On Tue, 10 May 2005 12:49:34 -0400, John Popelish <jpopelish@rica.net> wroth:

James Meyer wrote:

If I wanted to synthesize an arbitrary monotonic function, I'd start
with a string of diodes and resistors. PWL. Not piece-wise linear, but
piece-wise logarithmic.

Then I have to control temperature of those diodes or correct the
result for temperature variations. At least the PWL version can e
pretty stable. But either of these is more complicated than the
transconductance amplifier, I think. My difficulty is quantifying the
precision of the transconductance amplifier. If I had a temperature
controllable differential pair, I could use opamps to form the rest of
the circuit, and eliminate most of the tolerances.
If size isn't a big concern, a small circuit board (or stack of two
boards) with the diode/resistor string and a resistive heater and a thermistor
placed in a styrofoam container could do the job. You'd then have access to all
the internal circuitry to tweak to your heart's content. A cube 2 inches on a
side would probably be big enough. OCXO's are about the same size.

Jim
 
Ban wrote:
Ban wrote:

It will be quite an effort to get a stable output voltage, since the
differential amplifier transfer function has the factor (Vin/2Vt) in
it, Vt being the temperature voltage around 25.5mV at room temp..
Transistors need to be matched, I recommend LM198 there can be an
offset pot. With 0.1mA the input impedance is 80k. You can use a PTC
with +3300ppm to compensate for the Ut temperature dependency.
The circuit is also useful to convert a triangle wave to a sin. the
best conversion is with +/- 2.8Ut=72mV. then the distortion is
minimal 1.3%, but can be lowered with an additional diode pair to
0.4%. I paste you again my proposition here:


+15V
o
|
_V_
.---|___|---.
| 1k |
.-. .-.
| | | | R2_
| |R1 | |R1 +-|___|-GND
+/-10V '-'150k '-'150k |100k
o | | | |\
| | +-------+---|+\
.-. | | | >-+--o Uout
| | +-----------)-------+---|-/ | +/-10V
| |19k | | | |/ |
'-' | | | __100k|
| |/ \| +-|___|--+
+----| LM198 |-+ R2
| |> <| |
.-. | | ===
| / +-----+-----+ GND Uout=Ie x R2 tanh (Uin/2Ut)
,/| |
/-'1k | Ut=25.5mV
|PTC / \
| ( Ie)100uA
=== \_/
GND |
o
-15V
(created by AACircuit v1.28 beta 10/06/04 www.tech-chat.de)


Should be LM194 or 394
Check page 4:

http://qss.stanford.edu/~godfrey/analog_systems/tanh.pdf

---
Regards,
Bob Monsen
 
On Tue, 10 May 2005 18:18:33 -0700, Bob Monsen <rcsurname@comcast.net>
wrote:


Check page 4:

http://qss.stanford.edu/~godfrey/analog_systems/tanh.pdf
I'm sure those transistors are supposed to be bipolars, but the way
they're drawn they sure look like FET's. :-/

---
Regards,
Bob Monsen
-----
http://mindspring.com/~benbradley
 
On Tue, 10 May 2005 13:52:54 -0400, John Popelish <jpopelish@rica.net>
wrote:

Rob Gaddi wrote:
John Popelish wrote:


I could surround a differential pair with a few opamps and subtract
the two collector currents with that and eliminate the current mirror
errors, but I still need to control the temperature of the
differential pair. Perhaps I can get a dual pair and use one as a
heater to control the temperature of the other. I hate to have to
build an oven around the device.
I recall that an LM3046 was used in the Micromoog (not the
venerable Minimoog, ISTR it was mostly discrete transistors)
synthesizer (because I replaced one in one once) for the oscillator's
exponential response function, and it was temperature-stabilized by
being heat up (one or more of the on-chip transistors dissipated
significant power, and presumably one of the transistors was used to
measure the chip temperature). I never saw a schematic of the thing,
but if you could find it (and I'm right about this being the
operation, I'm only 97 percent sure), it would be just the thing for a
stable, temperature-controlled differential pair.

Okay, so the entire purpose of this tanh exercise is to do signal
companding, right?

Right.

Any particular purpose for prefering tanh(x) over
the usual log(x) way of doing it?

The signal swings both ways from zero.

Also, what are your bandwidth and
cost requirements?

Right now, cost is not a factor, because I am exploring alternatives.
The bandwidth is less than 100 Hz. The signal spends 99+% of the
time within a few percent of zero. I am working on a means to connect
a seismometer to a PC, and one way involves using the very inexpensive
and available 10 bit converter sold by DataQ:
http://www.dataq.com/products/startkit/di194rs.htm

One or the other must be pretty severe if just going
to a 16 bit ADC isn't a far easier option.

Right now, it is more of an educational exercise than a product.
Well, that's cheap enough, OTOH there are 24-bit A/D chips for
instrumentation use (or whatever it's called) with that bandwith that
really do measure 24 bits.

For another really off-the-wall idea, have the voltage operate a
VCO with center frequency maybe 5kHz, and run it into the PC's
soundcard. Large disk drives can record huge audio files (but usually
with a 2 gig limit - long story). With some programming on the PC,
this tone can be decoded in real time, and the 100-samples-per-second
result written to disk. I'm not sure what resolution you can get, but
it should be better than 10 bits. But the programming will be way
trouble than the dataq plug-and-play solution.

-----
http://mindspring.com/~benbradley
 

Welcome to EDABoard.com

Sponsor

Back
Top