Page  00000066 Antialiasing for Nonlinearities: Acoustic Modeling and Synthesis Applications Harvey Thornburg Center for Computer Research in Music and Acoustics Stanford University harv23@ccrma. stanford. edu ABSTRACT Nonlinear elements have manifold uses in acoustic modeling, audio synthesis and effects design. Of particular importance is their capacity to control oscillation dynamics in feedback models, and their ability to provide digital systems with a natural overdrive response. Unfortunately, nonlinearities are a major source of aliasing in a digital system. In this paper, alias suppression techniques are introduced which are particularly tailored to preserve response dynamics in acoustic models. To this end, a multirate framework for alias suppression is developed along with the concept of an aliasing signal-to-noise ratio (ASNR). Analysis of this framework proceeds as follows: first, relations are established between ASNR vs. computational cost/delay given an estimate of the reconstructed output spectrum; second, techniques are given to estimate this spectrum in the worst case given only a few statistics of the input (amplitude, and bandwidth). These tools are used to show that hard circuit elements (i.e. saturator, rectifier, and other piecewise linear systems found in bowed-string and single-reed instrument models) generate significant ASNR given reasonable computational constraints. To solve this problem, a parameterizable, general-purpose method for constructing monotonic "variably soft" approximations is developed and demonstrated to greatly suppress aliasing -without additional computational expense. The monotonicity requirement is sufficient to preserve response dynamics in a variety of practical cases. 1. INTRODUCTION A worthwile goal in music synthesis is to design instruments that convey expression in performance. To this end, an important aspect is that the energy of performance be reflected in the sound. By overblowing a flute, for example, the performer can navigate complex regimes of oscillation, as well as effect subtle tonal variations within the regimes. A linear system is insufficient for this task; moreover, if the instrument is used as a source, it must be capable of sustained oscillation, implying feedback. In a landmark paper(l], McIntyre, Schumacher and Woodhouse demonstrate that virtually all oscillatory systems found in musical acoustics generalize to a nonlinear feedback model in which a passive, linear filter is connected in feedback around an active nonlinear part. In the scope of this paper, the nonlinearity is considered memoryless. The nonlinearity determines primary characteristics (which instrument) whereas the linear part (delays and lowpass filter) influences secondary characteristics such as pitch and timbral nuance. Steady-state timbre is often nonsinusoidal, suggesting two kinds of dynamic balance involving linear and nonlinear parts. First is the classical "energy balance" responsible for limit cycle (oscillatory) behavior. The linear part dissipates energy supplied by the performer through the nonlinearity. The level of oscillations is governed by this equilibrium * Of additional importance is the spectral information balance. Lowpass elements in the linear part restrict bandwidth whereas the nonlinear part tends to expand bandwidth. If the result is to be oscillatory rather than chaotic, the evolution of timbre is seen to depend greatly on the nature of this balance. In short, the nonlinear feedback characterization is vital to the phenomenon of expressive control. However, the nonlinear part produces aliasing in digital implementation. This is especially true of the hard "circuit nonlinearities" (e.g. saturator, rectifier, dead-zone, pulse, etc.) as they produce discontinuities and corners in the output. Aliasing is especially problematic in closed-loop systems, as it may propagate around the loop or otherwise disrupt the spectral information.balance, suppressing regimes of oscillation or even displacing them towards chaos. To reduce aliasing one can change the sampling rate (within the efficient multirate framework; see Section 2) as well as approximate the nonlinearity with an equivalent less conducive to aliasing. Approximations should be made, however, with the express objective of preserving as much of the closed-loop system dynamics as possible. This contrasts with polynomial approximation techniques, which favor the output spectrum (an open-loop characteristic). Ideally one aims to duplicate the exact locations of oscillatory and chaotic regimes and the quality of transitions between regimes. Unfortunately, direct closedloop analyses prove forbiddingly complex. An efficient compromise is to ensure various control properties are maintained for the nonlinear part. This compromise is further justified in that hard circuit nonlinearities are often gross idealizations of the physical law, yet certain properties are maintained; among these are small-signal equivalence, monotonicity, and preservation of asymptotes. *Alternatively, one can lump the small-signal linearization of the nonlinear part as a gain factor in the linear part. Here the linear part is unstable, resulting in whereas the nonlinear part reflects limitations of the energy supply. This perspective is common, for instance, when modeling circuits such as the self-oscillating voltage-controlled filter, or other situations where the role of the performer viz. energy transfer is indirect. -66 - ICMC Proceedings 1999

Page  00000067 g(x) gx Figure 1. System equivalents for memoryless digital nonlinearity g(x).!~]IlterpolaLioi Filter JN >yn Figure 2. Multirate framnework for aliasing suppression 2. A M/TJTIRATE FRAMEWVORK FOR AI;AS SUTPPRESSION To motivate the snultirate framewoork, it is necessary to consider how digital nonlinearities produce aliasing. Let g(x) be a mernoryless nonlinear map. Figure 1 gives system equivalents. In the figure y(t) is generally not bandlirnited to Nyrquist (T,/2). Wh/3at is missing is the antialia~sing filter between y(t) and the sampler. To implement this Filter requires an infinite sampling rate, as all frequencies exceeding N~yquist must be rejected to prevent them from folding over. This is not available so successive approximations using a multirate framework: (Fig. 2) are considered. Portions of the output spectrum rejected by the decimation filter are shown in Fig. 3. As upsampling factor M increases, regions '2' exrpantd; regions '3' shlift along the spectrum but do not change size. By using polyphase structures [3], computational cost, of the multirate framewiork is kept linear in M. As closed-loop response is extremely sensitive to phase, interpolation/decimation filters should be linear phase, which adds a (possibly fractional) number of unit delays to the loop at base sampling rate T,. In wavegutide models, it is easier to adjust for extra delays (affecting pitch) than it is for an arbitrary nonlinear phase response. Delay compensation for lumped models, if possible, proceedls by root-locus method applied to the linearized equivalent; see [2] for details. To quantify aliasing performance gains, it is natural to define an aliauing signal-to-noise nrtio, treating foldover as noise and the u~naliased portion as signal: ASNR(M,xz) A 0/2T)ofId (1) Eiere de~pendnce on the input (x~n]) is made explicit. The aliasing cost (denloted Jairia*(M~, z)) is taken as the reciprocal of ASPIRI(M, x). By varying M one can monitor a cost vs. computations curve. The aim in approximation is to design g(x) such that the tra~deoff (J~iQ8,(A'f, z) vs. A') is Pareto optimal. The optimality is viz, constraints on g(~); namely, thle control properties discussed in Section 1. Furthermore, one requires that g(z) be somehow "close" to go(z), the latter representing the ideal nonlinearuity. `It is useful to produce a famnily of approximations, subject to control property constraints, in which Pareto optimality over all criteria (aliasing cost, computational cost, closeness to go) is approached. The above specification is still incomplete, as Jag;a.(M, x) depends on z(nJ. It is natural to minimize aliasing cost for th~e wsorst case input., as to minimize restrictions on other parts of thie system. Th~e cost may be unbounded in lieu of additional constraints on the input. Two natural, constraints are amplitude and bandwvidth~: amplitude is fixed by the system's dynamic range; bandwfidth, if unknown, is fixed at NYyquist. The worst-case input depends on the nonlinearityr; it can be obtained as the solution to a separate optimization problem. In practice, a usef~ul proxy is found to be a cosine at maximnumr amplitude writh frequency se.; to the bandwidth limit. F~ormulas for the output spectrum Y(f) are now given, with and without the simplifying assumption of a cosine input. rlThJe formulas fall into two classes, one based on Taylor series approximation of the nonlinearit~y; the other based on Fourier analysis of the output and/or decomposition of the nonlinear map into phase modulation (PM;) operators. The Taylor se~ries approach is limited for hard nonlinearities due to the analyticity requirement; howrever insights may be gained: [Y~~lrUnalia.'.d porlion (iijdio band) L~ A4liasing rnjcctcd by dccimation fle 1. 2 3 2 3 W Aliasing not rejected (roldover in audio band) 1/(ZTs) MITs - Lf(ZTs) MtTs - I/(2Ts) 2Mi~s - l/(2Ts) ctc... Figure 3. Output spectrum: aliasing rejection and foldover regions ICMC Proceedings 1999 67 - 67 -

Page  00000068 Y(f) = g)(01 ) X(f)[(*k) (2) k=0 Here ('k) denotes repeated differentiation and (*k) iterated convolution. For a cosine input z(t) = A cos(wot), the iterated convolution obtains a closed form solution via binomial expansion: (X(f) )= Ak )6(2(f - (k- 21 f (3) Equation (3) is recognized as a special case of the bandwidth expansion formulas given by Steer [4] for Volterra kernels with sinusoidal input. It should also be remarked that if g(x) is a finite order polynomial, the sum in (2) will be finite. The output bandwidth is (k- 1)/2T,; choosing M > (k + 1)/2 eliminates aliasing. Difficulty lies in that hard circuit nonlinearities are neither analytic nor are analytic approxdmants useful when restricted to finite order. Furthermore, an implicit definition gy(y) = g,(z) may prove advantageous, for which determining the Taylor expansion is analytically and computationally prohibitive. For a sinusoidal input, the output of a memoryless nonlinearity is periodic. Thus, great simplification abounds when considering Fourier-based approaches, as there are few restrictions (e.g, Dirichlet and Riemann-integrability conditions) on the map g(z). The Fourier spectral representation and projections for coefficients ak are given: Y(f) = Z ak6(2rk(f - fo)); ak = fOo g(Acos(2lrfot))e-2-ikfhLdt (4) k= -oo It is arguably more useful to obtain the output spectrum in terms of the map g(z) itself, or its Fourier transform G(w). The latter approach follows the decomposition of g(x) into a spectrum of transcendental PM operators e'A C o eo the output Fourier series of a single operator being: 00 eiArcsw0 = E iJk(A)eokwe (5) k= -oo where Jk(-) denotes the Bessel function of integer order k. Following (5], a straightforward computation involving (5) and the inverse transform relation g(z) = f~ G(f)e'w' dw obtains a = J G(f)Jk(Af)df (6) Parseval's relation brings this into the amplitude domain: ak = "IAf g(z)j( A)dz; jk(z) Tk (z)/ - Y Tz (7) where Tk(z) = coS-1(k cos(z)) is the kr" Chebyshev polynomial. The inverse Fourier transforms of the Bessel functions jk(z) are recognized as the dual basis for projections onto the space of Chebyshev polynomials on (-1. I). A more complete derivation is given in [61. The uses of (7) are that ak are given as inner products with g(x) itself; numerical integration proceeds over a finite range, and intuition concerning the sensitivity of the output spectrum to the input amplitude is obtained. From ((4), (6). or (7)) and (1) one estimates the worst-case aliasing cost for any configuration of the multirate framework. 3. APPROXIMATION FRAMEWORK Here practical solutions are given and results detailed concerning approximations within the multirate frarnewcork: Given a nonlinearity go(z), based on physical measurements or idealizations thereof, it is desired to approximate with g(z) such that aliasing is suppressed, subject to control property constraints. Goals are the threefold minimization of the costs: (a. Ijg(z) - go(x)I, where jj ( is any norm; b." { aTJ A(M,z )}; c.M.}. Commonly relevant control properties are: {a.Smatll-signaI gain equivalence: g'(0)= Ao; b. Monotonicity: g'(z) > 0 for z E So: g'(z) < 0 for z G S; c. Asymptote.s: "t g(z) = Lo; 'm g(z) = LI; d. Odd/even property: g(z) = g(-z), all z; etc....} Although many objectives and constraints are linear (advantage of (7)), the aliasing cost objective is not convex: direct optimization is unwieldy without further restriction. Fortunately, a simple construction is available for common cases of hard circuit nonlinearities; it satisfies relevant control properties by design, and is shown to effect substantial improvements in aliasing suppression. The idea is to design a variably soft nonlinearity; "softness" being a single parameter navigating the tradeoff between closeness to the ideal map and reduction of aliasing cost at fixed AM. The variably soft construction is introduced by example of the saturator from which others are simply obtained. The inverse map z = S;'t(y) is obtained, p E [1,oo] being an integer softness parameter. Let '~(y) be an odd function with -68 - ICMC Proceedings 1999

Page  00000069 Saturator Dead Zone Pulse Saturating Rectifier y = Sp,(X) 3/ = D,(z) v = Rp(z) v = x - Sp(Z) y=, y -1~ (Sp(z1'/21-S,(:4./2) Table 1. Construction for variably soft nonlinear maps N~oninearity Saturator Dead Zone Pulse Sa~turating Rectifier Graph (p = 2) Graph (p = 36) 1 cI1 1 1i 1 01 v 1.J01;0, (dB) vs. M (p = 2. 36) -50 -501 -50 Figure 4. Aliasing Cost vs. Computations Tradeoff Comparisons asymptotes ~rp(~.:) = (foo). An arbitriry number of derivatives are zeroed (decreasing softness) withont disturbing ',he odd-property or the asymptotes, by setting r 1,yZP7_(y). Finally the x-axis is sheared obtaining the correct irr~erse map: S= S, '(y) ~ y + y2py1(!,). The forward map is computed in a table by iterating N~ewton's method. Ta~ble 1 gives formulas for obtaining variably soft approximations for some circuit nonlinearities. Riesults and aliasing cost/computation curv~es are detailed in Fig. 4 for a sinusoidal input at frequency 1/8T8, amplitude 2.0, varying M from 1 to 16. using equations (1),(7) and 7p(y) = y/(l - y2P). it is apparent from Fig. 4 that the variably soft construction greatly reduces aliasing while maintaining eractly the re~levanrt control properties. For the saturator, when M = 5 there is a 22 dB gain in ASNR from p = 36 to p =2; for the pulse (commonly used to model the bow-string scattering junction; after (/I) the difference is 27 dB, increa~sing sharply to 70 dB wshen Ml = 14. 4. CON~CLIUSIONS3 A mnultirate framewaork for aliasing suppression is introduced along with a simple, "variably soft" construction for app~roximating ideal hard circuit nonlinearities such as to efficiently navigate the tradeoff between closeness to ideaiitv and aliasing cost. The variably soft construction explicitly incorporates control property constraints (e.g. s-mall-signal equivalence, monotonichty. asymptotes) which~ aim ~to preserve closed-loop response characteristics as opposed to merely the open-loop (snectral) propert~ies of the approldmation. REFE RENICES 1. M.E.Mcintyre, R.T.Schumachler. and J. Woodh~ouse, uOn the oscillations of musical instruments,".J. Acou~st. Soc. Am 74 (5), pp. 1325-1345, 1983. 2. P.P.Vaidyanathan, Mutt~irrxte Sy.~terri and Filterbank.,, Prentice Hall, Englew~ood Cliffs. NJ.J., 1993. 3. T. Stilson and J.O.Smith. "Analysis of the moog vcf with considerations for digital implementation2" ICMC-.96. (Honrg Kiong), 1996j. 4. ME.BSt~eer, P.J.K~han. and R.S.Tucker. "Relationship of volterra series and generalised powe~r series2" Proc. IEEE;i; pp. 14.52-1454, Dec. 1983. 5. R. Gray and J. Goodman, Fourtier Thrznuotrin, Kluwer Academic, Dordrecht, 1995. 6. H. Thorrburg. "Derivation: Harmonic analysis via pm-decomposition," urnpttbhjhed man~w.cmip, 1998. 7. JO0Smith, "D~iscret~e-time modeling of acoustic systems with applications to sound synthesis of musical instrurnerrts,' Proc. Nord. ACoZUst. Meeting, (Helsinki), 1996. ICMVC Proceedings 1999 69 69 -