
IEEE TRANSACTIONS ON SPEECH AND AUDIO PROCESSING, VOL. 18, NO. 3, MARCH 2011 1 Automated Physical Modeling of Nonlinear Audio Circuits For Real-Time Audio Effects - Part II: BJT and Vacuum Tube Examples David T. Yeh, Member, IEEE Abstract—This is the second part of a two-part paper that ing of musical acoustics to solve in real-time the ordinary presents a procedural approach to derive nonlinear filters from differential equations (ODEs) of nonlinear circuits. Software schematics of audio circuits for the purpose of digitally emulating was developed that accepts circuits described in netlist form musical effects circuits in real-time. This work presents the results of applying this physics-based technique to two audio and given user design parameters, generates a real-time non- preamplifier circuits. The approach extends a thread of research linear circuit simulator. This software, sound examples with that uses variable transformation and offline solution of the various input signals and real-time effect plugins are available global nonlinear system. The solution is approximated with at http://ccrma.stanford.edu/~dtyeh/nkmethod10. The plugins multidimensional linear interpolation during runtime to avoid were prototyped using the LV2 audio effects framework1 using uncertainties in convergence. The methods are evaluated here experimentally against a reference SPICE circuit simulation. The open-source audio and math libraries. circuits studied here are the BJT common emitter amplifier, and A review of related work in real-time models of musical the triode preamplifier. The results suggest the use of function circuits and a brief summary of this method are presented, approximation to represent the solved system nonlinearity of the followed by the model and simulation results of two example K-method and invite future work along these lines. circuits. Index Terms—Virtual analog, physical modeling synthesis, guitar distortion, guitar amplifier modeling, vacuum tube amplifier, real-time audio, circuit simulation, nonlinear filters, K-Method, ODE solver, II. PREVIOUS WORK EDICS: AUD-SYST A variety of methods for digital emulation of nonlinear musical circuits have been attempted through the years [2], I. INTRODUCTION [3]. Most commercial approaches rely on some combination HIS is the second part of a two-part paper that presents of waveshaping with filtering, which is a simplified approach T research to model and simulate highly nonlinear circuits to simulating the nonlinear behavior of the circuit. used primarily for electric guitar effects. This method in its Nonlinear processing multiplies the bandwidth of the in- present form is most directly applicable to circuits without put signal and in discrete-time processing these frequency time-varying parameters, such as guitar distortion circuits. Part multiples can alias at the Nyquist frequency. Consequently, I [1] presented a procedural approach to derive nonlinear filters most musical distortion algorithms apply the nonlinearity at from schematics of audio circuits for the purpose of digitally an upsampled rate, typically 4 to 8 times the audio sampling emulating musical effects circuits in real-time. The focus of rate, e.g., 8x48kHz. Furthermore, the baseband tones produce Part II is the simulation of two circuits common in audio psychoacoustic masking patterns in human hearing that can amplifiers: a BJT common emitter amplifier, and a vacuum hide the weaker alias tones even using lower oversampling tube triode preamp. factors as studied in [4]. This effort aims to preserve the heritage of musical cir- Physically-based methods numerically integrate the ordinary cuits whose components, such as vacuum tubes, or vintage differential equations of the circuit. The explicit integration transistors, are becoming increasingly rare. By exploiting the methods have poor convergence properties, which depend progress of contemporary digital computing power, modeling upon the input signal, for highly saturating circuits such as vintage circuits based on archives of their circuit schematics guitar amplifiers (see [5] for a summary of integration meth- and device characteristics can ensure that the unique sound ods). Because of this, recent attempts to emulate nonlinear of these circuits will be available for future generations of musical circuits have used implicit numerical integration [1], musicians. [4], [6]–[8]. Wave digital filter [4], [6] and time-varying filter This work extends an established efficient nonlinear methods [7] are also essentially implicit numerical integra- continuous-time state-space formulation for physical model- tion schemes. The nonlinear solver in implicit methods has difficultly converging when applied to circuits with strongly Copyright (c) 2010 IEEE. Personal use of this material is permitted. However, permission to use this material for any other purposes must be saturating nonlinearities [5]. A workaround is to solve the obtained from the IEEE by sending a request to [email protected]. nonlinear functions offline and use a function approximation The author is affiliated with the Center for Computer Research in Music and such as table lookup during runtime [9], [10]. Acoustics (CCRMA), Department of Music, Stanford University, Stanford, CA 94305-8180, USA. This work was partially supported by a National Science Foundation Graduate Fellowship. 1http://lv2plug.in 2 IEEE TRANSACTIONS ON SPEECH AND AUDIO PROCESSING, VOL. 18, NO. 3, MARCH 2011 One popular application of virtual analog is to simulate coefficient matrices and the nonlinear relationships between the nonlinearities and dynamics added by amplification with system variables. This produces a form of nonlinear filter a vacuum tube amplifier. This is commonly done using wave- similar to that of the K-method. Whereas the K-method shaping [2]. Accurately simulating the tube sound based on requires derivation of the system ODE before discretization, physical principles in real-time is a challenging task. Wave the DK-method first applies discretization, then solves the digital models of the vacuum tube amplifier require certain resulting system for the state update and nonlinear relations. approximations and modifications that affect the stability and This ordering of operations simplifies the automation of the dynamics of the system [4], [6], [11]. The wave digital system derivation. approach is not a straightforward method to simulate arbitrary circuits although it does offer advantages in numerical stability and computational efficiency when used properly [10], [12]. A. Solution of the discrete K-method Recent efforts [13]–[15] are converging toward direct solu- tion of the differential equations with optional precomputation Discretizing the circuit and performing MNA on the circuit and tabulation of the system nonlinearity to mitigate the yields a state update equation in the following form, as detailed convergence problem, which is discussed in Part I [1]. The in Part I [1]: technique of table lookups to represent nonlinearities has been used for decades in digital audio [16], [17]. x[n]= Ax[n − 1]+ Bu[n]+ Ci[n]. (1) One form of this approach, the K-method [18] – a nonlinear, state-space system solver – can be used to simulate tube amps The state is described by vector x; u is the vector of [10] without many of the approximations necessary in wave inputs to the circuit, including power supplies, and i is the digital and direct ODE approaches. The K-method itself is vector contribution of the nonlinear devices in the circuits, a special form of the general method to compute a system i.e., the diodes, vacuum tubes, etc. These nonlinear devices of connected nonlinear filters [19], [20] by rearranging the are typically modeled as voltage controlled current sources system and solving a system-level nonlinear equation using table lookup. Owing to their generality, these methods may have numerous formulations to model the same circuit, and i = f (v) , (2) are laborious to apply. The DK-method presented in Part I of this paper [1] makes where v is the vector of controlling voltages for the nonlinear several contributions to extend this research. It provides a devices. These controlling voltages are also solved from the set of unambiguous rules to map the circuit features to state circuit equations by MNA and written as a linear combination variables and the system matrices. The specific formulation of x, u, and i. proposed preserves the dimensionality of the underlying non- linearity, whereas the nonlinear filter composition method does v = Dx + Eu + Fi, (3) not dictate how to represent the solved system nonlinearity. Because it preserves the system inputs and components, rela- The terminal voltages, v[n], for the nonlinear devices can tive to solving the ODE directly, this method is demonstrated be solved implicitly to have the built-in ability to model details such as modulation caused by the power supply voltage. Finally the procedure is − suited to implementation as software so that the user does not 0 =p[n]+ Ff(v[n]) v[n], (4) need to derive circuit equations by hand. For mildly distort- ing circuits, the nonlinearity can be solved online even for p[n]= Dx[n − 1]+ Eu[n], (5) large circuits. For strongly clipping circuits, the nonlinearity must be computed offline. In the present implementation, this The parameter p is introduced to rewrite (4) and (2) as explicit nonlinearity is represented as a lookup table, which limits the mappings size of a circuit that can be solved automatically. Automated v[n]= Γ(p[n]), (6) analysis of a circuit to determine suitable partitioning would also be possible [21], perhaps with some user interaction, but is left for future work. i[n]= f(Γ(p[n])) (7) which is possible under conditions described in Part I. III. DISCRETE K-METHOD Outputs y from the circuit are also solved using MNA and The Discrete K-method (DK-method) is briefly reviewed can be written as a linear combination of x, u, and i: here before it is applied to the example circuits. The DK- method starts by scanning the netlist and building a matrix y = Lx + Mu + Ni. (8) system of equations using a set of templates given in [1] based on modified nodal analysis (MNA) [22].
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages10 Page
-
File Size-