Digital Modelling of Guitar Audio Effects a Thesis Submitted
Total Page:16
File Type:pdf, Size:1020Kb
DIGITAL MODELLING OF GUITAR AUDIO EFFECTS A THESIS SUBMITTED TO THE GRADUATE SCHOOL OF NATURAL AND APPLIED SCIENCES OF MIDDLE EAST TECHNICAL UNIVERSITY BY ENGIN ZEKI IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE IN ELECTRICAL AND ELECTRONICS ENGINEERING JANUARY 2015 Approval of the thesis: DIGITAL MODELLING OF GUITAR AUDIO EFFECTS submitted by ENGIN ZEKI in partial fulfillment of the requirements for the degree of Master of Science in Electrical and Electronics Engineering Department, Middle East Technical University by, Prof. Dr. M. Gülbin Dural Ünver Dean, Graduate School of Natural and Applied Sciences Prof. Dr. Gönül Turhan Sayan Head of Department, Electrical and Electronics Engineering Prof. Dr. Tolga Çiloglu˘ Supervisor, Electrical and Electronics Eng. Dept., METU Examining Committee Members: Prof. Dr. Kemal Leblebicioglu˘ Electrical and Electronics Eng. Department, METU Prof. Dr. Tolga Çiloglu˘ Electrical and Electronics Eng. Department, METU Prof. Dr. Ugur˘ Halıcı Electrical and Electronics Eng. Department, METU Prof. Dr. Umut Orguner Electrical and Electronics Eng. Department, METU Prof. Dr. Salim Kayhan Electrical and Electronics Eng. Dept., Hacettepe University Date: I hereby declare that all information in this document has been obtained and presented in accordance with academic rules and ethical conduct. I also declare that, as required by these rules and conduct, I have fully cited and referenced all material and results that are not original to this work. Name, Last Name: ENGIN ZEKI Signature : iv ABSTRACT DIGITAL MODELLING OF GUITAR AUDIO EFFECTS Zeki, Engin M.S., Department of Electrical and Electronics Engineering Supervisor : Prof. Dr. Tolga Çiloglu˘ January 2015, 126 pages Digital audio effects are used by many electric guitar players. These effects help players to find their desired tones and sounds. Digital audio workstations (DAW) and Virtual studio technologies (VST) advance the development of guitar audio effects softwares. The aim of this thesis is to implement main linear guitar effects (delay, reverb, wah-wah, flanger) real-time and enhance the main nonlinear guitar effects (distortion, overdrive) using system identification methods. After the verification of the effect models with MATLAB, real-time implementations of these effects will be done using C/C++/C# software languages. For the modelling of main nonlinear gui- tar effects, distortion and overdrive, this thesis investigates current methods of static modelling and dynamic nonlinear state space solutions. After discussion of previ- ous models, this thesis introduces a new method of distortion modelling with system identification called Enhanced Modelling of Guitar Distortion. Enhanced Modelling of Guitar Distortion algorithm will use neural network system identification method ANFIS (Adaptive-Network-Based Fuzzy Inference System). ANFIS is used as a sys- tem identification tool in Enhanced Modelling of Guitar Distortion algorithm. This algorithm takes the guitar output signal and pre-amplifies the input with 12AX7 vac- uum tube amplifier simulation model to obtain clean channel. ANFIS system identi- fication block is trained using desired distortion effect input output pair. This training and learning results into a ANFIS (Adaptive-Network-Based Fuzzy Inference Sys- tem) structure that can be used for processing future inputs. Using clean channel v output as an input to the ANFIS structure, lead channel output is obtained. Real-time implementations of distortion and overdrive will be done using C/C++/C# software languages. The results of the Enhanced Modelling of Guitar Distortion algorithm will show if it is applicable to model distortion and overdrive effects using system identification approach. Listening tests will be done to provide evidence that the simulation models are successful. Strict real-time constraints are going to be satisfied and the simulation of a guitar amplifier will be presented. Keywords: Guitar, Audio, Audio Signal Processing, Nonlinear Signal Processing, Delay, Comb Filter, Wah-Wah, Flanger, Distortion, Overdrive, ANFIS, System Iden- tification, Valve Tube Modeling, Guitar Effects vi ÖZ GITAR˙ EFEKTLERIN˙ IN˙ DIJ˙ ITAL˙ MODELLENMESI˙ Zeki, Engin Yüksek Lisans, Elektrik ve Elektronik Mühendisligi˘ Bölümü Tez Yöneticisi : Prof. Dr. Tolga Çiloglu˘ Ocak 2015 , 126 sayfa Çogu˘ elektrik gitarist dijital ses efektlerini kullanmaktadır. Bu efektler elektrik gita- ristlerin istedikleri tonları ve sesleri elde etmelerini saglamaktadır.˘ Dijital Ses Çalı¸sma Ortamları (DAW) ve Sanal Stüdyo Teknolojileri (VST) ses efektleri yazılımlarının geli¸stirilmesive yaygınla¸smasınısaglamı¸slardır.˘ Bu tezin amacı genel dogrusal˘ gi- tar efektlerinden olan delay, reverb, wah-wah ve flanger efektlerinin gerçek zamanlı olarak modellenmesi ve dogrusal˘ olmayan gitar efektlerinden distortion ve overdrive efektlerinin sistem tanımlama algoritmalarını kullanarak geli¸stirilmesidir. MATLAB kullanılarak efektlerin dogrulanmasının˘ ardından, gerçek zamanlı olarak C/C++/C# yazılım dilleri kullanılarak uygulaması yapılacaktır. Genel dogrusal˘ olmayan efekt- lerden olan distortion ve overdrive efektlerinin modellenmesi için ¸suanda uygulanan metodlardan statik modelleme ve dinamik denklem çözümleri incelenecektir. Sistem tanımlama metodları kullanan Enhanced Modelling of Guitar Distortion algoritması tasarlanacaktır. Bu algoritma sinir agları˘ yapısı kullanan sistem tanımlama ANFIS (Adaptive-Network-Based Fuzzy Inference System) modelini kullanacaktır. Distor- tion ve overdrive gitar efektlerinin de C/C++/C# yazılım dilleri kullanılarak uygula- ması yapılacaktır. ANFIS yapısı bir sistem tanımlama aracı olarak Enhanced Model- ling of Guitar Distortion modeli içerisinde yer almaktadır. Bu algoritma gitar sinyalini alarak ön amfi olan 12AX7 vakum tüp amfi simülasyon modelinden geçirerek temiz kanalı elde etmektedir. Istenen˙ distortion efekt giri¸sçıkı¸ssinyali ile ANFIS sistem tanımlama blogu˘ egitilir.˘ Bu egitilme˘ ve ögrenme˘ sonucunda bir ANFIS yapısı elde vii edilmektedir. Bu ANFIS yapısı ile gelecek giri¸ssinyalleri de i¸slenebilmektedir. Temiz kanal çıkı¸sınınANFIS yapısına giri¸solarak kullanılmasıyla kirli kanal çıkı¸sıda elde edilebilmektedir. Enhanced Modelling of Guitar Distortion algoritmasının sonuçları sistem tanımlama metodlarının distortion ve overdrive gitar efektlerinin modellenmesinde kullanılabi- lecegini˘ gösterecektir. Dinleme testleri sonucunda simülasyon modellerinin ba¸sarılı olduguna˘ kanaat getirilecektir. Gerçek zaman sınırlandırmaları öngörülerek, gitar ses güçlendiricisi simülasyonu sunulacaktır. Anahtar Kelimeler: Gitar, Ses, Ses Sinyal I¸sleme,Do˙ grusal˘ Olmayan Sinyal I¸sleme,˙ Erteleme, Filtreleme, Wah-Wah Efekti, Flanger, Distortion, Overdrive, ANFIS, Sis- tem Tanımlama, Triode Modelleme, Gitar Efektleri viii To my beloved parents Cevdet Zeki, Huriye Zeki ix ACKNOWLEDGMENTS I personally thank Prof. Dr. Tolga Çiloglu˘ for letting me choose my own topic on audio signal processing, and all his efforts to support me in the preparation of this thesis. Through the search of a thesis topic, Bülent Bıyıkoglu,˘ the creator of Synth- Master and founder of KV331, lead me to the path of choosing digital audio effects, offering me to read some papers about Distortion Modelling and Synthesis, I also per- sonally thank him for being a guide for me. Middle East Technical University, with all their precious lecturers and researches has been a home for me both for research and work experience purposes, I value these times of my life the most. x TABLE OF CONTENTS ABSTRACT . v ÖZ......................................... vii ACKNOWLEDGMENTS . x TABLE OF CONTENTS . xi LIST OF TABLES . xv LIST OF FIGURES . xvi LIST OF ABBREVIATIONS . xxi CHAPTERS 1 INTRODUCTION . 1 2 LINEAR GUITAR AUDIO EFFECTS . 7 2.1 Basic Building Block: Delay . 7 2.1.1 FIR Delay . 7 2.1.2 FIR Comb Filter . 8 2.2 Audio Flanger . 10 2.3 Reverberation . 13 2.3.1 Reverberation Environment Modelling . 14 xi 2.3.2 Digital All-Pass Filter . 15 2.3.3 Artificial Reverberation . 20 2.3.3.1 Colorless Artificial Reverberation . 21 2.3.3.2 Early Reflections . 23 2.3.3.3 Late Reverberation . 24 2.3.4 Reverberation Implementation . 25 2.4 Wah-Wah Effect . 26 3 BASICS OF GUITAR DISTORTION: DIODE LIMITER AND PRE- AMPLIFIER . 31 3.1 The Basic Building Block: Diode Limiter . 31 3.2 The Importance of Pre-Amplifier . 32 4 WAVE DIGITAL FILTER MODELLING APPROACH OF GUITAR DISTORTION . 37 4.1 Wave Digital Filter Modeling of Guitar Distortion . 37 4.1.1 Two-Port Networks . 37 4.1.2 Application of Wave Digital Filter Theory to Non- linear Audio Circuits . 38 5 SYSTEM IDENTIFICATION APPROACH TO DISTORTION MOD- ELLING . 41 5.1 System Identification Approach to Distortion Modelling . 41 6 ANFIS: ADAPTIVE-NETWORK-BASED FUZZY INFERENCE SYS- TEM . 49 6.1 ANFIS: Adaptive-Network-Based Fuzzy Inference System . 49 6.1.1 Hybrid Learning Algorithm . 54 xii 6.1.1.1 Batch (Off-Line) Learning - Hybrid Learning Technique . 57 6.1.2 Pattern (On-Line) Learning . 59 6.1.3 Implementations of ANFIS using MATLAB . 60 7 ENHANCED MODELLING OF GUITAR DISTORTION . 63 7.1 Enhanced Modelling of Guitar Distortion . 63 7.1.1 12AX7 Tube Pre-Amplifier . 64 7.1.2 Obtaining Training Data For ANFIS System Iden- tification . 67 7.1.3 Enhanced Modelling of Guitar Distortion Algorithm 74 8 RESULTS . 77 8.1 Results . 77 8.1.1 Delay Results . 78 8.1.2 Reverberation Results . 78 8.1.3 Wah-Wah Results . 79 8.1.4 ANFIS Modelling Results . 81 8.1.5 Enhanced Modelling of Guitar Distortion Algo- rithm Results . 97 9 CONCLUSION