Modeling Audio Circuits Containing Typical Nonlinear Components with Wave Digital Filters
Total Page:16
File Type:pdf, Size:1020Kb
Modeling Audio Circuits Containing Typical Nonlinear Components with Wave Digital Filters Ólafur Bogason Department of Music Research Schulich School of Music McGill University Montreal, Canada April 2018 A thesis submitted to McGill University in partial fulfillment of the requirements of the degree of Master of Arts c 2018 Ólafur Bogason i Abstract Musicians and audio producers like vintage audio gear and for good reasons. The most beloved songs and sounds of the past were made on gear that now has become vintage. Examples of such gear are guitar pedals and amplifiers used by Jimi Hendrix (e.g., the Ar- biter Fuzz Face) and the Mini-Moog synthesizer used by numerous artists since its debut in 1969. Unfortunately vintage gear is often expensive, hard to come by, impractical to transport and difficult to maintain. In order to replicate audio circuits that produce the sounds that vintage gear is famous for, multiple techniques from both industry and academia exist. Most techniques result in a model derived from the audio circuit. The field centered around modeling analog audio gear, in particular audio circuits, is called virtual analog. Simulating audio circuits tends to have further constraints than the generic simulation of electronic circuits. Constraints include the need for real-time user input and simulation. Wave digital filters, originally intended for the design of digital filters, have received grow- ing attention by the virtual analog research community because they deal elegantly with the aforementioned design restrictions. A brief overview of the state of the art in virtual analog research is provided along with context on wave digital filters as applied to virtual analog modeling. Behavior of wave digital filters under time-varying conditions is studied and three nonlinear compo- nents commonly found in audio circuits are introduced into the formalism. By modeling larger, nontrivial audio circuits the newly derived models are applied in a realistic context. Simulations are compared to tried-and-true generic circuit simulation software. ii Résumé Les musiciens et les producteurs audio aiment le matériel audio vintage pour de bonnes raisons. Les chansons et les sons les plus appréciés du passé ont été réalisés sur des appareils qui sont devenus des pièces de musée. Des exemples de ces dispositifs sont les pédales de guitare et les amplificateurs utilisés par Jimi Hendrix (par exemple, l’Arbiter Fuzz Face) et le synthétiseur Mini-Moog utilisé par de nombreux artistes depuis ses débuts en 1969. Malheureusement, les appareils d’époque sont souvent coûteux, difficiles à trouver, peu pratiques à transporter et difficiles à entretenir. Afin de simuler les circuits audio qui produisent les sons réputés des dispositifs ‘vintage’ de nombreuses techniques de l’industrie et du milieu universitaire existent. La plupart de ces techniques produisent un modèle dérivé du circuit audio. Le champ d’étude centré au- tour de la modélisation d’équipements audio analogiques, en particulier des circuits audio, est appelé “analogique virtuel”. La simulation de circuits audio tend à obeir à d’autres contraintes que la simulation générique de circuits électroniques. Les contraintes incluent la nécessité d’une entrée utilisa- teur en ligne et d’une simulation en temps réel. Le WDF (Wave Digital Filter), initialement destiné à la conception de filtres numériques, a reçu l’attention croissante de la communauté virtuelle de recherche analogique parce qu’il traite élégamment les restrictions conceptuelles susmentionnées. Un bref aperçu de l’état de l’art en recherche analogique virtuelle est fourni avec une mise en contexte des WDF appliqués à la modélisation analogique virtuelle. Le comportement des WDF dans des conditions variant dans le temps est étudié et trois composants non linéaires généralement présents dans les circuits audio sont introduits dans le formalisme. En modélisant des circuits audio non triviaux plus grands, les modèles nouvellement établis sont appliqués dans un contexte réaliste. Les simulations sont comparées à celles du logiciel de simulation de circuit générique SPICE. iii Acknowledgments First I wish to thank my supervisor Dr. Philippe Depalle for his support, great humor and encouragement throughout my studies at McGill. At the same time I gratefully acknowl- edge McGill University and the Schulich School of Music for their financial aid. A special acknowledgment goes out to Dr. Kurt James Werner. Both for having sup- plied me with tools needed to plot WDF schematics and provided many useful comments and suggestions during the development of this manuscript. We also shared a paper at DAFx17 on a topic that sprung from research of this thesis. I extend my sincere gratitude to the faculty and peers at the music technology depart- ment at McGill. I would also like to thank my roommates at the “Heart of the Plateau” and my friends and colleagues at Genki Instruments for uplifting yet maturing times during the arduous writing period. Last, but most importantly, I wish to thank my family, in particular my loving parents, Bogi Þór Siguroddsson and Linda Björk Ólafsdóttir, for all their support and encourage- ment. iv Contents 1 Introduction 1 1.1Context..................................... 1 1.2Contributions.................................. 3 1.2.1 Simulating Time-Varying Systems using Wave Digital Filters . 3 1.2.2 CommonNonlinearities......................... 4 1.2.3 CaseStudies............................... 4 1.3StructureoftheThesis............................. 5 2 State of the Art 6 2.1VirtualAnalog................................. 6 2.1.1 Goals of Virtual Analog Research . 6 2.1.2 Methods of Virtual Analog Research . 7 2.1.3 BlackBoxModeling.......................... 8 2.1.4 WhiteBoxModeling.......................... 12 2.2WaveDigitalFilters.............................. 14 2.2.1 History.................................. 14 2.2.2 FundamentalPrinciples......................... 15 2.2.3 ConnectionTrees............................ 19 2.2.4 Adaptors for Arbitrary Topologies . 20 2.2.5 Nonlinearities.............................. 22 2.2.6 Simulating Time-Varying Systems . 25 2.3Summary.................................... 26 3 Time-Varying Conditions and Wave Digital Filters 27 3.1ASimpleCaseStudy.............................. 27 Contents v 3.2 s-to-z Mappings and Proper Numerical Schemes . 31 3.3 Time-Variant Conditions and Highly-Damped Poles . 33 3.4Time-VaryingReactances........................... 36 3.5Summary.................................... 37 4 Common Nonlinear Components 39 4.1ZenerDiode................................... 39 4.2FieldEffectTransistor............................. 44 4.2.1 JFET.................................. 46 4.2.2 MOSFET................................ 47 4.3 Operational Transconductance Amplifier . 48 4.3.1 IdealVCCSModel........................... 49 4.3.2 LinearMacromodel........................... 51 4.3.3 NonlinearClipping........................... 52 4.4Summary.................................... 53 5 Nonlinear components in WDFs—Case Studies 54 5.1FETBoosterCircuit.............................. 54 5.1.1 ComparisontoSPICE......................... 57 5.2EnvelopeFilter................................. 60 5.2.1 InputBuffer............................... 62 5.2.2 OutputBuffer.............................. 63 5.2.3 EnvelopeFollower............................ 64 5.2.4 FilterSection.............................. 71 5.3KorgMS-20Filter............................... 73 5.3.1 ComparisontoSPICE......................... 77 5.4Summary.................................... 79 6 Conclusion 83 6.1Summary.................................... 83 6.2FutureWork................................... 84 A Lumped Element Models and Their Discretization 85 A.1 Approximating Field Equations . 85 Contents vi A.1.1 Dynamical Systems Analogies . 87 A.2 Numerical Discretization Schemes . 87 A.2.1Stability................................. 89 A.2.2Accuracy................................. 89 A.3 s-Plane to z-PlaneMappings.......................... 90 A.3.1Discussion................................ 91 B Common WDF Building Blocks 92 B.1CommonComponents............................. 92 B.1.1One-PortComponents......................... 92 B.1.2Two-PortComponents......................... 95 B.2CommonAdaptors............................... 96 B.2.1Two-PortAdaptors........................... 96 B.2.2Three-PortAdaptors.......................... 97 B.2.3 N -PortAdaptors............................ 99 B.2.4NormPreservation........................... 99 C SPICE 100 D Scattering Matrices in Case Study 102 Bibliography 103 vii List of Figures 2.1 Example of Block-Based Models ........................ 9 2.2 Generalized Hammerstein Model ........................ 10 2.3 Generic One-Port ................................ 16 2.4 Example Circuit ................................. 20 2.5 Generic Sallen-Key Filter ........................... 22 3.1 RC Circuit .................................... 28 3.2 Unit-Step Responses .............................. 28 3.3 Unit-Step Response vout ............................. 29 3.4 Zoomed-In Unit Step Response vout ...................... 30 3.5 Zoomed-In Unit Step Response iout ...................... 30 3.6 Unit-Step Response vout. Capacitor Discretized using Trapezoidal Rule ... 33 4.1 Zener Diode Symbol ............................... 40 4.2 Zener Diode—Voltage/Current Relationship ................. 43 4.3 JFET Symbols .................................. 47 4.4 MOSFET Symbols ............................... 48 4.5 OTA