Vacuum Tube Modeling with Dynamic Convolution

Jason Traub Department of Electrical and Computer Engineering, University of Florida

Though nearly obsolete within electronics, vacuum tubes remain in high demand for musical amplification [1]; and particularly for . This research discusses reasons for the observed preference and assesses its validity. Furthermore, amplifier electronic circuits are studied and comparisons are made between vacuum tubes and bipolar junction and metal oxide field effect ; the latter two have replaced vacuum tubes in nearly every application, and are responsible for the advancement of the digital computer. Undoubtedly, there exists extreme cost effectiveness in obtaining a computer processing technique to mimic the sound that is applied by a amplifier. Thus, many modeling techniques have been developed and used in commercially successful products. This research discusses several of these methods and ultimately attempts to mimic a vacuum tube amplifier using the dynamic convolution method, proposed by Kemp [2].

Introduction: Light Bulbs, Valves, and Transistors

acuum tubes, or “valves”, as the British call them, were the first electronic component to be able to V function as an amplifier. To give a historical perspective: Thomas Edison invented and patented the light bulb in 1879 [3]; J.J. Thompson’s experiments led to the discovery of the electron in 1897 [4]; and the work of John Fleming and Lee de Forest ultimately led to the vacuum tube in 1906 [5]. This three terminal device allows us to amplify the current and/or voltage of an input signal. A vacuum tube triode consists of two electrodes, the plate (anode) and cathode, separated by a short distance in an Figure 1. 12AX7 Current vs. Plate Voltage characteristic at several evacuated tube. Figure 1(a) shows a body diagram of a grid voltages (Eg) [9] vacuum tube triode. A third electrode (grid) is placed as a the cathode, electrons will be emitted across the vacuum, i.e. wire mesh in between the plate and cathode. Figure 1(b) a current will flow. As we make the grid voltage more and shows the schematic representation. more negative, the more the current between the plate and cathode is impeded. Figure 2 depicts the operation of a 12AX7 vacuum tube triode (taken directly from its’ datasheet). We can clearly see, as we make the grid voltage more negative (lines moving to the right), the current gets corralled.

From Tubes to BJTs and

This relatively crude device was relied upon in electronics th throughout the first half of the 20 century. Everything from (a) Body diagram [6] (b) circuit symbol [7] radio, television, radar, sound reproduction and process Figure 2. Vacuum Tube Diagrams control, used vacuum tubes. Today, however, vacuum tubes As alluded to earlier, vacuum tubes act as an electronic are nearly extinct. By the early 1960s, solid-state transistors valve which controls the flow of current between the plate were steadily replacing vacuum tubes [10]. The same and cathode by the voltage applied to the grid. The device functionality that the vacuum tube pioneered, solid state conducts current through thermionic emission [8]. The transistors did in an immensely more size, power, and cost cathode is heated, directly or indirectly, by a filament efficient manner [11]. connected to a high voltage. A potential difference of The solid-state transistors most commonly used are hundreds of volts is applied between the plate and cathode Bipolar Junction (BJT) and Metal Oxide Field Effect terminals. When the plate is more positive with respect to (MOSFET) transistors. The physical operation of these University of Florida | Journal of Undergraduate Research | Volume 17, Issue 2 | Spring 2016 1 JASON TRAUB devices rely on charge transport between doped We will discuss the validation of this preference in the semiconductors [12]. A BJT is a current controlled device, following section. After an appreciation for the complex and while the MOSFET is a voltage controlled device. The “imperfect” signal processing that vacuum tube circuits construction of these devices consists of no gaps, or inherently apply, we will discuss methods of modeling this vacuums, and involves point to point contact of solid-state effect in the digital domain. The dynamic convolution doped semiconductors. method has been chosen for detailed study and A rudimentary cross section of a MOSFET and a BJT is experimentation. The final section documents the results and shown in Figure 3. The fundamental physics of MOSFET methodology of this experiment and explains the operation works like this: in the substrate, there exists a p- tribulations experienced. Finally, this research offers a doped region (hole dominant) between two n-doped regions course of action for our future successful implementation of (electron dominant). An oxide insulator is placed above the dynamic convolution. p-doped region and an electrode (gate) is placed on top. The two n-doped regions are the drain and source electrodes. Perception and Psychoacoustics: Why Do When a positive voltage is applied at the gate, electrons in Vacuum Tubes Remain Relevant? the p-doped region are attracted to it. Thus, a channel for current flow develops. The direction of the conventional It is known that a large amount of musicians and current in each device is given by the direction of the arrow. audiophiles prefer the sound of vacuum tube over their solid-state counterparts [1]. Perhaps the sound of a vacuum tube amplifier has become iconic due to their extensive use on music from the 1960s. While this argument is somewhat relevant, it does not reveal the objective and subjective merits that tubes actually warrant. Much of the desired sound of electric guitar stems from how the signal distorts. In most practical engineering situations, we do not want to distort the signal at all. However, when musicality is our primary concern, this does not necessarily apply, since the listening experience is (a) MOSFET (b) BJT ultimately subjective. People continue to use tubes, because people simply like the sound better! Let’s explore the, fairly Figure 3. cross sections convincing, objective reasoning behind this. According to research done by Russel O. Hamm [14], A BJT works on similar fundamental. Here we have, there is an audible quality difference between tubes and again, a p-doped region (base) between two n-doped regions solid-state components that is perceivable and objectively (collector and emitter). In this case, instead of a voltage measureable. Vacuum tubes distort more gently than solid- induced channel, we directly inject carriers into the doped state transistors, particularly in the high frequency range. region, which allows for current flow. It is of note that, no Non-linearity causes , and distortion generates current flows through the gate of a MOSFET, due to the harmonics. Hamm’s research explains the difference in insulator oxide. terms of the harmonics generated when driven into It is essential to note that, the principle of operation of all saturation. Tubes exhibit strong 2nd and 3rd harmonic three devices (tubes, BJT, and MOSFET) remain the same: content, with the 4th and 5th harmonic’s power increasing as the current between two nodes is controlled by the the signal is driven more and more into saturation. The current/voltage applied to the third. author claims that even harmonics add body to the sound, To conclude this introduction, the development of the whereas, the 3rd harmonic contributes to softening the sound. vacuum tube and its associated electronic functions have He adds that, the 5th harmonic adds a “metallic sound that been monumental in the advancement of technology and gets annoying in character as its amplitude increases” [14]. human achievement. The advent of the solid-state transistor The author further notes that, higher order harmonics add has progressed this technology, by implementing the same attack and bite to the sound. Thus, the perceived tonal electronic function, yet, much smaller, more power efficient, advantage of vacuum tubes can be explained by the fact that and more reliable. It is the fact that we can fit billions of solid-state components have strong, objectionable high transistors on a single computer chip [13] that is responsible frequency components when only slightly driven into for the highly advanced functions computers perform today. saturation. Tubes, on the other hand, deliver pleasing, and In spite of the many advantages of transistors, the major sought after, harmonic tones that rise in harmonic character question of this research remains: Why do vacuum tubes as the input signal increases. remain relevant? Why do they remain in high demand for According to the IEEE spectrum article, “The Cool Sound guitar and other audio amplification purposes? of Tubes” [1], other characteristics of vacuum tube amplifiers also have a substantial effect on their sound. For

University of Florida | Journal of Undergraduate Research | Volume 17, Issue 2 | Spring 2016 2 VACUUM TUBE AMPLIFIER MODELING WITH DYNAMIC CONVOLUTION example, it is noted that the high voltage output , Dynamic Convolution used specifically in vacuum tube amplifiers, has a tremendous effect. This effect is explained by the 2nd and 3rd Convolution can be implemented to model a system, with order harmonics generated with surprisingly low inter- perfect accuracy, in theory, if the system is linear, and time- modulation distortion [1]. The author further notes that the invariant. However, the distortion we seek to emulate is, in unique circuit components used can also affect the sound. it of itself, non-linear, therefore violating the conditions of Finally, it is claimed that a natural compression of the audio the convolution theorem. However, dynamic convolution signal takes place when played through a tube amplifier, an has been proposed and implemented, by Kemp [2], to get effect known as “infinite sustain” [1]. around the non-linearity. Kemp’s research gives specific reference to its success in modeling vacuum tube amplifiers. Modelling the sound in a computer The discrete convolution formula used is: (푥 ∗ ℎ)[푛] = 훴푖ℎ[𝑖]푥[푛 − 𝑖] (1) There have been plenty of attempts to recreate the desired For dynamic convolution, instead of inputting one unit tube distortion, both in analog and digital (or hybrid) amplitude impulse into the system, we input a series of implementations. It has been alluded to, and explicitly noted impulses, at different amplitudes, and obtain the impulse in [15], that the shortcomings of tube amplifiers (large size, response from each. We normalize the response by the weight, poor efficiency), offers an obvious motivation for impulse amplitude, as performed by Kemp. obtaining an emulation method. Cost and convenience, for Figure 4 shows a block diagram of the dynamic the consumer, as an alternative to buying a vacuum tube convolution algorithm. amplifier, suggests a market. This research, in the following paragraphs, focuses primarily on digital methods of emulation. To be able to model the sound applied by a vacuum tube amplifier, we must think about how all factors affect the output. Since the output sound is a function of how the device physics alter the signal along its path, it seems reasonable that, if we obtain a mathematical transfer function, we can emulate our output. Advanced research, focusing on the use of physical modeling for emulation of a distortion overdrive pedal, has been done [16]. Through advanced methods of solving linear and non-linear differential equations, this method has delivered pleasing Figure 4. Dynamic Convolution Algorithm Diagram results. Each sample input, x[n], is compared to the test impulse Another method of obtaining musical distortion is to amplitudes, di. The hi, impulse response, corresponding to utilize a wave-shaping function, as performed by Fernandez the di that most closely matches x[n] is selected. The output [17]. In this method, wave parameters can be chosen by the sample y[n] is computed directly using (1), using only the musician to achieve “highly personal” sounding distortion. current value of n. Then we increase n by 1, take the next The abstract notes that this should be regarded as a x[n], find the new hi corresponding to it, take the single-n “distortion synthesizer” of sorts, rather than an emulation convolution again, and repeat the process until all points in technique. the input, x, have been processed, and our output, y, has been An example of a commercially successful technique in generated. tube digital emulation is given under a patent [18], and known as Tube Tone Modeling (owned by Line 6). In this method, an eight times oversampling block, in an embedded Experimental Method processor, is used to handle the high frequency distortion and obtain a vacuum tube-like sound. We obtained a range of impulse responses from our Due to the complexity of the precise signal alteration, the system corresponding to impulse amplitude di. Specifically, unpredictable nature of the underlying device physics, the di = ± [1 – (i/128)]; i = 0,1,…,128 (2) number of interrelated variables, and other factors, this If Zi is the response of the system from di, we normalize Zi research chose to utilize a black-box approach and take by di to obtain hi. system measurement from input to output to derive a In practice, a la Kemp, we input a series of step signals at transfer function. How to obtain this transfer function and the amplitudes given in (2). Thus, we obtain the step employ it to generate an output, is given by the dynamic response. The impulse responses are calculated by convolution method [2]. differentiation. The method was performed as follows. First, we gather test data (sampled at 4 times our sampling rate of 44.1 kHz,

University of Florida | Journal of Undergraduate Research | Volume 17, Issue 2 | Spring 2016 3 JASON TRAUB i.e. 192 kHz). Processing of the data consists of down- We feel confident in the dynamic convolution algorithm sampling, differentiation to get our impulse response, and developed, since it collapses to normal convolution when normalizing the response by the test amplitude. We given a matrix of all of the same impulse response vectors. developed a ParseImpulseResponse.m function to first find Since it is difficult to input pure impulses into our system, the peak in the impulse signal, and associate it to its and we achieved poor results through the method attempted corresponding impulse response. The output of this function thus far, we decided to attempt to characterize and obtain is a matrix H and row vector D. The columns of H are hi, our system data in the frequency domain. The Digilent corresponding to impulse amplitude, di, stored at the same Analog Discovery’s Network Analyzer function was column index in D. employed in this development of the research. Here, the A dynamic convolution algorithm was constructed that network analyzer inputs the entire frequency range and takes in an input vector, the impulse matrix, H, the outputs a graphical display of the Bode plot. It is reassuring amplitude vector, D, and generates the output, y. to have a mild check of the accuracy of the data, by being able to hear the signal and see the response match. Experimental Results

The step input used is shown, by measurement with a Digilent Analog Discovery oscilloscope, in Figure 5(a). Its corresponding step response is given in Figure 5(b).

(a) Impulse Input (a) Step Input Response

(b) Step Response

Figure 5. Step Input and Step Response

We were unable to satisfactorily implement the dynamic (b) Impulse Response convolution algorithm with this test data. As an illustration Figure 6. Derived Impulses and Impulse Response of our source of error, we see our derived impulse and impulse response in Figure 6 (a) and (b). The derived signal In this development, we input sinusoids of different did not meet expectation. First of all, we see a maximum amplitudes. The Bode diagram, which plots magnitude and impulse of around 2, when our maximum step was at 1. phase, already takes care of the normalization for us. From Also, the impulses are not consistently decreasing; some this experimental data we were able to analyze key factors impulses are drastically smaller or bigger than adjacent in the distortion we hear, namely, how the voltage output impulses. This is a clear source of error. compares to the voltage input as the amplitude and frequency of our signal change. These results are depicted in Figure 6, 7, and 8.

University of Florida | Journal of Undergraduate Research | Volume 17, Issue 2 | Spring 2016 4 VACUUM TUBE AMPLIFIER MODELING WITH DYNAMIC CONVOLUTION To generate these plots, we first observed the output Bode plot from a range of amplitudes: Ai = 100 mV · i; i = 1,2,3,…,10 (3) For greater precision, we might want to use a 10 mV step. These results are depicted in figure 9.

Figure 6. Vout vs. Vin for a 500 Hz sinusoid Figure 9. Magnitude plots from different test amplitude sweeps

From left to right:

Row1:100mV,200mV,300mV,400mV,500mV

Row2: 600mV,700mV,800mV,900,mV,1V

Here, we see a general high pass filter effect of the amplifier, which is likely primarily due to the 6” speaker. The cutoff frequency for this high pass effect is roughly 80 Hz. We see a common dip in the pass band, at around 450 Hz, whose presence diminishes as our test amplitude increases. The high frequency response has an additional gain boost. The gain gets steadily larger from 1 kHz to 20 kHz in what is ultimately more than a +10 dB gain than that of lower frequencies in the pass band. Again, this effect also diminishes as our test amplitude increases. As the test Figure 7. Vout vs. Vin for a 1000 Hz sinusoid amplitude approaches 1 V our response is fairly flat for 80 – 20,000 Hz. These results show substantial non-linearity, and All three graphs see saturating distortion at high voltage thus distortion, especially for the high frequencies. levels. The non-linear distortion obtained is much harsher To proceed with this test data, we need further and abrupt at higher frequencies. This is a reassuring result conditioning of our data. We seek to obtain the impulse and coincides with the results from Hamm. response from our Bode diagram. The discrete Fourier transform (DFT) of the impulse response is essentially the frequency sampled version of our Bode plot. Thus, we must convert the magnitude and phase presented in the Bode diagram to a polar coordinate. We need to be aware of frequency resolution in a discrete Fourier transform and sample the Bode plot accordingly. This requires a fairly advanced interpolation algorithm. We could then apply the inverse Fourier transform to obtain our impulse response and be able to apply our dynamic convolution algorithm (unless we can figure out how to apply dynamic convolution in the frequency domain). This attempt to apply the dynamic convolution method proposes its own challenges and limitations and perhaps makes achieving our end goal even more difficult. Further experimentation must be explored and developed.

Figure 8. Vout vs. Vin for a 10 k Hz sinusoid

University of Florida | Journal of Undergraduate Research | Volume 17, Issue 2 | Spring 2016 5 JASON TRAUB CONCLUSIONS REFERENCES

The chronological history surrounding the advent of the [1] Barbour, E. 1998. “The Cool Sound of Tubes.” IEEE vacuum tube was introduced. This component provided Spectrum 35(8):24–35. remarkable advancement within electronics, allowing a [2] Kemp, Michael J. Analysis and Simulation of Non-Linear Audio signal to be amplified for the first time, among other Processes Using Finite Impulse Responses Derived at functions. Over the next few decades, more efficient Multiple Impulse Amplitudes. Audio Engineering Society 106. technology came in the form of solid-state transistors, which [3] "The History of the Light Bulb." Energy.gov. Web. 04 Apr. 2016. displaced vacuum tubes due to their vast improvement over tubes in size, cost, and power efficiency. The digital [4] "Joseph John Thomson | Chemical Heritage Foundation." Joseph computer would not exist as we know it, if not for the John Thomson | Chemical Heritage Foundation. Web. 04 Apr. incredibly small size we can manufacture transistors. 2016.

Objective benefits aside, people still revere vacuum tubes [5] "Sir Ambrose Fleming: Father of Modern Electronics." Sir Ambrose for their use in musical equipment. The subjective sound Fleming: Father of Modern Electronics. Web. 04 Apr. 2016. quality of tubes is attributed to several reasons. One particularly illuminating reason is that the harmonic content [6] By Svjo (Own work) [CC BY-SA 3.0 of tubes in saturation is much more pleasing than that of (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons solid-state transistors. Others claim that the role of the output transformer, circuit topology, and components used [7] Bemoeial at nl.wikipedia [GFDL in old vacuum tube amplifiers provide much of the desired (http://www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 sound, as well. (http://creativecommons.org/licenses/by-sa/3.0/)], from Wikipedia Commons Nonetheless, the tube sound is here to stay for subjective and objective reasons. Moreover, this presents extreme [8] "Thermionic Emission." Web. 4 Apr. 2016. motivation for obtaining an accurate computer modeling . Lecture method to apply the sound of a vacuum tube amplifier Notes without experiencing the disadvantages of the technology [9] Radio Corporation of America, “Hi Mu Twin Triode”, (poor power efficiency, frequent maintenance, bulky size 12AX7 datasheet. 30 July 1947. and weight). Of the several modeling techniques employed in the [10] Bortz, Alfred B., PhD. Physics: Decade by Decade. musical distortion realm, this research chose to investigate [11] "Vacuum Tubes and Transistors Compared." Effectrode. 2011. the dynamic convolution method. Web. 04 Apr. 2016. Dynamic convolution is a promising method. It utilizes the power of convolution, and applies it to a non-linear [12] Streetman, Ben G., and Sanjay Banerjee. Solid State Electronic system. By choosing an appropriate impulse response for Devices. Upper Saddle River, NJ: Pearson/Prentice Hall, 2006. each input sample, we can perform convolution by [13] "Intel Microprocessor Quick Reference Guide - Product Family." dynamically changing the impulse response used. Intel Microprocessor Quick Reference Guide – Product Difficulties in data obtainment and accurate algorithm Family. Web. 04 Apr. 2016. construction prevented this research from achieving a successful implementation. However, we are optimistic [14] Hamm, R. O. 1973. ”Tubes Versus Transistors—Is There an Audible Difference?” Journal of the Audio about this method’s future success. Going forward, the Engineering Society 21(4):267–273. following inquiries will be addressed: [15] Pakarinen, Jyri, and David T. Yeh. "A Review of Digital 1. How can we rely on and obtain accurate impulse Techniques for Modeling Vacuum-Tube Guitar response data? Amplifiers." Computer Music Journal33.2 (2009): 85-100. Web. 2. Is 10 different impulse amplitudes enough? Is 128 required, as performed by Kemp? [16] Yeh, David Te-Mao. Digital Implementation of Musical Distortion Circuits by Analysis and Simulation. PhD diss., Stanford If we find reliable data, perform accurate algorithms, and University, 2009. take enough impulse amplitudes (this may correspond to the [17] Fernandez-Cid, P., and J. C. Quir ´ os. 2001. “Distortion of resolution of our dynamic transfer function), we believe this Musical Signals by Means of Multiband Waveshaping.” method will lead to a successful implementation for the Journal of New Music Research 30(3):219–287. emulation of vacuum tube amplifiers. Moreover, we have illustrated a very powerful tool of non-linear system [18] Diodic, Michel, Michael Mecca, Marcus Ryle, and Curtis Senffner. Tube Modeling Programmable Digital Guitar Amplification modeling. System. Diodic, assignee. Patent US 5789689 A. 4 Aug. 1998. Print.

University of Florida | Journal of Undergraduate Research | Volume 17, Issue 2 | Spring 2016 6 VACUUM TUBE AMPLIFIER MODELING WITH DYNAMIC CONVOLUTION

[19] Damelin, Steven B., and Willard Miller. The Mathematics of Signal Processing. Cambridge: Cambridge UP, 2012. Print.

[20] ALLEY, Charles Loraine, and Kenneth Ward. ATWOOD. Electronic Engineering. 3rd Ed. New York, London: Wiley, 1973.

[21] Yoon, Y.K. "MOSFET." Lecture.

[22] Yoon, Y.K. “BJT.” Lecture.

University of Florida | Journal of Undergraduate Research | Volume 17, Issue 2 | Spring 2016 7