Technical Report No. IRL-1017 April 1, 1965 THE USE OF A LOGARITHMIC AMPLIFIER IN DATA PROCESSING OF ANALOG SIGNALS Walter E. Reynolds Instrumentation Research Laboratory, Department of Genetics Stanford University School of Medicine Palo Alto, California THE USE OF A LOGARITHMIC AMPLIFIER IN DATA PROCESSING OF ANALOG SIGNALS Prepared by Walter Reynolds Technical Report No. IRL-1017 April 1, 1965 Prepared under NATIONAL AERONAUTICS AND SPACE ADMINISTRATION Grant NsG 81-60 'Cytochemical Studies of Planetary Microorganisms: Explorations in Exobiology"' Principal Investigator: J. Lederberg Program Director: E&. Levinthal Instrumentation Research Laboratory, Department of Genetics STANFORD UNIVERSITY SCHOOL OF MEDICINE Pale Alto, California Abstract A number of aspects of usage of a logarithmic amplifier for data compression and low level resolu- tion are given. These include an example of data interpretation and a derivation of error figures. An appendix contains a circuit and specifications of the logarithmic amplifier used. Contents Introduction Effect of Linear Error on Transmission of Logarithmic Data An Illustrative Example of Data Interpretation Further Work tndicated Sources of Logarithmic Transfer Elements Appendix A: An operating Manual for the Model 100-9 Logarithmic Amplifier Figure I. Figure @. Figure 3. Figure 4. illustrations An Assumed Model of Data Transmission. A Linear Recording of an Event. A Logarithmic Recording of an Event. An Example of a Recorded Spectrum. !. Introduction. Outputs of some physical and biological detection instruments contain information over a very wide range of values. In the case of a mass spectrometer this range can exceed | : 30,000. Visual interpretation of analog signals has a normal resolution of only 1 : 100 to | : 1000. Ana- log to digital conversions may be used, but also seldom exceed | : 1000. In cases where visual Interpretation is made from strip chart recordings, some improvement is obtained by multiple trace recordings, each trace at a different gain so that at least one of the traces has a usable range in all points of interest. Similar digital techniques, however, are dif- ficult and awkward. A logarithmic data transformation can make a very useful data com- pression device. Such techniques have been employed here with some suc- cess and much promise. An amplifier based upon a circuit reported by J.F. Gibbons and H.S. Horn! has been built by the Genetics Department Instrumentation Research Laboratory, Stanford Medical School, and used there and in the Chemistry Department, Stanford University (See Addendum to this report detailing a Model 100-9 Logarithmic Amplifier.) Particu- lar applications have included analog to digital recording of mass spec- trometer data and logarithmic analog to strip chart recordings of similar data to detect very low level metastable ion phenomena. A forthcoming communication in Analytical Chemistry” describes the uses and advantages of logarithmic data transfer to the identification of metastable ions. In this case the useful information was at an amplitude of only | part in 100,000 of the peak amplitudes. This (logarithmic) system has been used in the author's laboratory in conjunction with an Atlas CH-4 mass spec- trometer, the recording system of which suffers from the disadvantage that It requires manual attenuation in the recording of a given mass spectrum, necessitating several scans if one wishes to obtain accurate intensities of both the strong and weak peaks. This is especially true if one is trying to observe metastable ions which appear as weak broad peaks. 3 Further, it was noted that the logarithmic plots show a considerable num- ber of metastable peaks not apparent in linear recordings, but also pro- duce a spectrum which is far easier to count. The logarithmic plot was 1. able to record all the information in one scan. Logarithmic data transfer promises to be very useful as a prior step in analog to digital conversions for digital computer analysis of mass spectra and other similar signals. Analog to digital conversion ef- fectively wipes out all linear low level signals that lie below the mini- mum analog to digital resolution. An Improvement in resolution by a fac- tor of as much 10° can be obtained by means of the logarithmic transforma- tion. tt) Effect of Linear Error on Transmission of Logarithmic Data. The errors resulting from noisy handling of logarithmic analog sig- nals are quite different from those produced by normal linear analog data processing. In this section the error expressions are derived from re- trieved data. It will be shown that for large signals the error ratio is increased and that for small signals it is decreased. In all cases the error is proportional to the signal. The logarithmic analog signal will in almost all cases be handled by some linear data transmission device. This may be a strip chart recorder, magnetic tape, meter movement, analog to digital converter or some com- bination of these. It is typical of this class that they have an uncer- tainty or error that is a constant percentage of the maximum signal proc- essible. The following model is assumed. An ideal logarithmic function is as- sumed for the amplifier and an ideal antilogarithmic output function is assumed at the output. All errors are assigned to the data transmission device. Xy Log x, Linear data Antilog * | + ~ transmission Device or = __ | LogKN. x] + Xt Xo | = NY Calculation|[ Log X, Logarithmic amplifier Figure 1. An assumed model of data transmission. Ce Logarithms are defined only for positive numbers; hence the log ampli- fier has an output for only positive values. Furthermore, the output of the model 100-9 log amplifier has a minimum output corresponding to roughly 1, or Xp mm Xe And there is a maximum limit of x, Xnax? imposed by physical limitations of the logging amplifier. Hence the log ampli- fier may be used over a range of x, < x; < Xmax’ It should also be noted that the user may elect to scale his input to some Xnax less than that of the amplifier. The log amplifier has an output x, * log, k(x,/x,) where log, k is a scale factor of the log amplifier. If k= x, x, = log, Xs If k #X. it only applies a scale multiplier to the output and does not enter into the error analysis. Let the dynamic range used be R, defined as R = Xanax! *r The output of the log amplifier will range from log, kx to log, kx ax xX, max - x)min = Tog, kx. - log. kx ax = log, R Note that b is undefined. The output curve of the log amplifier could represent log x; to any base. Selecting the base simply puts analog numerical values at points on the curve. R may be expressed as a ratio, decades, nepers, or octaves. For example, with R = 10? » R is 9 decades, 20.7 nepers, or 29.9 octaves. Similarily log x may be expressed or con- verted to any of these quantities. [t is normal in linear data transmission devices to express noise as a fraction of the maximum signal. FollowIng this custom and assuming that log, R is scaled to be equal to this maximum signal, em N log. R where N is the noise ratio of the linear data transmission device. The output of the linear data transmission device has an output of: x, = log x, +e (assumed k = x.) = log, x + log, RN = log, x RN After taking antilog to base b through the antilogarithmic device, x om x RN {f N is small compared to R, x= x ( 1 + Nin R) where In is the natural logarithm. Letting XX Fe where e. is error at the output, xX, + e@ mx, + x, NInR i oO i i e mx, NInR oO i It can be seen that the uncertainty (error) after data retrieval by the antilog operation has a value equal to a constant ratio of the input signal, Xie And this ratio is the noise factor of the data transmission device times the natural logarithm of the allowed range of xX. An interesting value to investigate is that value for which the er- rors of a linear and logarithmic signal are equal. This would be the value of x which would produce equal uncertainty whether transmitted in linear or logarithmic form: e me oO x; N, log R = No x 1 max where Ny is the noise factor during the logarithmic transmission and N 2 is the noise factor during linear transmission. If indeed tog R = Xmax in the two cases, then N, = Nos x _ 1 Ne x In R N max ] lf R Is In decades In R Its approximately 2.3 R. x1 /Xnax = (1/2.3R) (B/N, ) Therefore, for a value of x; below that given by the above equation, the accuracy of the retrieved values of x is improved by logarithmic pro- cessing, and for values above that the accuracy decreases. The following example illustrates these points: the linear transmit- ting device is a strip recorder with an accuracy given as 0.2% of full scale, 5 inches. Xp was selected as 1 mv and set at 1 inch. Ny calculated as a ratio over the 4 inches used Is N, = .002 (5/4) 1 m 20025 R over this same range is 4 decades = 10". Inr = 9.2 4 Xnax then is ] m/ x 10° = 10 volts Error ratio of retrieved data is then Ny In R = .0025 x 9.2 or 2.3% at any amplitude. The point of equivalent error as compared with linear chart record- Ing can be found. If x 1. of the linear recording Is 5 volts, then N, = O01 referred to 10 Inches full scale (10 volts) x, ™ 1 x .002 x 10 = .4k volt 9.2 0025 Figures 2 and 3 illustrate what may be expected. Figure 2isa linear recording of an event. At the right are plotted values of ex- pected uncertainty. Figure 3 is the recording on the same recorder of a logarithmic signal with, again, the expected uncertainty. By comparing Figure 2 with Figure 3 It can be seen that e, has the same value on both plots at .44 volts. Also e/% has the same value at .44 volt. At sig- nal points above thls voltage the linear recording can be expected to have greater accuracy. For signal points lower than 44 volts greater accuracy can be expected with the logarithmic processing. 5. Uncertainty €9 as a ratio e,/x; T VOLTS 0 O10 .020 -030 T em cm ee et ee es |e ee Ol a N — per) | | | | | Co | | Xi 0.44 — ' Ja ne > A os = AVY | 0 02 04 VOLTS .06 Linear Recording of x; ~ - - Uncertainty e, in volts Figure 2. A linear recording of an event. Recorded on a 5"' chart with an accuracy of 0.2% full scale. The curves at the right plot this uncertainty as a function of the signal. Uncertainty @€g as a ratio eo/x; VOLTS 10 rr we 0 O10 -020 .030 | { : iy ’ . Mi : | cre bone pee Lee] ~ _—_— | eo ae a 0.44 - V sd Ft : 0.1 Ol -OO0l 0 .02 .04 VOLTS .06 Recording of log Xx; - - - Uncertainty e, in volts Figure 3. A logarithmic recording of a similar event to that of Figure |. This is the recording of log xj- The curves at the riqht plot uncertainty as a function of the logarithmetic signal amplitude. (Note: Figure 2 and 3 are of similar, but not identical, signals.) tl An Illustrative Example of Data Interpretation. Figure 4 is a reproduction of a logarithmic plot from a mass spec- trometer. This has much usable information, but is also a severe ex- ample of an effect a logarithmic amplifier will accentuate: "drifting base line'' in the signal. The very high resolving power of the logar- ithmic amplifier at very low signal levels will make what was an other- wise acceptable zero drift appear to be a major portion of the signal. However, upon careful examination it will be seen that no information is actually lost. The ''drifting base line'' deserves some special explanation and evaluation. The signal of Figure 4 is from an amplifier on a mass spec- trometer that has a O to 20 V dc output range. The amplitude of the signal between well defined peaks is theoretically zero, but some drift is inevitable. Only the amount of drift is subject to criticism or per- haps engineering improvement. Since this signal was normally recorded in a linear manner at about O to 5 V range, a drift of 0.1%, or 5 mV, would probably be acceptable. The instrument would be adjusted so that this drift was plus or minus about zero. If this signal is to be processed through a logarithmic amplifier, other considerations must be made. The log of a negative number is un- defined and the log of zero is minus infinity. Both tie out of the range of physical realization by an amplifier. The logarithmic ampli- fier used has a number of reference settings, from 1 uV to 10 mV. When set at a particular reference, only signals between that reference and the upper input limit of the amplifier give meaningful output. Signals below the reference are lost in negative saturation (actually a toler- ance of about .5 to .7 of the reference is permitted, giving an output of about .8 as a minimum.) To insure that the signal to the logarithmic amplifier is never nega- tive, it is recommended that the zero set of the signal be offset in the 8. positive direction so that the lower excursions of the signal remain with- in the allowable limits of the logarithmic amplifier; i.e., above the ref- erence selected. Since this can be as low as I uV, this "offset positive’ can be almost arbitrarily low. In fact it turns out that the logarithmic amplifier is by far more sensitive to detection near zero than any other detector used normally on such systems, and hence the “offset positive'' can be nearer zero than supposed zero settings using linear detectors. The Model 100-9 logarithmic amplifier has ''Reference'' and ''Scale'' set- tings; with these, an output corresponding to log (signal/reference = |) and log (signal/reference = 10") may be obtained. In Figure 4, the re- corder was adjusted so that reference (1 mV) was set at 1 inch; log 10, or one decade (10 mV) was set at 2 inches; two decades at 3 inches, etc. Conveniently, this has now scaled the chart so that the inches, ex- pressed in decimal form + from the first inch level, are the logarithm to the base 10 of the amplitude divided by the reference. The ''zero 1 0.65) = 4h mV. This drifts downward until it passes below the reference and then rises to about 10 mV. drift'' can be seen to begin at about | mV (log Examples of calculation of peak amplitude (all values expressed in mV): Peak amplitude of ''A'' x antilog 1.58 - antilog .55 = 38 (peak) - 3.5 (zero offset) = 34.5 Others are: "BY = antilog 2.29 - antilog .48 = 195 - 3 = 192 "C= antilog 3.57 - antilog .70 = 3720 - 5 = 3715 "'D'' = antilog .84 - antilog .O = 6.9 - 1 = 5.9 NE" = antilog .94 - 7 = 8.7 ? = 87 Information about zero line is lost. "FM! w@ antilog 3.28 - antilog 1.0 = 1910 - 10 = 1900 The local rise in base line here appears to be lack of resolution be- tween peaks within the spectrometer. NG! m antilog 1.23 - antilog 1.02 = 17.0 - 10.5 = 6.5 ge Inches + Iv ie - | mM | | | hou my | A Ln. 10 mV . , 1 mV ° . i 2 Time Figure 4. K An example of a recorded spectrum. Vol tage It was shown in Section II that the uncertainty due to errors in the data transmission would be a constant percentage of the signal. In this case the recording and reading back of the signal on a strip chart record- er would be the data transmission. Assuming a .5% accuracy of full scale inches of the chart, N = .005. The range is five decades or 10°; In 10° = 11.5. The uncertainty is then n InR = 5.75%. A summary of the above values with expected uncertainty versus the expected uncertainty in linear recording is informative: Peak Amplitude Expected uncertainty Expected uncertainty mV with log transmission with linear transmission mV percent mV percent A 34.5 2.0 5.84% 25 73.0 % 8 192.0 11.0 5.8% 25 13.0 % c 3715.0 212.0 5.84% 25 -7 % D 5.9 0.3 5.8 % 25 425.0% E 8.7 0.5 5.04 25 285.0 % F 1900.0 108. 0 5.8% 25 1.3 % G 6.5 0.4 5.84% 25 390.0 % IV Further Work Indicated- The signal of Figure 4 was an example of very severe base line drift, and is not supposed to be an example of a desirable signal; however, the problem does exist to some extent with any real analog signal. In general it may be said that use of the logarithmic amplifier with signals that have base line drift does not result in the loss of any information, but base line drift does limit the usefulness of the logarithmic amplifier to resolve very small signals, Further work is being done to investigate the possibility of using the logarithmic amplifier itself to detect base line drift and to gener- ate an appropriate error signal. Then this error signal could control a dc bias applied to the original signal to drive the base line to a pre- selected reference. V Sources of Logarithmic Transfer Elements. The amplifier described in Appendix A uses a Fairchild FSP-30 PNP silicon transistor as the logarithmic element. This is employed as de- scribed In reference (1). Other commercial elements are available. Nexus Research Labora- tory, Ince Canton, Massachusetts has a Type LGR-6 Logarithmic Ratio Mod- ule. George A. Philbrick Researches, Inc., Boston, Massachusetts, has a type PLI module and others under development. Principle manufacturers of oscilloscopes and x-y recording equip- ment are known to be developing instruments with electronic logarithmic conversions. It is expected that such instruments, with visual logarith- mic displays, will soon be announced as commercially available. te. References Gibbons, J.F. and H.S. Horn; A Circuit with Logarithmic Transfer Response Over 9 Decades. IEE Trans of Circuit Theory Group. CT-11, September, 1964. Alpin, R.T., H. Budzikiewicz, H.«S. Horn and J. Lederberg; Logarith- mic Recording of Mass Spectra, Especially Peaks from Metastable lons. To be published in Anal. Chem., early summer 1965. Ibid. Lederberg, J.; An Instrumentation Crisis in Biology. NASA Status Report through April 1, 1963: '"'Cytochemical Studies of Planetary Microorganisms, Explorations in Exobiology''