 In the last lecture we had used only linear elements in negative feedback along with the op amp and seen how integrators differentiators and instrumentation amplifiers can be built. In today's lecture 19th lecture we will be discussing the use of op amp in negative feedback we using non-linear devices like diodes and transistors to form what are called as non-linear circuit non-linear signal processing activities. So let us see what we had done in the last class we had instrumentation amplifier one of the important applications integrator one of the most important building blocks in filters differentiators time markers effect of finite gain menu product on the performance of these important building blocks. Today we will be discussing the association of non-linear elements like diode and transistors both MOS and bipolar in signal processing activities. Let us now consider a half wave rectifier using a single diode semiconductor diode PN junction diode and resistor. So we have the source generating a sine wave let us say this is the 50 hertz wave so that is getting generated with some peak magnitude VP. So if this is VP sine omega t into 50. So what is the kind of waveform that should appear here. So if VP is of the order of let us say 1 volt then up to about 0.7 the diode does not conduct the cut in voltage V gamma that is what it is about 0.7 the diode does not conduct only thereafter it conducts. So what happens we have the input waveform okay coming like this and the output waveform will be appearing it is conducting only for a portion of the cycle and this portion of the waveform appears okay at the output. So we get at the output instead of the half wave rectification that we expect right we get only portion of the half wave as the output which is roughly equal to VP – V gamma. So as up to V gamma it does not conduct. So this is because of the fact that I flows only after VP crosses okay I is greater than 0 only when VP that is VP should be greater than V gamma and beyond V gamma okay that is VI okay greater than V gamma it conducts. So let us look at the transfer characteristic now it is linear and non-linear the diode starts conducting okay really speaking around 0.6 to 0.7 volts you can see of course it is not abrupt there is a smooth change okay it is exponential characteristics for the diode. So this current is changing gradually from 0 up to the full value and thereafter okay is going on increasing okay as VP – V gamma by R or V – V gamma by R that is the current beyond V that is V gamma this is the transfer characteristic this is the waveform simulated waveform. So VP has been taken as 1 volt so you can see that roughly VP – 0.6 or so right is the that is 0.4 also right is the amplitude of the peak that has been obtained. So that is the distortion that it is suffering because it is a non-linear resistance. So it is not exactly the sine wave it was earlier so this is what happens now you just see what happens so it has a limited amount of conduction over the half cycle also and it is not exactly the sine wave it is. Now this same diode in series with this resistance is now having the op amp in negative feedback so what happens this is still the same input VP sin omega t and VP is still equal to let us say 1 volt. So now what happens up to until the output voltage of this right goes to V naught dash goes to V gamma with respect to ground the diode does not conduct. However as long as the diode does not conduct there is no feedback so this op amp is in open loop okay so one end is grounded and VI is going on increasing so the moment VI increases by few under of micro volts even the output goes to saturation right because of the high gain of the IDC gain of the op amp. So when it is attempting to go to saturation let us say it is going positive okay because this is going positive during this portion here it goes negative so during this portion is going positive just when it crosses zero this jumps to V gamma and thereafter okay the diode is conducting okay so the diode starts conducting at that point of time so there is a jump so at this point there is a jump thereafter the diode is conducting and then the rest of the voltage is driving a current through the load okay so the rest of the voltage is going to appear okay so this is the kind of jump that is going to suffer that means we have the entire voltage waveform okay that is going to be reproduced this may be the current sort of the current is zero until certain point of time and then it is conducting so this is the kind of waveform that one expects at the output okay so as far as the negative going cycle is concerned the path is always broken the diode is not conducting and therefore this is in open loop goes to a negative saturation okay so this is the kind of output you should expect from this thing however if you look at the point here as far as V naught is concerned V naught is going to be just this with this being restricted to zero because of the fact that this is open and here we have RL maintaining the ground potential zero so op amp is disconnected during this time so this is the kind of output that we expect from the sub favorite to fail so this output is going to be followed exactly and this is what we see during the negative half of the cycle so let us see the simulation results the transfer characteristic is exactly the precision rectifier characteristic where it is conducting immediately around zero itself and output is linearly related to input with the slope equal to 1 so we have this output following the input okay it is a voltage follower only during the time when the diode is conducting and therefore this is the transfer characteristic whereas you would have seen that the transfer characteristic was pretty distorted for the case of just diode without any negative feedback this was the characteristic so we see that precision rectifier can be easily built by incorporating it in negative feedback this is the input and the output of the op amp has jumped okay and on the other side up to V gamma on this side and has jumped up to the saturation on the other side that is why it looks like a square waveform and maintains the actual output across the load as precisely half wave rectification so this is how it becomes a precision rectifier now let us to see another topology where we have used it in negative feedback in this mode this is nothing but the trans resistance amplifier the voltage is then converted input voltage is converted to current and we can see that the current here is Vi by R so this is going to conduct the diode is going to conduct only for Vi greater than zero so the moment diode conducts this current is going to flow through this this potential is virtual ground that means nearly zero okay and this current is going to be Vi by R and the potential developed across this R is same as Vi and therefore this voltage being zero output voltage if you take at this point that is where the load is connected so V naught is going to be equal to Vi for Vi greater than zero so it is exactly the positive going half which is reproduced with the same value of VP as Vi so this is V naught thereafter the diode is not going to conduct for the negative going half of the input voltage so what happens when the diode is not conducting this is open feedback is not existing op amp simply goes to positive saturation so the op amp jumps okay up to the positive saturation whenever input Vi is going negative. So output voltage here is going to be simply you can see the path for the current this is open so the path for the current is this that means output voltage is going to be RL into VP divided by RL plus 2R simply an attenuator so this is the output voltage if RL is very large it will be simply that is going to be Vi negative right so actually speaking we have here V naught for this time is going to be going negative and during this period it is going to be some value which is decided by what the value of RL is that means this always going to minus VP because of the inversion plus minus V naught is equal to minus Vi right so it is going up to minus VP every time the input is going positive output will go negative this is V naught and as far as this is concerned this is determined by VP into RL by RL plus 2R this is because the current has to come from input only earlier the current was coming from the op amp itself for both the load as well as the load okay as well as this current they will have to come from the op amp okay in this cycle whereas in here the current is coming from okay the input itself so it is going on changing with RL so it looks like a full wave rectifier only when RL is very large whereas when RL is small it is looking like a half wave rectifier it depends upon RL so this is not good as a half wave rectifier whereas it is transfer characteristic also is not exactly as that of the full wave half wave rectifier nor is it a full wave rectifier because this is dependent upon the load this is independent of load okay and the output you can see this is the half wave that is produced okay during the positive going input and this is the wave it produces during negative going input and this magnitude is dependent upon RL that is shown for different values of RL so it becomes a full wave like thing okay for large value of RL and half wave like thing for low value of RL so this can be got rid of okay and we can get precisely the correct waveform okay by introducing a feedback path okay during the other half also so for positive going this diode conducts and for negative going this diode conducts and maintains this potential at this point okay at ground potential so that the voltage if it is taken here for the output this is going to produce for positive going cycle okay this will produce a negative going waveform and zero okay at the output maintained by the feedback during the other half of the cycle that is negative going input and if you take the output here it will be that it will give you the positive going output during the negative half of the input so this this kind of half wave rectification okay outputs can be got here at this point and this point this is the negative going half wave that is the positive going half wave okay if you subtract these 2 voltages you will get the full wave that subtractor can be a different amplifier so you can see the transfer characteristic here this is one output and this is the other output this so these are the 2 half wave rectifier outputs possible okay and for getting a half wave you have to use 2 diodes with this trans resistor type of feedback and this is precisely what happens between V01 and V02 for the positive going input negative half and for the negative going the positive half so this is the full wave rectifier this is its output now let us see how the same similar application can be carried out with diode in the feedback path okay only thing is for in the previous circuit we had the resistor here and the diode was here so I have just interchanged the position of diode and resistor of my rectifier circuit incorporating op amp so what happens now this becomes a logarithmic amplifier what is a logarithmic amplifier log can do an operation of data compression so this is data compression data expander put in a negative feedback path gives data compression so if you see a diode okay diode has a relationship of data expansion current is equal to IS exponent V diode by VT this is the diode characteristic this is data expansion if it is put in the feedback path we should get as far as input of the op amp is concerned voltage VI is converted to current of VI by R this current is the one that is now flowing and that is the diode current so I diode is equal to VI by R that has been forced by the op amp trans resistance amplifier so we have here V naught is equal to minus V diode this is 0 okay this is V diode so the condition is VI has to be greater than 0 positive always for such an operation V naught is going to be minus VD and is equal to minus VT log from this expression VI by IS into R okay so it is the inverse operation this I had already pointed out and discussing about system level negative feedback operations so this is a log operation unfortunately IS is okay the reverse saturation current and it is doubling every 10 degree rise in temperature VT on the other hand is an absolute constant KT over Q it is 26 millivolts at 300 degree Kelvin precisely defined however IS is changing a lot with temperature and therefore it requires temperature compensation for it to be used as a data compressor this is the data compression activity it is carrying out so you can see that 100 millivolts to one volt a decade of variation of input voltage is compressed into very nearly let us say 325 millivolts to about 500 millivolts so this is the data compression activity of this particular structure now let us see how this can be the diode can be replaced by a transistor bipolar transistor okay and it does the same function again the circuit as the diode replaced by a bipolar transistor okay with base connected to ground in a negative feedback topology so what this is nothing but this is the first instance of our coming up with the feedback which is active look at this the output of the amplifier is going as input to the common base structure and the output current is going as feedback at this point at the input so this is the current feedback I am talking about so it is a current follower at this point and therefore VI by R is same as the current of the collector that means emitter base voltage has to so adjust itself to make this current same as the input current VI by R so the voltage that is developed here the dependent voltage developed across this is nothing but – VT log VI by R E naught that is because we have again the well known expression what is it I of the transistor right so I emitter is equal to I E naught reverse saturation current of the transistor emitter base junction exponent VBE by VT this we had already discussed when we are discussing the transistors so the output voltage is equal to – VT log VI by R into I E naught instead of IS of the diode we are replacing it by the I E naught the base emitter junction diode reverse saturation current for VI greater than 0 this is what happens so this works only for VI greater than 0 this transistor base log amplifiers transfer characteristic is similar to what we saw with the diode again 100 millivolts to 1 volt one decade variation in input voltage is converted to 520 millivolts to about 620 that means a decade variation per 100 millivolts variation one a decade variation per volt compression now what happens here just let us see this is an active feedback that means earlier we had used this op amp with attenuators in feedback or capacitor in feedback and resistor in feedback however in this case we are using a transistor amplifier which is a common base transistor amplifier so the gain of this is going to be nothing but the collector resistances are you ground this so in the loop you have a common base transistor amplifier okay so the phase shift from here to here is 0 and therefore this is still negative feedback now the gain of this is if this is GM okay this is R the gain of this is GM into R so the open loop gain of this system in feedback is going to be A of this which is typically closely equal to G by VB by us but now there is a DC gain A naught okay that into GM into R that is the modified gain is the negative sign indicating it is negative feedback so the open loop DC gain has been perhaps enhanced by this so this has been actually if you use an internally compensated op amp we had seen like 741 this has been compensated for unity gain right feedback amplifier so it has been compensated for A naught as the DC gain okay with this completely coming to here at the input whereas we have now amplified it by GM R and feeding it back so the DC gain had been enhanced so the Q gets enhanced by route of this GM into R so you can see that since Q has been made equal to 1 for unity gain topology using the second pole into account okay along with GB already this GM into R will enhance the Q into a higher value of root of GM into R times 1 so that is what has sampled okay in the dynamic operation of this device this particular op amp with this kind of feedback is having very high Q so you can see that noise is produced here okay and it is ringing at this particular point okay and it requires frequency compensation how can we be resurrect this operation of this negative feedback stage into making Q equal to 1 for this loop now so I just put a series resistance here so that the gain gets reduced okay now to R by RE from GM into R so if R is right equal to RE then the gain is roughly R by RE okay which is equal to 1 so we have now got back the value of Q equal to 1 for this new loop now okay using the same op amp says 7 for 1 so that means that is what we have done okay in the simulation and we made RE equal to 1K for RE equal to 1K and immediately we saw that it is precisely the input waveform so input is changed okay from let us say very low value okay to a high value okay so an input is a square wave now output also is a square wave but data compressed okay so input is changed from say 100 millivolts to 1 volt and this changes 10 by this amount so you can see this ringing here or the oscillation right because of ringing is stopped by reducing the gain of the active feedback network so this is the effect of compensation of a log amplifier now same circuit okay instead of the RE here I am putting an attenuator R1 by R1 plus R2 so the output will adjust itself so that the same voltage that is appearing here is enhanced by a factor of 1 plus R2 over R1 okay so that is what happens minus VT log VI by IE naught R gets amplified by 1 plus R2 over R1 simultaneously if I make R1 parallel R2 okay equal to the let us say the R or R1 parallel R2 into GM into R1 by R1 plus R2 into the gain here okay is such that this whole thing is going to be having Q equal to 1 then also the frequency compensation is possible. So this is the technique of making use of an attenuator here instead of just a series resistance right to obtain simultaneously amplified portion of the log amplifier and also okay bringing down the Q of the system to bringing it back to 1 now temperature compensation obviously this term is heavily dependent upon temperature IE naught double for every 10 degree rise in temperature how to compensate for this. So in order to practically use this log amplifier what is done is simply the same operation is carried out now VI by R still flows here okay so we have this still equal to VI by R that means this voltage is still equal to VT log VI by R with the negative sign okay but I do not take the output there instead I take the output let us say V naught prime here and V naught here what is V naught prime this is another similar negative feedback structure with the transistor in feedback path and I am injecting a current of VR by R here. So the collector current of this transistor has to be VR by that means this voltage will adjust itself what is the voltage V this is T1 let us say this is T2 so T1 VBE1 is nothing but okay say the same thing earlier it is minus VT log VI by R IE naught whereas VBE2 it is a negative feedback amplifier here okay so this has to adjust itself so that this current collector current is VR by R that means this VBE2 is now minus VT log VR reference voltage that I can fix conveniently by R into same IE naught assumption is these two are perfectly matched which is easily achieved if you purchase a matched pair which is obtained in integrated circuits. So if these two voltages are now going to be appearing here as V naught prime is nothing but okay minus VT log VI R IE naught plus VT log VR by R IE naught so this essentially becomes V naught prime so V naught prime is okay minus VT log VI divided by these two get cancelled. So that is how you are compensating for IE naught dependence by using a matched diode okay which is the emitter based junction of T1 and emitter based junction of T2. So once V naught dash is independent of IE naught we are amplifying it by the same factor 1 plus R2 over R1 R1 by R1 plus R2 is the attenuator so the V naught will adjust itself to be 1 plus R2 over R1 into log VI by VR into VT. So this now is totally independent of IE naught effect and these factors can be adjusted by our design set that this sensitivity of this particular log amplifier is whatever precisely we want to have. So such log amplifiers are readily available in the market okay and one such log amplifier is log 2 1 1 2 by TI commercial log amplifier you can see the matched pair Q1 Q2 here okay and the this is the input sort of log amplifier this is the reference log amplifier together with the attenuator with the output there is a spare op amp which can amplify it further okay. So these are the characteristics parameters of such log amplifier input current range from you can see the nano amperes to milli amperes okay 1 nano ampere to 3.5 milli ampere change several decades okay. So initial 5 decades okay error is only 0.2% okay this is the variation in temperature offset voltage is maximum of 1.5 milli volts only. So power supply limitation okay and internally the reference is generated okay auxiliary op amp is one more okay this is the voltage range where the data gets compressed. So these are the coders or if you put such a log amplifier in feedback path okay then again you can generate anti log amplifiers or inverse operation of log okay exponential amplifier. So this is the inverse operation that we are now performing obviously a diode itself is a data expander you can see that most of the input voltage ranges only of the order of 100s of milli volts as far as the diode is concerned when it is forward biased okay and the current can be varying in decades. So basically a diode is a data expander so you put a diode okay the input of such trans resistor amplifier here this is nothing but a trans resistor amplifier. So it just converts the current of this diode into voltage that is all its function is to convert the current into voltage. So as far as the data expansion activity is concerned it is directly that of the diode. So V naught is equal to once again minus IS exponent VI by VT which is the current of the diode passing through the resistance R develops a potential minus IS into R exponent VI by VT for VI greater than 0 this is the function of the data expander okay. So this if data compressor is the coder data expander is the decoder right. So if you are using it for data compression and data expansion we do not have to worry about temperature compensation precisely right because the same IS okay is being used for both data expansion as well as data compression and therefore the cancel naturally occurs okay. So replacing it by a transistor the diode is replaced by a transistor here and we have the transistor input a transistor therefore is nothing but a data expander only in terms of output in current and input being voltage this is straight away the function. So a bipolar transistor is a data expander by itself and that link to a trans resistance amplifiers in op amp will give us nothing but a voltage conversion of that current okay and this is precisely the data expander. So the role of op amp is only to convert it into voltage here again this does not need any specialized care for frequency compensation because this is already frequency compensated for full feedback so it is going to remain the same Q equal to 1 as far as this is concerned whatever be the input voltage or voltage to current conversion factor so it is totally independent of the input stage. So this is the transfer function data expansion occurs okay this expansion now this also needs precise frequency compensation because IE naught comes into picture if this is going to be used as a standalone data expansion function. So what is done is we generate a current of V reference by R so this feedback system is that this current gets fixed collector current gets fixed that means this voltage is fixed as okay minus VT log okay V reference by R into IE naught. So then that voltage along with the voltage okay this voltage okay plus this voltage what is that voltage this voltage is precisely equal to VI into R1 by R1 plus R2. So that this voltage okay is going to be nothing but okay the input voltage okay so the voltage across this transistor now the VBE of that transistor is going to be nothing but VI R1 by R1 plus R2 okay minus VT log VR by R IE naught. So if you now apply this right the output current of this is going to be IE naught exponent this VBE. So this VBE involves this voltage which is precisely what we want okay so that will come as output and exponent minus VT log VR by R IE naught will give you a voltage of R IE naught by VR to this therefore we just get V reference IE naught gets cancelled with IE naught okay. So once you substitute it here right you will see that the output voltage is going to be precisely this. So this is the way the effect of IE naught can be compensated. So you can see that this current now gets through this resistance R and develops an output voltage which is actually the current is in the other direction this way so this is plus minus so output is positive V reference exponent R1 by R1 plus R2 into VI by VT okay. So this is the way we can obtain compensated exponential amplifier for our application okay. So the output voltage is this into R into IE naught so IE naught gets cancelled with this R into IE naught okay. So that V reference becomes precisely what we want that V naught becomes precisely equal to V reference into exponent R1 by R1 plus R2 into VI by VT. Now this is a combined application of log amplifier and anti-log amplifier to form what is called analog multiplier. So this is the circuit of analog multiplier this is one of the important applications of this log anti-log amplifiers analog multiplier. We have referred to this as an important basic building block in analog signal processing earlier and also shown some of the users of this multiplier as a phase detector and mixer modulator AM modulator etc. So now let us see how such a multiplier can be built. So we have here IX that is the current input to all this trans impedance amplifiers okay. So this current input is going to force a current of IX exactly in the collector of this so this voltage is going to be – VT log IX by IE naught that is because of the feedback here this RE1 is meant for making the frequency compensation okay ahh such that Q of the system is one that we had already seen in the earlier design. Now we have IY forcing the collector current of the other transistor which is having its base emitter in series with the previous one so that these two voltages add. So this current will force this voltage to be – VT log IY by IE naught. So these two voltages are added and therefore the effective voltage at this point is going to be equal to – VT log IX into IY by IE naught square. So this is the voltage here that is applied as input voltage to these two transistors. Let us see what these voltages are. This is again a similar feedback network as earlier like this but it has IR coming through is so this is IR so this is going to be – VT log IR divided by IE naught okay and therefore this is going to be therefore a voltage which is this voltage okay it is – VT okay plus okay so at this point we have a voltage across this which is this voltage – this voltage okay or the positive voltage between this and this for this transistor is going to be nothing but VT log for this transistor I there is positive voltage is going to be this okay this – this okay so it is going to be – VT log IR by IE naught okay plus VT log IX IY by IE naught square. So effectively the voltage across this is going to be VT log okay IX IY by IR this – this okay divided by IE naught. So that is the VBE of this so exponent okay VBE divided by VT into IE naught into IE naught is the current in this I naught that is equal to I naught. So what it is this gets cancelled exponent of log is same as IX IY by IR IE naught IE naught gets cancelled with IE naught okay so this current is going to be precisely IX IY by IR okay that flows through this and develops a potential R into IX IY so that is the output voltage. So we have a multiplier and divider so multiplier come divider already generated with IX IY IR all as positive so this is a single quadrant multiplier come divider is one of the cheapest multiplier that one can build okay and convert it into four quadrant okay when necessary and it has a variety of application in communication signal processing okay and log it is used in communication analytical medical industrial test and general instrumentation okay in opto coupler isolation these log amplifiers are the parts that are normally used analog signal compression. So the photo diode or opto coupler okay is one such data compressor and data expander. So let us look at this opto coupler okay here the this is the data expander okay this is the data compressor so data compressor with data expander okay is what is going to give you some kind of okay linear relationship IE what is going through this LED this is what is called an opto coupler okay and this is the photo transistor. So you can see that this is grounded this is going to be a 0 if this is a negative feedback now you can see a different kind of feedback where this current gets converted as light here through this LED and gets impregnated on this photo transistor and proportionate current gets generated here and this is the negative feedback structure such that this current is precisely equal to this current so that this potential is maintained at 0. So this is current feedback okay so what happens here is that if this photo diodes are exactly identical this current gets exactly reproduced at this point because this is K I this K may depend upon temperature etc but this K tracks with this K that is what is assumed because these are matched pairs of after isolators. So this will generate the same value of K I okay that it has here such as to make this is exactly equal to K I okay so that is the feedback okay which is optical feedback okay associated with the op-amp now so it converts current to light light to current in a loop okay again this loop has to have Q equal to 1 if the design has to work at high speed. So this voltage now if you take it is I into R and it is precisely reproducing the I in let us say this is put in a high voltage environment like a motor or transformer somewhere right. So you want to measure that current leakage current or something of high voltage circuit. So these voltage isolation can be few kilo volts okay this is the measuring circuit as this precisely measures this I here as a voltage one of the applications of optocouplers or isolation amplifiers okay. So in conclusion we have seen how op-amp can be used in negative feedback along with active devices which are non-linear exponential function generators okay in order to get a precise measurement of currents in high voltage circuits okay for data compression activities in data converters etc right particularly I would say I as a transducer human eye let us say as excellent ability of compressing data that the light impinging on the eye okay the intensity okay etc can be precisely known okay from very high bright light to very low dark light. So most of the signal processing activity occurs at the transducer level itself because of the data compression ability of the sensor okay. So that is the coding that is done okay electronically by let us say opto that is diode which is a photo diode or a photo transistor okay. So it is doing a data expansion okay which is converted into data compression if it is put in the feedback part. So now actually speaking we have discussed this kind of circuit already in terms of transistors themselves we have seen that this transistor let us say if it is a bipolar okay if this is VI this current is going to be IE0 exponent VI by VT so it is a data expander okay if you put it in a feedback loop there is full feedback of output current back to input it is a current follower this current is exactly followed here okay. So it becomes if this is II this becomes V0 which is – VT log II exactly same as what we have done with op amp itself without op amp itself it is doing this operation of logarithmic function right okay and then if you therefore combine this okay like this you put a data compressor along with the data expander you get a perfectly linear function okay if these two are identical okay I0 is going to be equal to II this is the basic current mirror. So you can see that current mirror uses similar compensation technique okay to get rid of the variation of IE0 okay in the overall operation of reflecting the output current as equal to exactly equal to input current if these two are perfectly matched. So this is a data compressor and this is a data expander same thing can be said with MOS also it does not make any difference this is a data expander but it is not so efficient as a transistor so we have here K by 2 VI – VT whole square that is a data expander if you put it in feedback this is II so V0 is this is equal to VT plus root of II by K square root okay that is the data compressor right. So you put data compressor along with data expander again get the current mirror. So these are the signal processing activities by using non-linear devices and getting inverse non-linearity you can get perfect linearity covering decays of variation of signal okay it may be current or voltage does not matter okay. So this is the way you can design systems which are perfectly linear in spite of their non-linearity dependence on temperature etc.