Xref: utzoo comp.ai.neural-nets:200 sci.electronics:3700 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!ankleand From: ankleand@athena.mit.edu (Andy Karanicolas) Newsgroups: comp.ai.neural-nets,sci.electronics Subject: Re: Sigmoid transfe function Keywords: A Circuit ? Message-ID: <6834@bloom-beacon.MIT.EDU> Date: 26 Aug 88 20:32:27 GMT References: <1982@aecom.YU.EDU> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: ankleand@athena.mit.edu (Andy Karanicolas) Organization: Massachusetts Institute of Technology Lines: 98 In article <1982@aecom.YU.EDU> krishna@aecom.YU.EDU (Krishna Ambati) writes: > >Concerning circuits that yield a tanh transfer function, I wonder >whether the following will work? > > D1 > > ____|/|___ > | |\| | > ---| |--- > | |____|\|___| | > | |/| | > | D2 | > | | > | | > | C | > |--------| |-------| > | | > | R | > |-------/\/\-------| > | | > | | > | |\ | > V(in) .-------|-------|-\ | > | \_______|_____. V(out) > | / > |-------|+/ > | |/ > | > GND > >What is the transfer function of this circuit? > >Krishna Ambati >krishna@aecom.uucp >ins_aajk@jhunix.uucp NOTE: THE VIEWS EXPRESSED HERE ARE NOT NECESSARILY THOSE OF M.I.T. First of all, for this cirucit to work, some kind of input impedance is needed (unless a current source is used for the input), call it rin. Assume the op-amp and diodes are ideal. Also, leave out the R-C network for now. For an ideal op-amp (in a stable connection) the (-) and (+) inputs will be at the same voltage, namely 0 volts. Now, sum the currents into the (-) input: --> vin/rin + ix*(exp(vout/vth) - 1) - ix*(exp(-vout/vth) - 1) = 0 (vth is the thermal voltage or kT/q) --> vin/rin + 2*ix*sinh(vout/vth) = 0 --> vout = -vth*arcsinh[ vin/(2*ix*rin) ] Now, this is not the most pleasant thing in the world to deal with. However, this equation can be simplified when |vout/vth| >> 1. For the case where |vout/vth| >> 1: --> vin/rin + ix*exp(vout/vth) ~= 0, vout > 0 --> vin/rin - ix*exp(-vout/vth) ~= 0, vout < 0 simplifying, --> vout = vth*log[ -vin/(ix*rin) ], vout > 0 (vin < 0) --> vout = -vth*log[ vin/(ix*rin) ], vout < 0 (vin > 0) No doubt, this is not a tanh function. It is more like a log|vin| type of transfer function. Note that when vin is near 0, the approximations for these equations do not work and the arcsinh horror is needed. One problem with this circuit is that the output swing will be small because the turn-voltage of most diodes is around 0.6V or so. If much more output voltage is demanded, the diode current, and hence the op-amp output current, will become excessive. One way to extend the output voltage swing would be to include a series resistor with each diode. However, this will result in the transfer function slope increasing on the extremes. Of course, an amplifier can be added to magnify the output voltage. The resistor in the R-C network is needed or the transfer function slope, or gain, will become excessive when vin is near 0. With the proper choice of R, this circuit might yield a transfer function that is similar to the tanh function. The slope of the transfer function near vin = 0 can be set by the ratio of r to rin. The inclusion of the capacitor forms something like a lead compensator, except that the zero and pole will move around depending on the output voltage. In any case, predicting the dynamic behavior of this circuit is not too easy since the diodes are non-linear elements. Try it out and see what you get! Andy Karanicolas Microsystems Technology Laboratory ankleand@caf.mit.edu