Digital Emulation of Distortion Effects by Wave and Phase Shaping Methods
Total Page:16
File Type:pdf, Size:1020Kb
Proc. of the 13th Int. Conference on Digital Audio Effects (DAFx-10), Graz, Austria, September 6-10, 2010 DIGITAL EMULATION OF DISTORTION EFFECTS BY WAVE AND PHASE SHAPING METHODS Joseph Timoney†, Victor Lazzarini†, Anthony Gibney† and Jussi Pekonen †† †Sound and Music Technology Group ††Dept. Signal Processing and Acoustics National University of Ireland Aalto University School of Science and Technology Maynooth, Ireland Espoo, Finland [email protected], [email protected] [email protected] ABSTRACT music production environment. Emulation using the algorithmic approach can be divided into a nonlinear system model with This paper will consider wave and phase signal shaping tech- memory or without memory [9]. However, incorporating mem- niques for the digital emulation of distortion effect processing. ory for systems with strong nonlinearities is computationally ex- We examine in detail how to determine the wave and phase shap- pensive for real-time synthesis [10]. Thus, it is more common to ing functions with harmonic amplitude data only first, and then use a nonlinear system that is memoryless. after including the harmonic phase data. Three distortion effects The action of such a nonlinear system is understood as wave- units are used to provide test data. Wave and phase shaping func- shaping [11], a form of amplitude distortion. It has been shown tions for the emulation of these effects are derived with the assis- more recently that distortion can also be applied to the signal tance of a super-resolution frequency-domain analysis technique. phase to achieve a similar result [12], [13], [14], although no In complement to this, we describe an alternative time domain complete theory for this is available. In this work we establish a method for determining phase shaping functions using Dynamic connection between the wave and phase shaping methods of am- Time Warping. Finally, we propose a method for assessing the plitude and phase distortion [15] respectively. To illustrate the frequency dependency of distortion effects to help the design of analysis, examples of nonlinearly shaped sinusoids that have multiband wave and phase shaping functions. been processed using analogue distortion effects will be used. Additionally, in reference to the multiband extension of wave- 1. INTRODUCTION shaping [16], an idea for examining the variation in shaping with respect to input sinusoid frequency will be introduced. Since the mid 1960s, distortion effects have played an important This paper is organised as follows. We will first introduce part in the timbristic definition of electric guitar sounds in popu- and discuss the amplitude and phase signal shaping techniques. lar music. Such effects have also been applied to organ and syn- Then we will examine three distortion effects, discussing the thesizer sounds. For instance, when used with the Hammond or- general principles behind their operation. This will be followed gan, it creates thick, harmonic-rich tone. Another notable use is by the application of the previously discussed algorithms to emu- with the Roland TB303 bass synthesizer, producing what can be late these effects, with parameters derived from the analyses of described as a screaming sound when the filter is fully open and their output signals. A brief description will also be made of us- the resonance control is at a maximum. The origin of such effects ing DTW as pure time domain approach to implement phase can be traced back to musicians exceeding the linear dynamic shaping. To finish the paper, we will look at ways to examine range of tube amplifiers, introducing some sort of non-linear dis- and describe the frequency dependency of these effects for poten- tortion in the signal path. The characteristics of tube distortion tial applications in multiband processing. provided a desirable transformation to the sound of instruments by adding high-frequency harmonics [1], [2]. In time, various 2. SIGNAL SHAPING METHODS types of dedicated circuitry were designed to apply different forms of the effect to signals at any amplitude level. Distortion units essentially are a non-linear waveshaping cir- cuit to alter the shape of the input thereby modifying its spec- 2.1. Non-linear waveshaping trum, typically using some form of diode-based clipping [3], [4]. Digital emulation of these analogue processes has appeared in a One of the first studies of digital waveshaping in the litera- variety of forms. In some, the aim is to directly model a specific ture is found in Schaefer’s work on tone generation [11]. How- analogue circuit to reproduce its behavior [5], while in others the ever, J. C. Risset had already been using the method for sound aim is to create algorithms that capture the analogue processing synthesis of complex time-varying waveforms with a digital in a conceptual manner [6], [7], [8]. The advantages of the latter computer [17]. Schaefer’s motivation was the modeling of non- approach are flexibility, in terms of the potential for added fea- linear semiconductor elements used in electronic musical de- tures, and the ability to control the use of use of oversampling, vices. Thorough theoretical investigations followed in [18] and which is a necessity for circuit modeling [9]. Furthermore, by [19]. The basic idea is that given some sinewave at a frequency keeping an algorithm’s computational requirements low means many more instances of it can be used in parallel within a digital (1) DAFX-1 Proc. of the 13th Int. Conference on Digital Audio Effects (DAFx-10), Graz, Austria, September 6-10, 2010 there is a nonlinear function f(.) that will alter the amplitude of x(t) to produce an output = []0 1 2 …N (10) (2) To take account of the phase two waveshaping polynomials now need to be generated. Furthermore, the second polynomial Thus, the shape of the input wave has been changed by the func- requires Chebyshev polynomials of the second kind. Again, fol- tion. lowing the example of [19] matrix relationships can be expressed In [11] Chebyshev polynomials were introduced as a use- for phase quadrature waveshaping ful description for such nonlinearities. The output of eq. 2 can be written as a power series 0 dI ()2 a0 cos()0 0 yt d d cos t d cos2 t (3) 1 ()= 0 + 1 () + 2 () +… dI1 2 a1 cos()1 = 0.5() P (11) or more compactly dI N N a cos () 2 N ()N (4) and 1 Using a Fourier decomposition to determine the coefficients dQ ()2 a1 sin()1 0 of eq.4 is difficult because of the expansion of the trigonometric = 0.5 Q (12) product terms. The useful property of Chebyshev polynomials is dQ N that N1 () 2 aN sin()N Tk ()cos()t = cos()kt (5) where the first row of the generative matrix Q is where Tk denotes a Chebyshev polynomial of order k. Applying q()1, j = []1010101 … (13) these polynomials to describe eq. 4 results in and subsequent rows can be computed using the recursion a0 yt()= T + a T + a T +…+ a T (6) 2 0 1 1 2 2 N N (14) where a0, a1, a2 ... are the Fourier series coefficient of y(t). The original work of [11] was extended by [19] to the syn- The quadrature waveshaper output is then given by thesis of complex dynamic spectra. In particular, [19] provided a matrix based technique for computing the coefficients of the power series in eq.4 using the Fourier series coefficients of eq.6. (15) This simplified the procedure for calculating the waveshaping transfer function given a set of spectral harmonic magnitudes. Using an (N+1)(N+1) generative matrix P the relationship is 2.2. First relationship between wave and phase shaping 0 2 LeBrun [18] also provided a waveshaping implementation of d0 () a0 1 Frequency Modulation (FM) synthesis [20] (normally described d1 2 a1 = 0.5() P (7) in the form of Phase Modulation, PM). This was a significant result as it first established the link between waveshaping, an amplitude based shaping technique, with frequency modulation, a dN N aN () 2 phase-based shaping technique. In outline, a FM (PM) signal can be written as The first row of the generative matrix P is (16) p()1, j = []1020202 … (8) where is the carrier frequency, is the carrier frequency and c m I is the index of modulation. and subsequent rows can be computed using the recursion Ignoring the carrier for the moment, eq.16 can be written as pi, j = pi1, j 1 pi, j 2 (9) () ()() (17) It can be noted from eq.7 that the harmonic phase is missing Substituting eq.1 into eq.17 gives from the relationship. To include this means a phase quadrature form of waveshaping [18]. Each harmonic magnitude, except the DC component, has an associated phase. Defining these as (18) DAFX-2 Proc. of the 13th Int. Conference on Digital Audio Effects (DAFx-10), Graz, Austria, September 6-10, 2010 This is similar to eq.(2) with the waveshaping function Substituting for u(t), v(t), u˙ ()t and v˙ ()t the above will lead to an expression from which the Instantaneous frequency can be (19) directly calculated. Defining the combination The carrier can also be reintroduced to give N (20) C = (26) 2 with g(x) = sin(x). Thus demonstrating frequency modulation can be cast as a This will have the set of combinadics denote M(N,2) that con- form of waveshaping. The work in [21] elaborates this further, tains L = N!/(2!(N-2)!) vectors each denoted as M(N,2)(.). Also, expanding it to provide independent control over partial groups. the vectors of magnitudes and frequencies are However, for our purpose more analysis is needed to have an equivalent procedure for computing the phase shaping function (27a) given a set of harmonic amplitudes and phases.