#
Virtual Analog Models of the Lockhart and Serge Wavefolders^{ †}

^{1}

^{2}

^{3}

^{*}

^{†}

Next Article in Journal

Next Article in Special Issue

Next Article in Special Issue

Previous Article in Journal / Special Issue

Aalto Acoustics Lab, Aalto University, 02150 Espoo, Finland

Native Instruments GmbH, D-10997 Berlin, Germany

Acoustics and Audio Group, University of Edinburgh, Edinburgh EH9 3FD, Scotland, UK

Author to whom correspondence should be addressed.

This paper is an extended version of our paper published in the 14th Sound and Music Computing Conference (SMC-17), Espoo, Finland, 5–8 July 2017.

Academic Editor: Stefania Serafin

Received: 12 October 2017
/
Revised: 10 November 2017
/
Accepted: 13 December 2017
/
Published: 20 December 2017

(This article belongs to the Special Issue Sound and Music Computing)

Wavefolders are a particular class of nonlinear waveshaping circuits, and a staple of the “West Coast” tradition of analog sound synthesis. In this paper, we present analyses of two popular wavefolding circuits—the Lockhart and Serge wavefolders—and show that they achieve a very similar audio effect. We digitally model the input–output relationship of both circuits using the Lambert-W function, and examine their time- and frequency-domain behavior. To ameliorate the issue of aliasing distortion introduced by the nonlinear nature of wavefolding, we propose the use of the first-order antiderivative method. This method allows us to implement the proposed digital models in real-time without having to resort to high oversampling factors. The practical synthesis usage of both circuits is discussed by considering the case of multiple wavefolder stages arranged in series.

Nonlinear waveshaping is a technique used in sound synthesis to generate complex harmonic spectra. It consists of processing a signal with low harmonic content (typically a sinusoid) using a nonlinear mapping function designed to introduce harmonic overtones to the output signal [1]. The first documented use of waveshaping in the digital domain can be traced back to 1969, when Jean-Claude Risset emulated the sound of a clarinet by distorting a sinusoid with a clipping function [2]. Waveshaping techniques were extensively researched within the context of computer music in the 1970s, with several authors exploring the use of Chebyshev polynomials in particular, as an accurate and computationally cheap alternative to additive synthesis [1,3,4,5]. The underlying principles behind waveshaping synthesis are closely related to other well-known synthesis techniques, such as frequency modulation (FM) and phase distortion (PD) synthesis [6,7]. These two techniques rely on distorting the frequency and phase, respectively, of sinusoidal oscillators. Recent research on the topic of distortion-based synthesis has explored the use of logic operators in lieu of traditional polynomial waveshapers [8], and proposed extensions to both FM and PD synthesis [9,10].

The use of waveshaping in the analog domain began in the 1950s, when guitar players started deliberately overdriving their tube amplifiers to alter the timbre of their instrument [11]. In 1961, Gibson released the “Maestro FZ-1 Fuzz Tone”, the first commercially available fuzz distortion pedal, which exploited the saturating behavior of transistors to introduce harmonic distortion [12]. Most guitar distortion pedals, including popular designs such as the Ibanez Tube Screamer and Electro-Harmonix Big Muff Pi, operate under this same basic principle [13,14].

In analog synthesizers, the use of distortion-based methods is one of the cornerstones of “West Coast” synthesis, a paradigm pioneered by California-native Don Buchla during the 1960s. Buchla’s instruments focused on timbre manipulation at oscillator level by employing a variety of techniques such as nonlinear waveshaping, oscillator synchronization and pitch modulation [15,16,17]. This approach to sound synthesis contrasts that of traditional subtractive synthesis, where timbre is typically controlled by filtering harmonically-rich oscillator waveforms, like sawtooth and square waves, using resonant filters [18]. In recent years, West Coast synthesis has become increasingly popular, with contemporary manufacturers such as Make Noise and Verbos Electronics releasing their own takes on classic Buchla circuits.

This study presents virtual analog (VA) models for two analog synthesizer circuits: the Lockhart wavefolder and the wavefolder used in the middle section of the Serge Wave Multipliers. Wavefolding is a type of nonlinear waveshaping common in West Coast synthesis where portions of the input signal that exceed certain threshold are inverted or “folded back”, hence the name of the effect. The two circuits considered in this study were chosen because of the strong similarities between their general behavior. In a similar way to guitar distortion pedals, both wavefolders exploit the saturating behavior of semiconductor p–n junctions (i.e., transistors/diodes) to implement a folding function.

Wavefolders are amongst the most emblematic building blocks of West Coast synthesis. In spite of that, they have been mostly overlooked by both VA and digital waveshaping research. We have recently begun to fill this research gap in [17], which presents a VA model of the wavefolder circuit in the seminal Buchla 259 module. Previous work on circuit-based VA modeling has researched the filters found in vintage synthesizers such as those produced by Moog [19,20,21,22], Electronic Music Studios (EMS) [23,24], Korg [25,26] and Buchla [16]. Extensive work has also been done on modeling guitar distortion pedals [13,27], tube amplifiers [11,28,29], modulation effects [30,31,32,33] and the Roland TR-808 drum machine [34,35]. Measurement-based VA modeling, commonly known as “black-box modeling”, has also been thoroughly studied within the context of guitar amplifiers and pedals [36,37,38]. This approach is particularly useful when the original circuit schematics are not available.

A major challenge in VA modeling of nonlinear circuits, and digital waveshaping in general, is aliasing suppression. Early research on waveshaping synthesis addressed this issue by using low-order polynomial transfer functions, which not only allowed full parametric control of the produced spectrum but also ensured that the output waveform was bandlimited [4]. In VA modeling, high oversampling factors are usually necessary to prevent harmonics introduced by nonlinearities from reflecting into the baseband as aliases [13]. Oversampling increases the computational requirements of the model, by introducing additional filtering stages and scaling the number operations required to compute each output sample. For VA models that require evaluating transcendental functions, as is the case with the proposed Lockhart and Serge models, these added costs could compromise the integration of the system within a larger, real-time computer music system.

A sizable portion of VA research has concentrated on designing efficient algorithms to generate alias-free geometric waveforms like those used in analog subtractive synthesizers, the so-called classic analog waveforms. Well-known techniques include the bandlimited impulse train (BLIT) family of methods, which involves the use of bandlimited basis functions and their integrated forms [39,40,41], and the use of differentiated polynomial waveforms (DPW) [42,43,44]. Moreover, Välimäki and Franck have applied the antialiasing principle behind the DPW algorithm to tackle aliasing in wavetable oscillators [45]. Recent work on antialiasing techniques has extended the use of the bandlimited ramp (BLAMP) method, originally proposed to antialias triangular oscillators in [25,41], to special cases of linear piecewise nonlinearities such as signal rectification, and inverse/hard clipping [17,46,47].

In this work, we propose the use of the antiderivative antialiasing method introduced in [48,49]. This approach can be used to reduce the aliasing caused by arbitrary nonlinear waveshaping functions and is applicable to the proposed wavefolder models. In its first-order form, the method can be derived by analytically convolving a linear continuous-time representation of the input signal with a rectangular lowpass kernel [48]. As shown in this work, the use of the antiderivative method reduces the oversampling requirements of the proposed wavefolder models.

A VA model of the Lockhart wavefolder was originally presented in [50]. This paper extends that work by introducing a second wavefolding circuit and studying the similarities between both systems. Additionally, we present a different treatment of the required Lambert-W function and an extended evaluation of the proposed antialiasing method in terms of computational costs.

This paper is organized as follows. Section 2 and Section 3 describe the model derivation of the Lockhart and Serge wavefolders, respectively. Time-domain simulations of the circuits are also presented in these two sections. Section 4 deals with two implications of VA wavefolding in the digital domain, namely aliasing suppression and evaluation of the Lambert-W function. Section 5 presents frequency-domain results of the Lockhart and Serge wavefolders, as well as an evaluation of the proposed antialiasing method in terms of perceived sound quality and computational costs. Section 6 discusses the practical synthesis usage of both circuits and compares the behavior of the middle Serge Wave Multiplier with a recommended four-stage topology built around the Lockhart wavefolder. Concluding remarks and perspectives appear in Section 7.

Figure 1a shows a simplified circuit diagram of the Lockhart wavefolder. This circuit was designed in 1973 by R. Lockhart Jr., who intended it to be used as a general-purpose frequency tripler [51]. Following its publication in Bernie Hutchin’s Electronotes [52], Lockhart’s design was repurposed as a wavefolder by Ken Stone, who realized its potential as a simple yet interesting waveshaper [53,54]. The Lockhart wavefolder has become ubiquitous in the music synthesizer do-it-yourself (DIY) community. For example, it is the core processor in Yves Usson’s “Metalizer” module [55].

The main modifications made by Stone to Lockhart’s original design were the addition of an input potentiometer to attenuate the amplitude of the input waveform, and an inverting amplifier at the output of the circuit [54]. For the sake of simplifying the analysis, these are not shown in Figure 1a. The inverting stage at the output is reintroduced in Section 2.3. In our treatment of the circuit, we introduce the load resistance ${R}_{\mathrm{L}}$ as an additional parameter which can be used to further control the timbre of the folded waveform.

The Lockhart wavefolder consists of an NPN and a PNP bipolar junction transistors connected at their base and collector terminals. In order to model the large-signal behavior of the circuit, we replace transistors ${Q}_{1}$ and ${Q}_{2}$ with their corresponding Ebers-Moll large-signal models [23,24]. Figure 1b shows the large-signal equivalent circuit of the Lockhart wavefolder. We use a double subscript notation to distinguish the voltages and currents in transistor ${Q}_{1}$ from those in ${Q}_{2}$. For example, ${I}_{\mathrm{E}\mathrm{D},2}$ denotes the current through the base-emitter diode in ${Q}_{2}$. Component values for the circuit have been compiled in Table 1.

We begin the analysis of the circuit by assuming that the supply voltages are equal but opposite in sign (i.e., ${V}_{\mathrm{C}\mathrm{C}}=-{V}_{\mathrm{EE}}$), and that $\left|{V}_{\mathrm{in}}\right|\ll {V}_{\mathrm{CC}}$. This assumption means that the base-emitter junctions of both ${Q}_{1}$ and ${Q}_{2}$ will always be forward-biased and their voltage drops will remain approximately constant for all expected values of ${V}_{\mathrm{in}}$. In Ken Stone’s version of the circuit, ${V}_{\mathrm{in}}$ is assumed to be bounded between approximately $\pm 1.2$ V [53]. Applying KVL around both input–emitter loops gives us
where ${I}_{\mathrm{E},1}$ and ${I}_{\mathrm{E},2}$ are the emitter currents, and ${V}_{\mathrm{BE},1}$ and ${V}_{\mathrm{BE},2}$ are the voltages across the base–emitter junctions of ${Q}_{1}$ and ${Q}_{2}$, respectively. Solving Equations (1) and (2) for ${I}_{\mathrm{E},1}$ and ${I}_{\mathrm{E},2}$ gives us:

$$\begin{array}{ccc}\hfill {V}_{\mathrm{i}\mathrm{n}}& =& {V}_{\mathrm{CC}}-R{I}_{\mathrm{E},1}-{V}_{\mathrm{BE},1}\hfill \end{array}$$

$$\begin{array}{ccc}\hfill {V}_{\mathrm{in}}& =& {V}_{\mathrm{BE},2}+R{I}_{\mathrm{E},2}+{V}_{\mathrm{EE}},\hfill \end{array}$$

$$\begin{array}{ccc}\hfill {I}_{\mathrm{E},1}& =& \frac{{V}_{\mathrm{CC}}-{V}_{\mathrm{BE},1}-{V}_{\mathrm{in}}}{R}\hfill \end{array}$$

$$\begin{array}{ccc}\hfill {I}_{\mathrm{E},2}& =& \frac{{V}_{\mathrm{in}}-{V}_{\mathrm{BE},2}-{V}_{\mathrm{EE}}}{R}.\hfill \end{array}$$

Next, we apply KCL at the collector node, which gives us
where

$${I}_{\mathrm{out}}={I}_{\mathrm{C},1}-{I}_{\mathrm{C},2},$$

$$\begin{array}{ccc}\hfill {I}_{\mathrm{C},1}& =& {\alpha}_{\mathrm{F}}{I}_{\mathrm{ED},1}-{I}_{\mathrm{CD},1}\hfill \end{array}$$

$$\begin{array}{ccc}\hfill {I}_{\mathrm{C},2}& =& {\alpha}_{\mathrm{F}}{I}_{\mathrm{ED},2}-{I}_{\mathrm{CD},2}.\hfill \end{array}$$

If we then assume that the contributions of the reverse currents ${\alpha}_{\mathrm{R}}{I}_{\mathrm{C}{\mathrm{D}}_{1}}$ and ${\alpha}_{\mathrm{R}}{I}_{\mathrm{C}{\mathrm{D}}_{2}}$ to the total currents associated with the emitter nodes are negligible (i.e., ${\alpha}_{\mathrm{R}}\approx 0$), we can establish that

$$\begin{array}{ccc}\hfill {I}_{\mathrm{ED},1}& \approx & {I}_{\mathrm{E},1}\hfill \end{array}$$

$$\begin{array}{ccc}\hfill {I}_{\mathrm{ED},2}& \approx & {I}_{\mathrm{E},2}.\hfill \end{array}$$

Assuming ${\alpha}_{\mathrm{F}}=1$, as suggested in [23], and inserting Equations (8) and (9) into Equations (6) and (7), respectively, yields a new expression for the total output current of the circuit:

$${I}_{\mathrm{out}}={I}_{\mathrm{E},1}-{I}_{\mathrm{E},2}-{I}_{\mathrm{CD},1}+{I}_{\mathrm{CD},2}.$$

We then combine Equations (3) and (4) to derive an expression for the difference between emitter currents:

$${I}_{\mathrm{E},1}-{I}_{\mathrm{E},2}=\frac{{V}_{\mathrm{CC}}+{V}_{\mathrm{EE}}-2{V}_{\mathrm{in}}+{V}_{\mathrm{BE},2}-{V}_{\mathrm{BE},1}}{R}.$$

Since ${V}_{\mathrm{CC}}+{V}_{\mathrm{EE}}=0$, and voltage drops ${V}_{\mathrm{BE},1}$ and ${V}_{\mathrm{BE},2}$ are assumed to be constant and equal, their contribution to this expression disappears. Therefore, we can simplify this result as:

$${I}_{\mathrm{E},1}-{I}_{\mathrm{E},2}=-\frac{2}{R}{V}_{\mathrm{in}}.$$

Substituting Equation (12) into Equation (10) produces an expression for the total output current ${I}_{\mathrm{out}}$ in terms of the input voltage and the currents through the collector diodes:

$${I}_{\mathrm{out}}=-\frac{2}{R}{V}_{\mathrm{in}}-{I}_{\mathrm{CD},1}+{I}_{\mathrm{CD},2}.$$

The current–voltage (I–V) relationship of diodes can be modeled using Shockley’s ideal diode equation, defined as
where ${I}_{\mathrm{D}}$ is the current through the diode, ${I}_{\mathrm{s}}$ is the reverse bias saturation current, ${V}_{\mathrm{D}}$ is the voltage across the diode, ${V}_{\mathrm{T}}$ is thermal voltage and $\eta $ is the ideality factor of the diode [56]. For the p–n junctions inside transistors we can assume a reverse saturation current value ${I}_{\mathrm{s}}={10}^{-17}$ A and an ideality factor $\eta =1$. A thermal voltage value ${V}_{\mathrm{T}}=25.864$ mV is used throughout this study.

$${I}_{\mathrm{D}}={I}_{\mathrm{s}}\left(\mathrm{exp}\left(\frac{{V}_{\mathrm{D}}}{\eta {V}_{\mathrm{T}}}\right)-1\right),$$

Applying Shockley’s diode equation to the collector diodes and substituting into Equation (13) gives us:

$${I}_{\mathrm{out}}=-\frac{2{V}_{\mathrm{in}}}{R}-\underset{{I}_{\mathrm{CD},1}}{\underbrace{{I}_{\mathrm{s}}\left(\mathrm{exp}\left(\frac{{V}_{\mathrm{CD},1}}{\eta {V}_{\mathrm{T}}}\right)-1\right)}}+\underset{{I}_{\mathrm{CD},2}}{\underbrace{{I}_{\mathrm{s}}\left(\mathrm{exp}\left(\frac{{V}_{\mathrm{CD},2}}{\eta {V}_{\mathrm{T}}}\right)-1\right)}}.$$

Next, we use KVL to derive expressions for ${V}_{\mathrm{CD},1}$ and ${V}_{\mathrm{CD},2}$ in terms of ${V}_{\mathrm{in}}$ and ${V}_{\mathrm{out}}$:

$$\begin{array}{ccc}\hfill {V}_{\mathrm{CD},1}& =& {V}_{\mathrm{out}}-{V}_{\mathrm{in}}\hfill \end{array}$$

$$\begin{array}{ccc}\hfill {V}_{\mathrm{CD},2}& =& {V}_{\mathrm{in}}-{V}_{\mathrm{out}}.\hfill \end{array}$$

Now, the collector diodes in the large-signal model are antiparallel. Therefore, we can make the further assumption that only one of them will conduct at a time depending on the polarity of ${V}_{\mathrm{in}}$. A similar treatment is presented in [57] for the case of diode pairs in guitar distortion circuits. This means that

$${I}_{\mathrm{CD},1}\approx 0\phantom{\rule{1.em}{0ex}}\mathrm{for}\phantom{\rule{1.em}{0ex}}{V}_{\mathrm{in}}\ge 0\phantom{\rule{2.em}{0ex}}\mathrm{and}\phantom{\rule{2.em}{0ex}}{I}_{\mathrm{CD},2}\approx 0\phantom{\rule{1.em}{0ex}}\mathrm{for}\phantom{\rule{1.em}{0ex}}{V}_{\mathrm{in}}<0.$$

By combining these new assumptions with Equations (15)–(17) we arrive at the piecewise expression
where $\lambda =\mathrm{sgn}\left({V}_{\mathrm{in}}\right)$ and $\mathrm{sgn}$ () is the signum function

$${I}_{\mathrm{out}}=-\frac{2}{R}{V}_{\mathrm{in}}+\lambda {I}_{\mathrm{s}}\left(\mathrm{exp}\left(\frac{\lambda \left({V}_{\mathrm{in}}-{V}_{\mathrm{out}}\right)}{\eta {V}_{\mathrm{T}}}\right)-1\right),$$

$$\mathrm{sgn}\left(x\right):=\left\{\begin{array}{ccc}-1& \mathrm{if}& x<0\\ 0& \mathrm{if}& x=0\\ 1& \mathrm{if}& x>0.\end{array}\right.$$

Equation (18) can be further simplified if we consider that the independent constant factor $\lambda {I}_{\mathrm{s}}$ that results from its expansion will be very small ($\pm {10}^{-17}$ A) and can therefore be neglected. This gives us:

$${I}_{\mathrm{out}}=-\frac{2}{R}{V}_{\mathrm{in}}+\lambda {I}_{\mathrm{s}}\mathrm{exp}\left(\frac{\lambda \left({V}_{\mathrm{in}}-{V}_{\mathrm{out}}\right)}{\eta {V}_{\mathrm{T}}}\right).$$

Finally, we multiply both sides of this expression by ${R}_{\mathrm{L}}$ to derive an input–output voltage relationship for the Lockhart wavefolder:

$${V}_{\mathrm{out}}=-\frac{2{R}_{\mathrm{L}}}{R}{V}_{\mathrm{in}}+\lambda {R}_{\mathrm{L}}{I}_{\mathrm{s}}\mathrm{exp}\left(\frac{\lambda \left({V}_{\mathrm{in}}-{V}_{\mathrm{out}}\right)}{\eta {V}_{\mathrm{T}}}\right).$$

Equation (21) describes an implicit relationship between the input and output voltages of the circuit; it cannot be solved algebraically. Instead, a closed-form solution for ${V}_{\mathrm{out}}$ can be derived with the help of the Lambert-W function. The use of the Lambert-W function $W\left(\right)$ has been previously researched within the context of VA modeling. Several authors have used it to solve the implicit I–V relationship of diodes [56,58,59]. Parker and D’Angelo used $W\left(\right)$ to model the Buchla Lowpass-Gate, a synthesizer circuit that employs a resistive opto-isolator (also known as a vactrol) in its control path [16]. Strictly speaking, $W\left(\right)$ is multivalued; however, in this work, we only utilize the upper branch of the function. This branch is known as ${W}_{0}\left(\right)$ in the literature [56,60].

The Lambert-W function is used to solve equations of the form
which have the explicit solution
where $A,B,C$ and $D\in \mathbb{R}$ [58].

$$(A+Bx)\mathrm{exp}\left(Cx\right)=D,$$

$$x=\frac{1}{C}W\left(\frac{CD}{B}\mathrm{exp}\left(\frac{AC}{B}\right)\right)-\frac{A}{B},$$

Equation (21) can be arranged in the form described by Equation (22) by first rewriting it as
and dividing both sides by $\mathrm{exp}\left(-\lambda {V}_{\mathrm{out}}/\eta {V}_{\mathrm{T}}\right)$, which gives us

$${V}_{\mathrm{out}}+\frac{2{R}_{\mathrm{L}}}{R}{V}_{\mathrm{in}}=\lambda {R}_{\mathrm{L}}{I}_{\mathrm{s}}\mathrm{exp}\left(\frac{\lambda {V}_{\mathrm{in}}}{\eta {V}_{\mathrm{T}}}\right)\mathrm{exp}\left(\frac{-\lambda {V}_{\mathrm{out}}}{\eta {V}_{\mathrm{T}}}\right),$$

$$\left({V}_{\mathrm{out}}+\frac{2{R}_{\mathrm{L}}}{R}{V}_{\mathrm{in}}\right)\mathrm{exp}\left(\frac{\lambda {V}_{\mathrm{out}}}{\eta {V}_{\mathrm{T}}}\right)=\lambda {R}_{\mathrm{L}}{I}_{\mathrm{s}}\mathrm{exp}\left(\frac{\lambda {V}_{\mathrm{in}}}{\eta {V}_{\mathrm{T}}}\right).$$

Solving for ${V}_{\mathrm{out}}$ as defined in Equation (23) yields an explicit model for the Lockhart wavefolder
where

$${V}_{\mathrm{out}}=\lambda \eta {V}_{\mathrm{T}}W\left(\Delta \mathrm{exp}\left(\lambda \beta {V}_{\mathrm{in}}\right)\right)-\alpha {V}_{\mathrm{in}},$$

$$\alpha =\frac{2{R}_{\mathrm{L}}}{R},\phantom{\rule{1.em}{0ex}}\beta =\frac{2{R}_{\mathrm{L}}+R}{\eta {V}_{\mathrm{T}}R}\phantom{\rule{1.em}{0ex}}\mathrm{and}\phantom{\rule{1.em}{0ex}}\Delta =\frac{{R}_{\mathrm{L}}{I}_{\mathrm{s}}}{\eta {V}_{\mathrm{T}}}.$$

Table 2 summarizes all parameter values for the proposed Lockhart wavefolder model.

The voltages inside the Lockhart wavefolder are time-dependent. Therefore, we can describe the continuous-time model defined by Equation (26) as being of the form
where $f\left(\right)$ is the transfer function of the system and t is time. In the synthesis literature, the term “transfer function” is commonly used to denote the waveshaping function [4]. It should not be confused with the s- and z-domain transfer functions used in linear system analysis.

$${V}_{\mathrm{out}}\left(t\right)=f\left({V}_{\mathrm{in}}\left(t\right)\right),$$

As previously mentioned, Ken Stone’s circuit features an inverting stage before the output which can be modeled by inverting the polarity of the right-hand side of Equation (26):

$${V}_{\mathrm{out}}=\alpha {V}_{\mathrm{in}}-\lambda \eta {V}_{\mathrm{T}}W\left(\Delta \mathrm{exp}\left(\lambda \beta {V}_{\mathrm{in}}\right)\right).$$

While including this step is not strictly necessary, we have chosen to do so, as it will facilitate the evaluation of the model. Now, given the form described by Equation (27), the Lockhart model can be discretized trivially by replacing all continuous-time signals with their discrete-time equivalents, i.e.,
where n is the sample index.

$${V}_{\mathrm{out}}\left[n\right]=f\left({V}_{\mathrm{in}}\left[n\right]\right),$$

The time-domain behavior of the proposed circuit model was validated by comparing it against a reference simulation obtained using the SPICE (Simulation Program with Integrated Circuit Emphasis) software LTspice (Version IV, Linear Technology, Milpitas, CA, USA, 2016) [61]. The results of this simulation are shown in Figure 2a for values of ${V}_{\mathrm{in}}$ between $-1.5$ and $1.5$ V. Figure 2b shows the transfer function of the proposed model implemented in MATLAB (Version R2017a, MathWorks, Natick, MA, USA, 2017) using Equation (28) and MATLAB’s native “lambertw” function. In both cases, four different values of ${R}_{\mathrm{L}}$ were simulated: 1, 5, 10 and 50 k$\mathsf{\Omega}$. From these figures, we can observe the general behavior of the Lockhart wavefolder. At low input values, the system behaves linearly, whereas for high input values the circuit inverts the slope of the driving signal. The transition between non-folded and folded portions of the signal is gradual, which responds to the characteristic soft saturating behavior of p–n junctions. The region where the transfer function folds the input signal is indicated with a blue arrow in Figure 2b for the case when ${R}_{\mathrm{L}}=50$ k$\mathsf{\Omega}$. As shown in these Figures, increasing the value of ${R}_{\mathrm{L}}$ sharpens the shape of the transfer function.

The curves shown in Figure 2a,b indicate a good match between the SPICE simulations and the proposed digital model. Figure 3 shows the absolute value (in mV) of the difference between both simulations. From this plot, we can observe that the difference between the curves is indeed very small, below 1 mV for all values of ${V}_{\mathrm{in}}$ measured. These small differences are perceptually insignificant and can be attributed to the simplifications made during the analysis of the circuit and to the way in which SPICE computes currents flowing through semiconductor devices. For example, SPICE introduces a small fictitious conductance in parallel with each p–n junction in order to aid the convergence of its iterative solvers. Additionally, the SPICE diode model will account for the small reverse current that flows when the voltage across the diode is negative [61].

Figure 4 shows a time-domain view of the output of the proposed model when driven by a 500-Hz sinusoidal waveform with a peak amplitude of 1 V for two different load resistance values, ${R}_{\mathrm{L}}=10$ and 50 k$\mathsf{\Omega}$. A sampling rate ${F}_{\mathrm{s}}=44.1$ kHz was used to generate these figures, which are plotted against their corresponding SPICE simulations. From these results, we can once again observe the effect of wavefolding and the impact of ${R}_{\mathrm{L}}$ on the overall shape of the output. For high values of ${R}_{\mathrm{L}}$ the transition region between folded and non-folded values becomes very small and the resulting waveform is almost discontinuous (see Figure 4b). In the frequency domain, this will translate to higher harmonic content, similar to that of a square wave oscillator. A more detailed frequency-domain analysis of the Lockhart circuit is presented in Section 5 of this study.

The second circuit considered in this study is the middle section of the Serge Wave Multipliers (often abbreviated as the Serge VCM). The Serge VCM is a synthesizer module designed in 1977 by West Coast designer Serge Tcherepnin, founder of Serge Modular Music Systems. It offered three separate and independent analog sound processors, namely the “top”, “middle” and “bottom” sections. As described in an original 1980 Serge product catalog, “The middle section generates a sweep of the odd harmonics (1, 3, 5, 7, 9, 11 and 13th) when a triangle wave is applied to its input... This module can be used to explore timbral areas beyond the range of ring modulation because there are more varied harmonics than the sum and difference tones” [62].

The middle Serge VCM is essentially a waveshaping circuit consisting of six identical wavefolding stages arranged in series. An amplifier at the input of the circuit is used to modulate the gain of the input waveform and control the amount of folds introduced [63]. In this section we focus on the analysis of a single folding stage. The transfer function and frequency-domain behavior of the complete system are presented in Section 6. Figure 5 shows the schematic of a single wavefolding stage in the circuit. Component information is given in Table 3.

To derive the transfer function for the Serge wavefolding circuit, we first assume ideal op-amp behavior and derive an expression for ${V}_{\mathrm{out}}$ in terms of ${V}_{\mathrm{in}}$ and ${V}_{\mathrm{x}}$, the voltage at the non-inverting input of the amplifier. This gives us:

$${V}_{\mathrm{out}}={V}_{\mathrm{x}}-\frac{{R}_{3}}{{R}_{2}}\left({V}_{\mathrm{in}}-{V}_{\mathrm{x}}\right).$$

Since in this case ${R}_{3}={R}_{2}$, we can further simplify this result as:

$${V}_{\mathrm{out}}=2{V}_{\mathrm{x}}-{V}_{\mathrm{in}}.$$

Next, we derive an expression for ${V}_{\mathrm{x}}$ by considering the subcircuit shown in Figure 6, which is essentially a diode pair similar to those found in guitar distortion circuits [13,57,58].

Applying KVL around the outer loop of the circuit yields the relation
where I is the current through resistor ${R}_{1}$. Then, we apply KCL at the output node of the circuit, which gives us

$${V}_{\mathrm{in}}={R}_{1}I+{V}_{\mathrm{x}},$$

$$I={I}_{\mathrm{F}}-{I}_{\mathrm{R}}.$$

Combining Equation (32) with Equation (33) and applying Shockley’s diode equation gives us

$$\frac{{V}_{\mathrm{in}}-{V}_{\mathrm{x}}}{{R}_{1}}=\underset{{I}_{\mathrm{F}}}{\underbrace{{I}_{\mathrm{s}}\left(\mathrm{exp}\left(\frac{{V}_{\mathrm{x}}}{\eta {V}_{\mathrm{T}}}\right)-1\right)}}-\underset{{I}_{\mathrm{R}}}{\underbrace{{I}_{\mathrm{s}}\left(\mathrm{exp}\left(\frac{-{V}_{\mathrm{x}}}{\eta {V}_{\mathrm{T}}}\right)-1\right)}}.$$

As before, we assume the diodes will not conduct simultaneously and arrive at the piecewise relationship
where once again $\lambda =\mathrm{sgn}\left({V}_{\mathrm{in}}\right)$. To further simplify this expression we neglect the constant factor $\lambda {R}_{1}{I}_{\mathrm{s}}$ that results from its expansion. This gives us:

$${V}_{\mathrm{in}}-{V}_{\mathrm{x}}=\lambda {R}_{1}{I}_{\mathrm{s}}\left(\mathrm{exp}\left(\frac{\lambda {V}_{\mathrm{x}}}{\eta {V}_{\mathrm{T}}}\right)-1\right),$$

$${V}_{\mathrm{in}}-{V}_{\mathrm{x}}=\lambda {R}_{1}{I}_{\mathrm{s}}\mathrm{exp}\left(\frac{\lambda {V}_{\mathrm{x}}}{\eta {V}_{\mathrm{T}}}\right).$$

Next, we rearrange this equation in the Lambert-W form described by Equation (22) by dividing both sides by $\mathrm{exp}\left(\lambda {V}_{\mathrm{x}}/\eta {V}_{\mathrm{T}}\right)$. This yields
which can be solved for ${V}_{\mathrm{x}}$ as:

$$\left({V}_{\mathrm{in}}-{V}_{\mathrm{x}}\right)\mathrm{exp}\left(-\frac{\lambda {V}_{\mathrm{x}}}{\eta {V}_{\mathrm{T}}}\right)=\lambda {R}_{1}{I}_{\mathrm{s}},$$

$${V}_{\mathrm{x}}={V}_{\mathrm{in}}-\lambda \eta {V}_{\mathrm{T}}W\left(\frac{{R}_{1}{I}_{\mathrm{s}}}{\eta {V}_{\mathrm{T}}}\mathrm{exp}\left(\frac{\lambda {V}_{\mathrm{in}}}{\eta {V}_{\mathrm{T}}}\right)\right).$$

As a final step, we insert Equation (38) into Equation (31) to derive a complete expression for the transfer function of a single wavefolding stage in the Serge middle VCM:

$${V}_{\mathrm{out}}={V}_{\mathrm{in}}-2\lambda \eta {V}_{\mathrm{T}}W\left(\frac{{R}_{1}{I}_{\mathrm{s}}}{\eta {V}_{\mathrm{T}}}\mathrm{exp}\left(\frac{\lambda {V}_{\mathrm{in}}}{\eta {V}_{\mathrm{T}}}\right)\right).$$

Figure 7 shows the transfer function of the circuit, evaluated in MATLAB for values of ${V}_{\mathrm{in}}$ between −1.5 and 1.5 V. As before, the model was discretized trivially and is presented against its corresponding SPICE simulation. Parameter values used in this simulation are compiled in Table 4. The value of parameters ${I}_{\mathrm{s}}$ and $\eta $ for the 1N4148 diode were matched to those of its corresponding SPICE model [61]. Figure 7b shows the absolute difference between both simulations. These results indicate a good match between the models, as the maximum difference was once again found to be below 1 mV.

Finally, Figure 8 shows the output of the Serge wavefolder for a 500-Hz sinusoidal input. As expected, the circuit behaves as a wavefolder, folding portions of the input waveform whose absolute value exceeds approximately 0.3 V. This behavior is similar to that of the Lockhart wavefolder (cf. Figure 4a).

Equation (39) shares a close resemblance with Equation (28), the proposed Lockhart wavefolder model. In fact, both expressions have the same form, which consists of the difference between a portion of the input signal and an input-dependent nonlinear element. In the case of the Lockhart wavefolder, when the ${R}_{\mathrm{L}}=R/2$ Equation (28) simplifies to
which is remarkably close to Equation (39), with the only difference being the missing factor of two outside the Lambert-W function. This factor accounts for the difference between physical parameters ${I}_{\mathrm{s}}$ and $\eta $ in each circuit. Figure 9 shows a comparison of the transfer functions for the Lockhart (${R}_{\mathrm{L}}=7.5$ k$\mathsf{\Omega}$) and Serge wavefolders implemented using the parameter values in Table 2 and Table 4, respectively. From this figure, we can observe that the only significant difference between both transfer functions is in their sharpness at the folding points. This means the Lockhart wavefolder will introduce sharper folds which will translate into brighter sounds at the output. From this analysis, it is clear that both circuits result in a similar audio effect, even though they are produced using different architectures.

$${V}_{\mathrm{out}}={V}_{\mathrm{in}}-\lambda \eta {V}_{\mathrm{T}}W\left(\frac{{R}_{\mathrm{L}}{I}_{\mathrm{s}}}{\eta {V}_{\mathrm{T}}}\mathrm{exp}\left(\frac{\lambda {V}_{\mathrm{in}}}{\eta {V}_{\mathrm{T}}}\right)\right),$$

In the previous sections, the time-domain behavior of the Lockhart and Serge wavefolder models was examined via trivial discretization of their characteristic transfer functions. In this section, we move on to consider two implications of virtual analog wavefolding: evaluation of the Lambert-W function and aliasing.

A particular challenge of using the Lambert-W function in VA modeling, where real-time operation is paramount, is that of computational efficiency. Optimizing the evaluation of $W\left(\right)$ is an active research topic (see, e.g., [64]). For the case of guitar distortion circuits, Paiva et al. proposed the use of a simplified iterative method which relies on a lookup table for its initial guess [57]. In this work, we propose approximating the value of $W\left(\right)$ directly using Fritsch’s iteration, as suggested in [60]. In order to compute ${w}_{m}$, an approximation to $W\left(x\right)$, where $x\in {\mathbb{R}}_{>0}$, we iterate over
where
and $m=0,\phantom{\rule{0.166667em}{0ex}}1,\phantom{\rule{0.166667em}{0ex}}2,\phantom{\rule{0.166667em}{0ex}}\dots ,\phantom{\rule{0.166667em}{0ex}}M-1$. The value ${w}_{0}$ is an initial guess and M is the number of iterations required for ${\epsilon}_{m}$ to approximate zero within machine-size floating point precision. The special case $W\left(0\right)=0$ is defined separately.

$${w}_{m+1}={w}_{m}(1+{\epsilon}_{m}),$$

$$\begin{array}{ccc}\hfill {\epsilon}_{m}& =& \left(\frac{{r}_{m}}{1+{w}_{m}}\right)\left(\frac{{q}_{m}-{r}_{m}}{{q}_{m}-2{r}_{m}}\right)\hfill \end{array}$$

$$\begin{array}{ccc}\hfill {r}_{m}& =& \mathrm{ln}\left(\frac{x}{{w}_{m}}\right)-{w}_{m}\hfill \end{array}$$

$$\begin{array}{ccc}\hfill {q}_{m}& =& 2\left(1+{w}_{m}\right)\left(1+{w}_{m}+\frac{2}{3}{r}_{m}\right),\hfill \end{array}$$

The efficiency of Fritsch’s iteration will depend on the choice of initial guess. As explained in [60], an initial guess within ${10}^{-4}$ of the solution will yield an approximation to $W\left(\right)$ accurate to within ${10}^{-16}$ in just one iteration. Figure 10 shows the approximate times required to compute $W\left(x\right)$ for a set of values of x between ${10}^{-24}$ and ${10}^{300}$ using Fritsch’s iteration and the previously-proposed Halley’s method [50]. This range was chosen as it covers all values of interest. For instance, when ${V}_{\mathrm{in}}=5$ V, the argument of $W\left(\right)$ in the Serge wavefolder model will be approximately $1.52$ × ${10}^{44}$. All times were computed by averaging the result of 30 iterations implemented under identical circumstances. A piecewise approximation was used to compute the initial guess, as described in [60]. From this plot, we can observe that Fritsch’s iteration outperforms Halley’s method by up to approximately 11 times. A MATLAB implementation of the Lambert-W function used to perform these measurements can be found in the accompanying website for this article.

As discussed in Section 1, nonlinear waveshaping in the digital domain is susceptible to aliasing distortion due to its frequency-expanding nature. Wavefolding is no exception to this problem. As an arbitrary input waveform is folded, new harmonic overtones will be added to the frequency spectrum. Harmonics at frequencies exceeding half of the sampling rate, or the Nyquist limit, will be reflected into the audio baseband as aliases. Aliasing is known to cause unpleasant artifacts—such as beating and inharmonicity—that cannot be tolerated in a music computing scenario. Oversampling is commonly employed to mitigate this issue; however, this approach increases the computational requirements of the system by introducing additional operations.

We propose the use of the first-order antialiasing method presented in [48,49]. This method is designed to reduce aliasing caused by memoryless waveshaping functions with the form described by Equation (29). The antialiased output of the waveshaping function is defined as
where $F\left(\right)$ is the antiderivative of $f\left(\right)$, the original transfer function. For the case of the Lockhart wavefolder defined by Equation (28), the integrated transfer function is defined as
where
and $\alpha $, $\beta $ and $\Delta $ remain as before. This result showcases an advantageous property of the Lambert-W function $W\left(\right)$; its antiderivative is defined in terms of $W\left(\right)$ itself. Therefore, computing $F\left(\right)$ does not pose a major increase in computational costs with respect to evaluating simply $f\left(\right)$. For the case of the Serge wavefolder defined by Equation (39), the required antiderivative is given by
where

$${V}_{\mathrm{out}}\left[n\right]=\frac{F\left({V}_{\mathrm{in}}\left[n\right]\right)-F\left({V}_{\mathrm{in}}[n-1]\right)}{{V}_{\mathrm{in}}\left[n\right]-{V}_{\mathrm{in}}[n-1]},$$

$$F\left({V}_{\mathrm{in}}\right)=\frac{\alpha}{2}{V}_{\mathrm{in}}^{2}-\frac{\eta {V}_{\mathrm{T}}}{2\beta}\left[{\mathsf{\Psi}}_{1}({\mathsf{\Psi}}_{1}+2)\right],$$

$${\mathsf{\Psi}}_{1}=W\left(\Delta \mathrm{exp}\left(\lambda \beta {V}_{\mathrm{in}}\right)\right),$$

$$F\left({V}_{\mathrm{in}}\right)=\frac{{V}_{\mathrm{in}}^{2}}{2}-{\left(\eta {V}_{\mathrm{T}}\right)}^{2}\left[{\mathsf{\Psi}}_{2}({\mathsf{\Psi}}_{2}+2)\right],$$

$${\mathsf{\Psi}}_{2}=W\left(\frac{{R}_{1}{I}_{\mathrm{s}}}{\eta {V}_{\mathrm{T}}}\mathrm{exp}\left(\frac{\lambda {V}_{\mathrm{in}}}{\eta {V}_{\mathrm{T}}}\right)\right).$$

When ${V}_{\mathrm{in}}\left[n\right]\approx {V}_{\mathrm{in}}[n-1]$, Equation (45) can become ill-conditioned. This is avoided by defining the special case
when $|{V}_{\mathrm{in}}\left[n\right]-{V}_{\mathrm{in}}[n-1]|$ is smaller than a predetermined threshold [48]. This special case simply bypasses the antialiased form while compensating for the half-sample latency of the method.

$${V}_{\mathrm{out}}\left[n\right]=f\left(\frac{{V}_{\mathrm{in}}\left[n\right]+{V}_{\mathrm{in}}[n-1]}{2}\right),$$

This section examines the frequency-domain behavior of the Lockhart and Serge wavefolders and their proposed antialiased forms. Next, we evaluate the computational costs of the antiderivative method with respect to oversampling for the case of the Lockhart model.

The spectrogram in Figure 11 shows the effect of increasing the value of ${R}_{\mathrm{L}}$ in the Lockhart wavefolder model for a constant 150-Hz sinusoidal input. As expected, the level of harmonic distortion introduced by the circuit is proportional to the value of this resistance. Therefore, this parameter can be used for additional timbral control. It should be noted that due to the antisymmetric nature of the folding function, the system introduces odd harmonics only for input signals centered around zero. Since the level of harmonics introduced by the Lockhart wavefolder depends on the choice of ${R}_{\mathrm{L}}$, we consider the highest recommended case ${R}_{\mathrm{L}}=50$ k$\mathsf{\Omega}$ as a worst-case scenario in terms of aliasing distortion.

Figure 12 shows the spectrograms of a linear sweep from 20 Hz–5 kHz with peak amplitude of 1 V processed by the proposed Lockhart and Serge wavefolder models. This frequency range was chosen as it covers all fundamental frequencies of musical interest. A sample rate ${F}_{\mathrm{s}}=1$ MHz was used to generate these figures in order to simulate an ideal alias-free continuous-time behavior. These results will be used as a reference when evaluating the performance of the proposed antialiased forms. From these spectrograms we can observe how the Lockhart wavefolder is capable of generating brighter sounds. This perceptual attribute can be varied by changing the value of ${R}_{\mathrm{L}}$.

Figure 13a shows the result of processing the same linear sweep using the trivial (i.e., non-antialiased) Lockhart model at a standard audio rate of ${F}_{\mathrm{s}}=44.1$ kHz. When compared to Figure 12a, we can clearly observe the high levels of aliasing distortion introduced by the model. This is somewhat ameliorated in Figure 13b, where the sweep has been processed at a sample rate of ${F}_{\mathrm{s}}=88.2$ kHz (i.e., two-times oversampling). Figure 13c,d shows the result of processing the sweep using the proposed antialiasing method at audio rate and with two-times oversampling, respectively. As shown in these spectrograms, there is a significant reduction in aliasing, particularly below the fundamental frequency. This behavior is advantageous in music applications because at low frequencies the audibility of aliasing distortion is only limited by the hearing threshold. On the other end of the spectrum, the masking effects of harmonics will help suppress the audible effects of high-frequency aliases [65].

The spectrograms in Figure 14a,b show the outcome of processing the 1 V linear sweep with the proposed Serge wavefolder model at audio rate and with two-times oversampling, respectively. When compared with Figure 13a,b it is evident that the Serge wavefolder model is less susceptible to aliasing distortion. This can be attributed to the fact that its transfer function is not as sharp as that of the Lockhart, particularly when ${R}_{\mathrm{L}}=50$ k$\mathsf{\Omega}$. Figure 14c,d shows the result of processing the linear sweep using the antiderivative method at audio rate and with oversampling by two. In this case, operating at audio rate yields very effective results as there are very few visible aliases left below the fundamental. When combined with oversampling by two the antiderivative method produces a nearly alias-free spectrum for the measured frequency range.

The performance of the proposed antialiasing method was further evaluated by computing the A-weighted noise-to-mask ratio (ANMR) for a set of sinusoidal input signals processed by both wavefolder models. The ANMR has been previously researched as a perceptually-informed measure to evaluate the audibility of aliasing distortion [41,65]. The algorithm computes the power ratio in decibels between the wanted harmonics and aliased components, but takes into account the masking effects of the former. An A-weighting filter is applied to all signals prior to the evaluation of the ANMR in order to account for the frequency-dependent sensitivity of hearing for low-level sounds. Signals with an ANMR value below $-10$ dB are considered to be completely free from perceivable aliasing. A detailed account of this method can be found in [65].

Figure 15a compares the measured ANMRs for a set of sinusoidal inputs with fundamental frequencies between 1 and 5 kHz processed by the Lockhart model at different sampling rates. The ideal alias-free signals required to compute these values were synthesized using Fourier analysis and additive synthesis, as suggested in [41]. All signals were downsampled back to audio rate (i.e., 44.1 kHz) prior to evaluation. A dashed horizontal line has been used to indicate the −10 dB hearing threshold for aliasing distortion. In Figure 15a we can observe the significant increase in signal quality obtained by the proposed antialiasing method when applied to the Lockhart wavefolder, even when operating at audio rate. Moreover, these measurements show that the performance of the proposed method, when combined with two-times oversampling, is on par with oversampling by a factor of 8. For all fundamental frequencies below approximately 4.2 kHz, the ANMR lies below the $-10$ dB line. This range can be regarded as sufficient for musical applications if we consider that the highest fundamental frequency on a standard grand piano is 4186.01 Hz (MIDI note C8).

Figure 15b shows the measured ANMRs for the Serge wavefolder. When implemented at audio rate, the output is free from perceivable aliasing for fundamental frequencies up to approximately 2 kHz. These measurements go in accordance with the Spectrogram in Figure 14a, which shows aliasing is significantly more evident above this frequency. The use of the antiderivative method yields results comparable to those of oversampling by a factor of two, with all measured fundamental frequencies below approximately 4.6 kHz lying below the −10 dB aliasing threshold. Overall, these results indicate the proposed Serge wavefolder model can operate at audio rate with the help of the antiderivative method, therefore avoiding the need for oversampling.

The computational costs of the antialiased Lockhart wavefolder model were measured by porting the algorithms into C code using the 128-bit long double data type. Table 5 shows the computation times for a 1-s 100-Hz sinusoidal input processed using the proposed model for different peak amplitude values. These results were computed by averaging the processing times of one hundred implementations. All tests were performed under identical circumstances, using a fixed resistance value of ${R}_{\mathrm{L}}=50$ k$\mathsf{\Omega}$, the highest recommended value. From these results we can observe that the complexity of the model does not depend on the input and that the overhead of implementing the antialiasing method is minimal. When operating at audio rate, the added computation time is approximately 1 ms for a 1-second simulation. Moreover, these time measurements show that the antialiased Lockhart model, implemented at a sample rate ${F}_{\mathrm{s}}=88.2$ kHz, is approximately 3.5 times faster than oversampling by a factor of 8 (i.e., ${F}_{\mathrm{s}}=352.8$ kHz) and nearly twice as fast as oversampling by a factor of 4. Changing the value of ${R}_{\mathrm{L}}$ did not affect the execution times of the algorithms.

For high values of ${R}_{\mathrm{L}}$, long double representation is necessary to account for the large values that will result at the argument of the Lambert-W function. For smaller values, 64-bit precision will be sufficient to accommodate most input levels of interest. For instance, when ${R}_{\mathrm{L}}=7.5$ k$\mathsf{\Omega}$ the signal at the input of the proposed Lockhart wavefolder model can have a peak amplitude of up to 9 V.

The measurements in Table 5 were conducted by synthesizing all input signals at the target rates. In practical implementations, oversampling will require additional pre- and post-filtering stages that will further increase the computational costs of the system. The complexity and costs of these filtering stages will be directly proportional to the required oversampling factor. This constitutes another advantage of the proposed antialiasing method.

In practical sound synthesis applications, a single folding stage is rarely used, as the timbral variety it can produce is quite limited. Most analog designs, for example the Intellijel $\mu $Fold and the aforementioned Yusynth Metalizer, employ several wavefolding stages arranged in series. The number of stages varies according to the design, but typically cascades of two to six stages are used. As mentioned in Section 3, the Serge middle VCM utilizes six identical folding stages. Figure 16 shows a simplified block diagram representation of the Serge middle VCM based on the original design [63]. Blocks labeled “SWF” correspond to the proposed Serge wavefolder model. An ad hoc gain factor of four, not present in the original circuit, has been added to compensate for the scaling of the signal introduced by the cascade of wavefolders.

In cascaded wavefolder structures like the one shown in Figure 16, timbral control can be achieved in two manners. The first is by adjusting the gain of the input waveform (using ${G}_{\mathrm{S}}$ in this case). This parameter controls the amount of folds introduced, allowing the overall brightness of the sound to be varied. It can be modulated in real-time to provide articulation to a sound similar to filtering in subtractive synthesis or modulation index in FM synthesis. The second way to control timbre is by adding a dc offset to the input of the wavefolder. This breaks the aforementioned symmetry of the folding function and introduces even harmonics. When modulated by using, for example, a low-frequency oscillator, this parameter provides an effect reminiscent of pulse-width modulation. Figure 17a shows the transfer function of the Serge middle VCM model for the case of zero dc offset. This plot was generated by defining ${V}_{\mathrm{in}}$ to have a constant value of 1 V and sweeping through values of ${G}_{\mathrm{S}}$ between $-8$ and 8. Figure 17b shows the output of the Serge middle VCM when driven by a 100-Hz sinusoid with ${G}_{\mathrm{S}}=6$. For simplicity, in this section, we assume the range of ${V}_{\mathrm{in}}$ to be fixed at $\pm 1$ V; therefore, all gain modulation is done using ${G}_{\mathrm{S}}$ only.

The spectrogram in Figure 18a shows the effect of increasing ${G}_{\mathrm{S}}$ from 0 to 6 for a 150-Hz sinusoidal input. This plot effectively depicts the rich harmonic patterns introduced by the system, which are far more complex than those introduce by traditional waveshaping methods and offer a wide timbral palette for sound synthesis. The fluctuations in energy at the fundamental and first few harmonics indicate the gain values at which each new fold is introduced. Figure 17b shows the effect of introducing a dc offset at the input of the system for a constant 200-Hz sinusoidal input. This result shows how the use of a dc offset can extend the timbral possibilities of the system even further, by introducing complex patterns consisting of both even and odd harmonics.

Now, although the Lockhart wavefolder was originally designed to operate as a standalone unit, it can be adapted into a series topology with relative ease. Here, we propose using the wavefolding structure shown in Figure 19 to expand the synthesis capabilities of the Lockhart wavefolder. This design, while not based on any existing circuit, is comparable to that of the Yusynth Metalizer which also utilizes four Lockhart circuits in series [55]. The following paragraphs describe the sections of this proposed topology. Its frequency-domain behavior is then examined and compared with that of the Serge middle VCM.

The blocks labeled “LWF” in Figure 19 correspond to the proposed Lockhart wavefolder model. In order for this cascade of Lockhart wavefolders to behave as expected, we need to make sure that the individual folding stages satisfy two criteria. Firstly, the individual folders must provide approximately unity gain for small input values, i.e., below the folding point, and approximately negative unity gain beyond the folding point. Secondly, each stage should start folding at the same point with respect to its individual input.

We can meet these criteria with the proposed Lockhart model by selecting an appropriate value for ${R}_{\mathrm{L}}$ and adding static gain stages before and after the folding stages. These gain blocks will also help compensate for the attenuation introduced by the folding operation. First, we choose a value of ${R}_{\mathrm{L}}$ for which the Lockhart wavefolder exhibits unity gain for small input values. Having found this resistance value, the pre- and post-gain stages can be determined by measuring the value of $\left|{V}_{\mathrm{out}}\right|$ at exactly the folding point. The pre-gain is taken to be approximately this value, and the post-gain is taken to be its inverse. In Section 3.1, it was shown that for ${R}_{\mathrm{L}}=7.5\phantom{\rule{0.166667em}{0ex}}k\mathsf{\Omega}$ the Lockhart wavefolder exhibits approximately unity gain below the folding point. This value leads to pre- and post-gains of approximately 1/3 and 3, respectively.

Figure 20a shows the transfer function of the proposed structure measured at the output of the post-gain block. We can observe how the folds introduced by this structure are evenly distributed, unlike those in Figure 17a. As with the Serge middle VCM, timbral control is achieved by modulating the value of ${G}_{\mathrm{L}}$ and by adding a dc offset. The static gain blocks ensure the amplitude of the folded output is bounded between approximately $\pm 1$ V for values of ${G}_{\mathrm{L}}$ between $-10$ and 10 (assuming once more that ${V}_{\mathrm{in}}$ has a peak amplitude of 1 V). Figure 20b shows the time-domain result of processing a 100-Hz sinusoidal input with the proposed structure for ${G}_{\mathrm{L}}=10$ and zero dc offset. In this particular design, additional timbral control can be achieved by modulating the value of ${R}_{\mathrm{L}}$.

Lastly, we add two optional blocks. The first is a $\mathrm{tanh}\left(\right)$ function after the post-gain block to model the behavior of an output buffering stage and to limit the range of the output waveform. This $\mathrm{tanh}\left(\right)$ block can also be antialiased using the antiderivative method described by Equation (45). The antiderivative of the $\mathrm{tanh}\left(\right)$ function is given by $\mathrm{log}\left(\mathrm{cosh}\right(\left)\right)$ [48]. The second optional block is a static one-pole lowpass filter with a cutoff at ${f}_{\mathrm{c}}=1.3$ kHz whose purpose is to act as a simple tone control. A similar static filtering stage can be found at the output of the Buchla 259 wavefolder [17]. The s-domain transfer function of this filtering stage is defined as
where ${w}_{\mathrm{c}}=2\pi {f}_{\mathrm{c}}$.

$$H\left(s\right)=\frac{{w}_{\mathrm{c}}}{s+{w}_{\mathrm{c}}},$$

Finally, we examine the time-varying behavior of the proposed structure by considering the case of a 150-Hz input sinewave with variable gain ${G}_{\mathrm{L}}$ and dc offset. Figure 21 shows the spectrogram that results from varying ${G}_{\mathrm{L}}$ from 0 to 15. As expected, the system introduces complex harmonic patterns similar to those shown in Figure 18a. Likewise, Figure 18b demonstrates the effect of varying ${G}_{\mathrm{L}}$ from 0 to 10 while simultaneously increasing the level of dc offset from 0 to 5 V. This response is comparable to that of the Serge middle VCM (see Figure 18b).

A real-time demo of the proposed Lockhart wavefolder topology implemented using Max/MSP and Gen is available at http://research.spa.aalto.fi/publications/papers/smc17-wavefolder.

In this work, we have explored the behavior of two West Coast synthesizer circuits: the Lockhart and Serge wavefolders. By means of circuit analysis, we have derived closed-form expressions for the characteristic transfer functions of both systems. These transfer functions were validated against SPICE simulations implemented using LTspice. The results obtained indicate a good match between the proposed models and their corresponding SPICE simulations. In addition to this, we observed that the behavior of both circuits is very similar, despite the fact that their designs are fundamentally different.

The issue of aliasing caused by wavefolding in the digital domain was treated by incorporating the first-order antiderivative method. Within the context of the Lockhart wavefolder, it was shown that the proposed antialiased model is perceptually free from the effects of aliasing distortion when implemented at a sampling rate of ${F}_{\mathrm{s}}=88.2$ kHz. A thorough evaluation of the proposed Lockhart model indicates that this configuration yields a signal quality equivalent to that of oversampling by a factor of eight (i.e., ${F}_{\mathrm{s}}=352.8$ kHz) at nearly a fourth of the computational expenses. For the case of the Serge wavefolder, the use of the antiderivative method produces an increase in signal quality equivalent to that of oversampling by a factor of two (i.e., ${F}_{\mathrm{s}}=88.2$ kHz).

Furthermore, a recommended synthesis topology built around the Lockhart model consisting of four cascaded wavefolding stages, a saturator and a lowpass filter was presented. This topology was compared against a model of the Serge middle VCM built using six wavefolding stages. These structures illustrate the capabilities of wavefolding in a synthesis environment. However, it should be noted that the discussed topologies are not unique, as they can be modified according to the needs of the particular application. This effectively showcases the flexibility of VA models.

The following are available online at http://research.spa.aalto.fi/publications/papers/smc17-wavefolder: a real-time Max/MSP demo of the proposed Lockhart wavefolder topology implemented using Gen~and a MATLAB implementation of the Lambert-W function using Fritsch’s iteration.

The authors would like to thank Ken Stone for the valuable correspondence about the origins of the Lockhart circuit and Geoffrey Gormond for fruitful discussions on the behavior of the Serge VCM. Special thanks go to Prof. Vesa Välimäki for his assistance generating the ANMR curves. The work of Fabián Esqueda is supported by the Aalto ELEC Doctoral School.

Fabián Esqueda and Henri Pöntynen conceived the idea for the paper and oversaw its development. Henri Pöntynen and Julian D. Parker wrote Section 2.1 and Section 6, respectively, with additional work by Fabián Esqueda. Fabián Esqueda wrote the rest of the paper, conducted all measurements and generated all figures, with additional comments and corrections from the other three co-authors.

The authors declare no conflict of interest.

- Le Brun, M. Digital waveshaping synthesis. J. Audio Eng. Soc.
**1979**, 27, 250–266. [Google Scholar] - Risset, J.C. An Introductory Catalog of Computer Synthesized Sounds; Bell Laboratories: Murray Hill, NJ, USA, 1969. [Google Scholar]
- Schaefer, R.A. Electronic musical tone production by nonlinear waveshaping. J. Audio Eng. Soc.
**1970**, 18, 413–417. [Google Scholar] - Arfib, D. Digital synthesis of complex spectra by means of multiplication of nonlinear distorted sine waves. In Proceedings of the 59th Convention of the Audio Engineering Society, Hamburg, Germany, 28 February–3 March 1978. [Google Scholar]
- Roads, C. A tutorial on non-linear distortion or waveshaping synthesis. Comput. Music J.
**1979**, 3, 29–34. [Google Scholar] [CrossRef] - Chowning, J.M. The synthesis of complex audio spectra by means of frequency modulation. J. Audio Eng. Soc.
**1973**, 21, 526–534. [Google Scholar] - Ishibashi, M. Electronic Musical Instrument. Patent No. 4,658,691, 21 April 1987. [Google Scholar]
- Kleimola, J. Audio synthesis by bitwise logical modulation. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Espoo, Finland, 1–4 September 2008. [Google Scholar]
- Timoney, J.; Lazzarini, V.; Lysaght, T. A modified FM synthesis approach to bandlimited signal generation. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Espoo, Finland, 1–4 September 2008. [Google Scholar]
- Kleimola, J.; Lazzarini, V.; Timoney, J.; Välimäki, V. Vector phaseshaping synthesis. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Paris, France, 19–23 September 2011. [Google Scholar]
- Pakarinen, J.; Yeh, D.T. A review of digital techniques for modeling vacuum-tube guitar amplifiers. Comput. Music J.
**2009**, 33, 85–100. [Google Scholar] [CrossRef] - Hobbs, R.V.; Snoddy, G.T. Tone Modifier for Electrically Amplified Electro-Mechanically Produced Musical Tones. Patent No. 3,213,181, 19 October 1965. [Google Scholar]
- Yeh, D.T.; Abel, J.S.; Smith, J.O., III. Simplified, physically-informed models of distortion and overdrive guitar effects pedals. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Bordeaux, France, 10–15 September 2007. [Google Scholar]
- Werner, K.J.; Nangia, V.; Smith, J.O., III; Abel, J.S. Resolving wave digital filters with multiple/multiport nonlinearities. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Trondheim, Norway, 30 November–3 December 2015. [Google Scholar]
- Buchla Electronic Musical Instruments. The History of Buchla. Available online: https://buchla.com/history/ (accessed on 3 October 2017).
- Parker, J.; D’Angelo, S. A digital model of the Buchla lowpass-gate. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Maynooth, Ireland, 2–5 September 2013. [Google Scholar]
- Esqueda, F.; Pöntynen, H.; Välimäki, V.; Parker, J.D. Virtual analog Buchla 259 wavefolder. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Edinburgh, UK, 5–9 September 2017. [Google Scholar]
- Moog, R.A. A voltage-controlled low-pass high-pass filter for audio signal processing. In Proceedings of the 7th Convention of the Audio Engineering Society, New York, NY, USA, 11–15 October 1965. [Google Scholar]
- Stilson, T.; Smith, J.O., III. Analyzing the Moog VCF with considerations for digital implementation. In Proceedings of the International Computer Music Conference, Hong Kong, China, 19–24 August 1996. [Google Scholar]
- Huovilainen, A. Non-linear digital implementation of the Moog ladder filter. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Naples, Italy, 5–8 October 2004. [Google Scholar]
- Hélie, T. On the use of Volterra series for real-time simulations of weakly nonlinear analog audio devices: application to the Moog ladder filter. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Montreal, QC, Canada, 18–20 September 2006. [Google Scholar]
- D’Angelo, S.; Välimäki, V. Generalized Moog ladder filter: Part II—Explicit nonlinear model through a novel delay-free loop implementation method. IEEE/ACM Trans. Audio Speech Lang. Process.
**2014**, 22, 1873–1883. [Google Scholar] [CrossRef] - Civolani, M.; Fontana, F. A nonlinear digital model of the EMS VCS3 voltage-controlled filter. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Espoo, Finland, 1–4 September 2008. [Google Scholar]
- Fontana, F.; Civolani, M. Modeling of the EMS VCS3 voltage-controlled filter as a nonlinear filter network. IEEE Trans. Audio Speech Lang. Process.
**2010**, 18, 760–772. [Google Scholar] [CrossRef] - Huovilainen, A. Design of a Scalable Polyphony-MIDI Synthesizer for a Low Cost DSP. Master’s Thesis, Aalto University, Espoo, Finland, 2010. [Google Scholar]
- Rest, M.; Parker, J.; Werner, K.J. WDF modeling of a Korg MS-50 based non-linear diode bridge VCF. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Edinburgh, UK, 5–7 September 2017. [Google Scholar]
- Yeh, D.T.; Abel, J.S.; Smith, J.O., III. Simulation of the diode limiter in guitar distortion circuits by numerical solution of ordinary differential equations. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Bordeaux, France, 10–15 September 2007. [Google Scholar]
- De Paiva, R.C.D.; Pakarinen, J.; Välimäki, V.; Tikander, M. Real-time audio transformer emulation for virtual tube amplifiers. EURASIP J. Adv. Signal Process.
**2011**, 2011, 1–15. [Google Scholar] - Dunkel, W.R.; Rest, M.; Werner, K.J.; Olsen, M.J.; Smith, J.O., III. The Fender Bassman 5F6-A family of preamplifier circuits—A wave digital filter case study. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Brno, Czech Republic, 5–9 September 2016. [Google Scholar]
- Huovilainen, A. Enhanced digital models for analog modulation effects. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Madrid, Spain, 20–22 September 2005. [Google Scholar]
- Holters, M.; Zölzer, U. Physical modelling of a wah-wah effect pedal as a case study for application of the nodal DK method to circuits with variable parts. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Paris, France, 19–23 September 2011. [Google Scholar]
- Eichas, F.; Fink, M.; Holters, M.; Zölzer, U. Physical modeling of the MXR Phase 90 guitar effect pedal. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Erlangen, Germany, 1–5 September 2014. [Google Scholar]
- Parker, J. A simple digital model of the diode-based ring modulator. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Paris, France, 19–23 September 2011. [Google Scholar]
- Werner, K.J.; Abel, J.S.; Smith, J.O. A physically-informed, circuit-bendable, digital model of the Roland TR-808 bass drum circuit. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Erlangen, Germany, 1–5 September 2014. [Google Scholar]
- Werner, K.J.; Abel, J.S.; Smith, J.O. The TR-808 cymbal: A physically-informed, circuit-bendable, digital model. In Proceedings of the International Computer Music Conference (ICMC)/Sound and Music Computing Conference (SMC), Athens, Greece, 14–20 September 2014. [Google Scholar]
- De Paiva, R.C.D.; Pakarinen, J.; Välimäki, V. Reduced-complexity modeling of high-order nonlinear audio systems using swept-sine and principal component analysis. In Proceedings of the 45th Audio Engineering Society Conference: Applications of Time-Frequency Processing in Audio, Helsinki, Finland, 1–4 March 2012. [Google Scholar]
- Eichas, F.; Zölzer, U. Black-box modeling of distortion circuits with block-oriented models. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Brno, Czech Republic, 5–9 September 2016. [Google Scholar]
- Eichas, F.; Möller, S.; Zölzer, U. Block-oriented gray box modeling of guitar amplifiers. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Edinburgh, UK, 5–9 September 2017. [Google Scholar]
- Stilson, T.; Smith, J.O., III. Alias-free digital synthesis of classic analog waveforms. In Proceedings of the International Computer Music Conference, Hong Kong, China, 19–24 August 1996. [Google Scholar]
- Brandt, E. Hard sync without aliasing. In Proceedings of the International Computer Music Conference, Havana, Cuba, 17–23 September 2001. [Google Scholar]
- Välimäki, V.; Pekonen, J.; Nam, J. Perceptually informed synthesis of bandlimited classical waveforms using integrated polynomial interpolation. J. Acoust. Soc. Am.
**2012**, 131, 974–986. [Google Scholar] [CrossRef] [PubMed] - Välimäki, V. Discrete-time synthesis of the sawtooth waveform with reduced aliasing. IEEE Signal Process. Lett.
**2005**, 12, 214–217. [Google Scholar] - Välimäki, V.; Nam, J.; Smith, J.O., III; Abel, J.S. Alias-suppressed oscillators based on differentiated polynomial waveforms. IEEE Trans. Audio Speech Lang. Process.
**2010**, 18, 786–798. [Google Scholar] - Kleimola, J.; Välimäki, V. Reducing aliasing from synthetic audio signals using polynomial transition regions. IEEE Signal Process. Lett.
**2012**, 19, 67–70. [Google Scholar] [CrossRef] - Franck, A.; Välimäki, V. Higher-order integrated wavetable synthesis. In Proceedings of the International Conference on Digital Audio Effects (DAFx), York, UK, 17–21 September 2012. [Google Scholar]
- Esqueda, F.; Bilbao, S.; Välimäki, V. Aliasing reduction in clipped signals. IEEE Trans. Signal Process.
**2016**, 60, 5255–5267. [Google Scholar] [CrossRef] - Esqueda, F.; Välimäki, V.; Bilbao, S. Rounding corners with BLAMP. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Brno, Czech Republic, 5–9 September 2016. [Google Scholar]
- Parker, J.; Zavalishin, V.; Le Bivic, E. Reducing the aliasing of nonlinear waveshaping using continuous-time convolution. In Proceedings of the International Conference on Digital Audio Effects (DAFx), Brno, Czech Republic, 5–9 September 2016. [Google Scholar]
- Bilbao, S.; Esqueda, F.; Parker, J.D.; Välimäki, V. Antiderivative antialiasing for memoryless nonlinearities. IEEE Signal Process. Lett.
**2017**, 24, 1049–1053. [Google Scholar] [CrossRef] - Esqueda, F.; Pöntynen, H.; Parker, J.D.; Bilbao, S. Virtual analog model of the Lockhart wavefolder. In Proceedings of the 14th Sound and Music Computing Conference (SMC), Espoo, Finland, 5–8 July 2017. [Google Scholar]
- Lockhart, R., Jr. Non-selective frequency tripler uses transistor saturation characteristics. Electron. Des.
**1973**, 17. [Google Scholar] - Hutchins, B.A. Frequency multiplication and division methods. Electronotes
**1976**, 70, 3–17. [Google Scholar] - Stone, K. Simple wave folder for music synthesizers. Available online: https://www.cgs.synth.net/modules/cgs52_folder.html (accessed on 19 September 2017).
- Stone, K.; CGS, Melbourne, Australia. Private communication, 2017.
- Usson, Y. Yusynth Metalizer. Available online: http://yusynth.net/modular/en/metalizer/ (accessed on 18 September 2017).
- Banwell, T.; Jayakumar, A. Exact analytical solution for current flow through diode with series resistance. Electron. Lett.
**2000**, 36, 291–292. [Google Scholar] [CrossRef] - De Paiva, R.C.D.; D’Angelo, S.; Pakarinen, J.; Välimäki, V. Emulation of operational amplifiers and diodes in audio distortion circuits. IEEE Trans. Circuits Syst. II Exp. Briefs
**2012**, 59, 688–692. [Google Scholar] [CrossRef] - Werner, K.J.; Nangia, V.; Bernardini, A.; Smith, J.O., III; Sarti, A. An improved and generalized diode clipper model for wave digital filters. In Proceedings of the 139th Convention of the Audio Engineering Society, New York, NY, USA, 29 October–1 November 2015. [Google Scholar]
- Bernardini, A.; Werner, K.J.; Sarti, A.; Smith, J.O., III. Modeling nonlinear wave digital elements using the Lambert function. IEEE Trans. Circuits Syst. I Regul. Pap.
**2016**, 63, 1231–1242. [Google Scholar] [CrossRef] - Veberič, D. Lambert W function for applications in physics. Comput. Phys. Commun.
**2012**, 183, 2622–2628. [Google Scholar] [CrossRef] - Linear Technology. LTspice. Available online: http://www.linear.com (accessed on 2 October 2017).
- Serge Modular Music Systems, San Francisco, CA, USA. New Products from Serge Modular: Series 79 Synthesizer Systems. 1980. Available online: http://www.serge.synth.net/documents/catalog/SergeModular-Series79%20.pdf (accessed on 21 September 2017).
- Stone, K. Serge Wave Multipliers for music synthesizers. Available online: https://www.cgs.synth.net/modules/cgs113_vcm.html (accessed on 21 September 2017).
- Fukushima, T. Precise and fast computation of Lambert W-functions without transcendental function evaluations. J. Comput. Appl. Math.
**2013**, 244, 77–89. [Google Scholar] [CrossRef] - Lehtonen, H.M.; Pekonen, J.; Välimäki, V. Audibility of aliasing distortion in sawtooth signals and its implications for oscillator algorithm design. J. Acoust. Soc. Am.
**2012**, 132, 2721–2733. [Google Scholar] [CrossRef] [PubMed]

Component | Value (k$\mathsf{\Omega}$) | Component | Value (V) |
---|---|---|---|

R | 15 | ${V}_{\mathrm{CC}}$ | 15 |

${R}_{\mathrm{L}}$ | 1–50 | ${V}_{\mathrm{EE}}$ | −15 |

Name | Value | Name | Value | Name | Value |
---|---|---|---|---|---|

R | 15 k$\mathsf{\Omega}$ | ${I}_{\mathrm{s}}$ | ${10}^{-17}$ A | ${V}_{\mathrm{T}}$ | 25.864 mV |

${R}_{\mathrm{L}}$ | 1–50 k$\mathsf{\Omega}$ | $\eta $ | 1 | – | – |

Component | Value (k$\mathsf{\Omega}$) | Component | Description |
---|---|---|---|

${R}_{1}$ | 33 | Diodes | 1N4148 or similar |

${R}_{2}$ | 100 | Op-Amp | TL072 or similar |

${R}_{3}$ | 100 | – | – |

Name | Value | Name | Value |
---|---|---|---|

${I}_{\mathrm{s}}$ | 2.52 nA | ${R}_{1}$ | 33 k$\mathsf{\Omega}$ |

$\eta $ | 1.752 | ${V}_{\mathrm{T}}$ | 25.864 mV |

Amplitude (V) | Audio Rate | Audio Rate | OSx2 | OSx4 | OSx8 | OSx2 |
---|---|---|---|---|---|---|

(ms) | w/Antialiasing (ms) | (ms) | (ms) | (ms) | w/ Antialiasing (ms) | |

1 | 11.5 | 12.5 | 23.4 | 46.6 | 92.9 | 25.4 |

5 | 11.6 | 12.6 | 23.3 | 46.8 | 92.7 | 25.3 |

10 | 11.5 | 12.6 | 23.7 | 46.7 | 92.9 | 25.5 |

15 | 11.5 | 12.7 | 23.5 | 46.5 | 92.9 | 25.5 |

© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).