Passive nonlinear filter for digital musical sound synthesizer and method

A music synthesizer includes main resonator, such as a digital waveguide network, that is coupled to a digital passive nonlinear filter. The passive nonlinear filter receives traveling wave signals from the resonator and generates modified traveling wave signals having a different frequency spectrum than the received traveling wave signals without changing the received traveling wave signals' energy content. The passive nonlinear filter then transmits the modified traveling wave signals back into the resonator. The passive nonlinear filter includes a first memory element for retaining an internal energy state and a dual-mode signal generator that generates the modified traveling wave signal from the received signals and the internal energy state using a first signal processing method when the internal energy state has a negative value and using a second distinct signal processing method when the internal energy state has a positive value. The dual-mode signal generator preferably includes a two-level amplifier that multiplies the internal energy state by a first coefficient when the internal energy state has a negative value and by a second distinct coefficient when the internal energy state has a positive value so as to generate an adjustment signal. A first signal combiner combines the received signals with the adjustment signal so as to generate a next value of the internal energy state, and a second signal combiner combines the adjustment signal and the retained internal energy state to generate the modified traveling wave signal that is transmitted into the resonator.

The present invention relates generally to musical sound synthesizers using 
digital circuitry or computers, and particularly to an energy-conserving, 
passive nonlinear filter and filtering technique for shifting or spreading 
spectral energy so as to generate a certain class of sound effects 
associated with gongs, cymbals and other acoustic percussion instruments. 
BACKGROUND OF THE INVENTION 
It is well known that nonlinearities, small or large, favorably affect the 
sounds of many musical instruments. In Chinese gongs or tamtams and in 
cymbals, nonlinearities cause the transfer of energy from lower frequency 
modes of vibration to higher frequency modes of vibration after the 
instrument has been struck. In this process, the nonlinearities transfer 
energy from vibrations of one frequency to vibrations of another 
frequency. Their role is "passive" in that they do not generate energy, 
they only transfer it. 
While nonlinearities such as square law nonlinearities can be incorporated 
in the computer generation of sounds, conventional computer processes for 
incorporating nonlinearities in synthesized sounds result in the 
generation of high frequency energy. In endeavoring to add high frequency 
energy, the process of sound generation becomes unstable, and useless 
signals of high amplitude are generated, which then must be suppressed by 
various filtering and numerical signal processes. 
The present invention is based on these observations, and the discovery of 
some digital signal processing techniques which passively spread energy in 
a manner that mimics the frequency spreading in cymbals and Chinese gongs. 
SUMMARY OF THE INVENTION 
The present invention is a music synthesizer having a main resonator 
waveguide network (e.g., a loop or mesh) that is coupled to a digital 
passive nonlinear filter. The passive nonlinear filter receives traveling 
wave signals propagating in the resonant network and passively modifies 
those received signals so as to generate modified traveling wave signals 
having a different frequency spectrum than the received traveling wave 
signals without changing the received traveling wave signals' energy 
content. The passive nonlinear filter then transmits the modified 
traveling wave signals back into the resonator. 
The passive nonlinear filter includes a first memory element for retaining 
an internal energy state and a dual-mode signal generator that generates 
the modified traveling wave signal from the received signals and the 
internal energy state using a first signal processing method when the 
internal energy state has a negative value and using a second distinct 
signal processing method when the internal energy state has a positive 
value. 
In the preferred embodiment the passive nonlinear filter's dual-mode signal 
generator has a two-level attenuator/amplifier that multiplies the 
internal energy state by a first coefficient when the internal energy 
state has a negative value and by a second distinct coefficient when the 
internal energy state has a positive value so as to generate an adjustment 
signal. A first signal combiner in the passive nonlinear filter combines 
the received signals with the adjustment signal so as to generate a next 
value of the internal energy state, and a second signal combiner that 
combines the adjustment signal and the retained internal energy state to 
generate the modified traveling wave signal that is transmitted into the 
resonator.

DESCRIPTION OF THE PREFERRED EMBODIMENT 
Referring to FIG. 1, there is shown a music synthesizer 100 in which a 
passive nonlinear filter (PNF) 102 is coupled to a digital waveguide 
resonator 104. The PNF 102 and the resonator 104 together simulate the 
acoustic sound generation of a cymbal or Chinese gong, or any other 
musical instrument with nonlinear energy exchange between or among 
frequency modes. The operation of music synthesizer 100 is controlled by a 
controller 130, typically a microprocessor such as those found in Yamaha 
synthesizers or the microprocessors found in desktop computers. The 
controller 130 receives commands from a user interface 150 that typically 
includes command input devices such as a set of function buttons, vibrato 
and other control wheels, a keyboard for specifying tones or notes to be 
generated, as well as output devices such as an LCD display and other 
visual feedback output devises that confirm user commands and inform the 
user of the state of the synthesizer. In most implementations, the user 
interface 150 can be coupled to a computer so as to receive MIDI commands, 
pitch values and the like from a computer. 
The controller 130 includes a resonator setup program that generates 
control parameters for the main resonator, such as delay line lengths for 
the resonator's delay lines 152, scattering junction and termination 
junction parameters that determine the resonating properties of the 
resonator 104, and the gain constant G1 of the resonator's output 
amplifier 154. Similarly, a PNF setup program sets the PNF's control 
parameters, which are the two spring constants associated with the PNF 
102. Music synthesis by the system 100 is performed under the control of 
resonator and PNF execution programs executed by the controller 130. The 
signals output by the resonator are converted from digital form to an 
analog voltage by a digital to analog converter 156, are amplified by the 
output amplifier 154 and then transmitted to one or more speakers 158 so 
as to generate audible sounds. 
In the preferred embodiment, all signals or waveforms in the synthesizer 
are updated at a rate of 44,100 samples per second. For simplicity, in the 
equations in this document, time is represented by a variable n which 
starts at a value of zero at is incremented by one each sample period. 
Thus, after one second n will have a value of 44,100. Since the sampling 
rate of the preferred embodiment is 44,100 samples per second, the output 
signal generated by the synthesizer can have frequency components up to 
approximately 22 kHz. 
The resonator 104 can be any arbitrary resonant digital system, and thus 
can be a one-dimensional oscillator loop, a two-dimensional mesh of 
digital waveguides, or any other resonator subsystem. As shown in FIG. 2, 
a plurality of passive nonlinear filters 102-1, 102-2 can be coupled to a 
resonator 104. For instance, each PNF 102 can be assigned different 
coefficients so as to affect signals in different regions of the frequency 
spectrum. 
The PNF 102 is essentially a first-order allpass filter with a time-varying 
coefficient. In practice, the PNF 102 is intended to be attached at the 
termination of a waveguide, or inserted at any other point in a resonant 
system where traveling wave propagation is being computed. Its purpose is 
to introduce a controllable energy spreading into the resonant modes of a 
feedback system without risking system instability or unwanted energy 
loss. This is otherwise impossible in a wholly linear system. 
The PNF 102 is particularly useful, if not essential, for the construction 
of fine gong and cymbal sounds using a two-dimensional digital waveguide 
mesh, although its usefulness is not limited to this application. 
Theory of Operation 
Consider a passive nonlinear physical mass/spring oscillator as shown in 
FIG. 3A. In this system, the springs are taken to be at rest when the mass 
is at displacement zero, touching both springs, but feeling no force from 
either spring. When the mass is at a positive displacement, it is feeling 
force from the upper spring with stiffness constant k.sub.1 ; when it is 
at negative displacement, it is feeling force from the lower spring with 
stiffness constant k.sub.2. 
Note that the resultant oscillation is clearly periodic, but that the upper 
half of the cycle is at a different frequency and has a different maximum 
displacement than the lower half of the cycle. When k.sub.1 and k.sub.2 
are nearly equal, but different, this nonlinear oscillator has an 
essentially sinusoidal response, but with a rolling-off set of harmonic 
overtones due to the slight discontinuity in the displacement velocity 
occurring at displacement zero-crossings. 
By replacing the mass in FIG. 3A by the end of a string having a wave 
impedance of R.sub.0, we arrive at the structure shown in FIG. 3B. Three 
states of the system are shown in FIG. 3B: first, the lower spring is 
compressed, while the upper spring is at rest; second, both springs are at 
rest; and, third, the upper spring is compressed, while the lower spring 
is at rest. In effect, the spring termination gadget of FIG. 3B is 
equivalent to a single nonlinear spring whose stiffness constant is 
k.sub.1 when the displacement is positive and k.sub.2 when the 
displacement is negative. 
Now consider what is happening to the energy in the system given in FIG. 
3B. When the lower spring is compressed, some energy from the string is 
converted to potential energy stored in the spring. When the lower spring 
returns to its rest state, the stored spring energy is entirely returned 
to the string, and the spring contains no stored energy. When the upper 
spring is then compressed, exactly the same kind of energy exchange 
occurs. 
If the spring stiffness constant had changed while stored potential energy 
was still in the spring, the stored energy would be scaled by the new 
relative stiffness of the spring. In this case, the stored energy before 
the stiffness change would be different than the stored energy after the 
stiffness change, leading to the creation or loss of energy, possibly 
resulting in a non-passive system. 
The passive nonlinear filter was originally conceived in the electrical 
domain, as shown in FIG. 4. The nonlinear spring termination of a string 
is mathematically equivalent to a transmission line terminated by two 
capacitors connected in parallel, with each capacitor connected in series 
with ideal switches allowing current to pass depending on the sign of the 
voltage across them. Here, the electrical characteristic impedance, 
Z.sub.0, replaces the mechanical wave impedance of the string, R.sub.0 ; 
voltage, v, replaces mechanical force, f; and current, i, replaces 
mechanical displacement velocity, v. 
The force equation for the ideal linear spring shown in FIG. 5 is, 
EQU f(t)=k x(t).fwdarw.df(t)/dt=kv(t) (1) 
where f(t) is the force applied on the spring, x(t) is the compression 
distance of the spring, v(t) is the velocity of compression, and k is the 
spring stiffness constant. x(t) is taken to be zero at rest, negative for 
compression and positive for stretching. 
Taking the Laplace transform, and assuming no initial force on the spring, 
i.e., f(0)=0, we get, 
EQU F(s)=(k/s) V(s) (2) 
Here, k/s is the lumped impedance of the spring. Setting s=j.omega. gives 
the frequency response of this system. 
The traveling wave solution to the ideal lossless vibrating string equation 
is based on the fact that velocity and force at any point on the string 
may be decomposed into left- and right-going traveling waves, 
EQU V(s)=V.sub.r (s)+V.sub.l (s) (3) 
EQU F(s)=F.sub.r (s)+F.sub.l (s) (4) 
where V.sub.r and F.sub.r represent right-going waves on the string, and 
V.sub.l and F.sub.l represent left-going waves on the string. In addition, 
there is an impedance relation between force and velocity waves traveling 
in the same direction, 
##EQU1## 
where R.sub.0 is a positive real number representing the wave impedance of 
the ideal lossless string which is dependent on both the tension and mass 
density of the string. 
A string terminated with a spring is shown in FIG. 6. We may now make the 
change of variables from F and V to F.sub.l and F.sub.r in the spring 
termination system equation using Equations (3), (4), and (5) to compute a 
force wave transfer function from F.sub.r to F.sub.l. 
EQU F(s)=(k/s) V(s) (6) 
EQU F.sub.r (s)+F.sub.l (s)=(k/s){F.sub.r (s)-F.sub.l (s)}/R.sub.0 (7) 
EQU F.sub.l (s)=({k/s-R.sub.0 }/{k/s+R.sub.0 })F.sub.r (s) (8) 
This gives us a transfer function from the right-going force wave (into the 
spring) to the left-going force wave (out of the spring). The transfer 
function is stable allpass since its pole is at s=-k/R.sub.0 and its zero 
is s=k/R.sub.0, where k and R.sub.0 are defined to be positive real 
numbers. 
Next, we apply the bilinear transform, 
EQU s.rarw..alpha.(1-z.sup.-1)/(1+z.sup.-1) (9) 
to map from continuous time to discrete time without aliasing to obtain, 
EQU F.sub.l (z)=H(z)F.sub.r (z) (10) 
where, 
EQU H(z)=(a.sub.0 +z.sup.-1)/(1+a.sub.0 z.sup.-1), with a.sub.0 
=(k-.alpha.R.sub.0)/(k+.alpha.R.sub.0) (11) 
a.sub.0 ranges from -1 to 1 as k ranges from 0 to .infin.. .alpha. is a 
degree of freedom in the bilinear transform allowing some control over the 
nature of the frequency warping in moving from continuous time to discrete 
time. 
By a similar derivation, we may obtain the equivalent velocity wave 
transfer function, 
EQU V.sub.l (z)=-H(z)V.sub.r (z) (12) 
FIG. 7 shows a system diagram of the spring termination, H(z), using the 
force wave construction given in Equations 10 and 11. The time domain 
operation of the allpass filter of FIG. 7 is computed during each time 
period n, as follows: 
EQU u(n)=f.sub.r (n)-a.sub.0 u(n-1) 
EQU f.sub.l (n)=a.sub.0 u(n)+u(n-1) 
Since the filter coefficient, a.sub.0, represents the relative spring 
stiffness, we need only change a.sub.0 to effect a change in the stiffness 
of the spring termination. We must, however, effect the change at the 
right time to preserve digital passivity. 
Referring to FIG. 7, consider the case where the input signal to the filter 
is always zero, f.sub.r (n)=0, but where there is some internal state 
value, namely, let u(-1)=u.sub.0. Since, we see from the system diagram, 
##EQU2## 
the filter output signal, which is attributable solely to the internal 
filter energy state ringing out, can be represented as follows: 
##EQU3## 
If we change the filter coefficient, a.sub.0, it is clear that the 
internal state energy will ring out of the filter with a different decay 
rate than if the coefficient had not been changed. Such coefficient 
changes, if made arbitrarily, may lead to instability in a feedback loop. 
However, if u.sub.0 is zero or near zero, we can change the coefficient 
with relative impunity, since the resultant discontinuity in the state 
energy will be minimal or zero. Therefore, in accordance with the present 
invention, we choose to gate the filter coefficient change on the sign of 
u(n), to maintain passivity in the nonlinear allpass filter. 
FIG. 8 depicts a preferred embodiment of a passive nonlinear filter 102 
coupled to a digital waveguide resonator 104. The PNF 102 receives a 
signal f.sub.r (n) from the resonator 104. The PNF includes two memory 
elements in the form of unit delay elements 170, 172. Delay element 170 
stores the value a.sub.0 (n)u(n) for one time period, and outputs the 
value a.sub.0 (n-1)u(n-1). Note that the filter coefficient a.sub.0 is now 
time varying and thus has an associated time index. Delay element 172 
stores the internal energy state value u(n) for one time period, and 
outputs the value u(n-1). 
Adder 174 generates the internal energy state value u(n) by subtracting the 
output of delay element 170 from the received signal, f.sub.r (n), as 
follows: u(n)=f.sub.r (n)-a.sub.0 (n-1)u(n-1). 
Decision logic 176 determines the sign of the internal energy state u(n) 
and sets a.sub.0 (n) equal to a.sub.1 when u(n) is less than zero, and 
otherwise (i.e., when u(n) is greater than or equal to zero) sets a.sub.0 
(n) equal to a.sub.2. Multiplier 178 then multiplies the current value of 
the internal energy state u(n) by the current value of a.sub.0 (n) to 
generate a.sub.0 (n)u(n). Finally, adder 180 generates output signal 
f.sub.l (n) by adding the output u(n-1) of delay element 172 with the 
value generated by multiplier 178: f.sub.l (n)=u(n-1)+a.sub.0 (n)u(n). 
From the allpass filter implementation in FIG. 7, we may observe that, 
EQU f.sub.l (n)=a.sub.0 u(n)+u(n-1) (19) 
Also we have, 
EQU u(n)=f.sub.r (n)-a.sub.0 u(n-1).fwdarw.f.sub.r (n)=u(n)+a.sub.0 u(n-1) (20) 
Since, the actual physical force applied to the spring termination is equal 
to the sum of the input and output force waves, as defined in Equation 
(4), we may derive an expression of the actual force on the spring, f(n), 
from (19) and (20), 
##EQU4## 
Equation (23) indicates that the actual physical force on the spring is 
proportional to a linearly interpolated value of signal u at time n-0.5. 
From Equation (1), displacement of the spring termination is zero when 
force is zero, and f(n) is zero when u(n)+u(n-1) is zero. Therefore, when 
u changes sign between times n-1 and n, the spring displacement is closest 
to zero. This is the physically correct time to let the spring stiffness 
coefficient change for the nonlinear spring termination system given in 
FIG. 3B. 
Why the PNF Works from a Phase Modulation Perspective 
We have observed that the PNF is essentially a one-pole allpass filter with 
a time-varying coefficient. We may study the effects of the PNF in a 
feedback loop by studying the effects of coefficient-variation on a 
one-pole allpass filter. We, first, consider how the phase response of 
such a filter depends on its coefficient, then, how sinusoidal variation 
of that coefficient generates sidebands in the output signal. From there, 
we will see how the sort of time-variation defined in the PNF structure 
will generate a desirable energy spreading in a feedback loop. 
Consider the force wave transfer function given in Equation (11). This is a 
one-pole allpass filter. Its gain is unity and, in general, its phase 
response, .angle.H(e.sup.j.omega.), decreases monotonically from 0 to 
-.pi./2 as .omega. goes from 0 (DC) to .pi. (Nyquist frequency). FIG. 9 
shows several overlaid phase response plots for this filter with different 
coefficient values, a.sub.0 ranging from -0.8 to 0.8. 
Now, consider two allpass filters, H.sub.1 (z) and H.sub.2 (z) which have 
two different coefficients, a.sub.1 and a.sub.2, respectively. Let 
EQU a.sub.1 =a.sub.center +.DELTA.a/2 
EQU and 
EQU a.sub.2 =a.sub.center -.DELTA.a/2, 
where a.sub.center is the center of variation (a.sub.center =(a.sub.1 
+a.sub.2)/2), and .DELTA.a is the maximum deviation (.DELTA.a=a.sub.2 
-a.sub.1). 
FIG. 10 shows the difference in phase responses of the two filters, 
.angle.H.sub.1 (e.sup.j.omega.)-.angle.H.sub.2 (e.sup.j.omega.), for a 
series of coefficient pairs generated by letting a.sub.center range from 
-0.8 to 0.8, and holding .DELTA.a constant at 0.3. What the plot shows is 
that a.sub.center determines which region of the spectrum has the greatest 
phase response variation for a given .DELTA.a. 
FIG. 11 shows the phase response difference for a series of coefficient 
pairs generated by holding a.sub.center constant at -0.5 and letting 
.DELTA.a range from 0.1 to 0.6. This plot shows how .DELTA.a determines 
the amount of phase response variation for a given a.sub.center. 
Sinusoidal Variation of the Coefficient 
If we drive the one-pole allpass filter, H(z), with a sinusold of frequency 
f.sub.1, and vary the coefficient, a.sub.0, sinusoidally at frequency 
f.sub.2 around some center value, a.sub.center, with deviation .DELTA.a, 
we should expect the filter to apply a quasi-sinusoidal phase modulation 
to the input signal due to the phase response variation predicted in the 
preceding paragraphs. The resultant output signal of the filter should 
contain sidebands around the driving frequency, f.sub.1, separated by the 
coefficient modulating frequency, f.sub.2. Furthermore, the deviation, 
.DELTA.a, should determine the "index" of modulation, in the FM sense, and 
thus, the amount of energy in the sidebands. FIG. 12 shows the magnitude 
response on a dB scale of H(z), with sinusoidally varying coefficient, 
a.sub.0 (n)=-0.7-cos(2.pi.f.sub.2 nT), driven by an input sinusoid, 
cos(2.pi.f.sub.1 nT), where f.sub.1 =8000 Hz, f.sub.2 =2000 Hz, and the 
sampling interval, T=1/44,100 seconds. FIG. 12 verifies that the filter 
output is very near to the predicted phase modulation, containing a set of 
sidebands of the form, cos(2.pi.f.sub.1 T.+-.k 2.pi.f.sub.2 T). 
Step Variation of the Coefficient 
In general, if we flip the coefficient of a one-pole allpass filter between 
two values periodically, the coefficient signal, a.sub.0 (n), is then a 
square wave with a spectrum containing rolling-off odd harmonics. The 
output signal spectrum produced by this kind of coefficient modulation 
will contain greater emphasis in the odd sidebands than a simple 
sinusoidally modulated filter, due to the odd harmonics in the coefficient 
modulation signal. 
For coupling to occur in the resonant system, the sidebands produced by the 
modulated allpass filter must fall on supported modes of the system. When 
a sideband coincides with a supported mode, that mode will be driven by 
the energy in the appropriate sideband. Energy from sidebands which do not 
fall on supported modes will not drive any particular mode and will simply 
be absorbed back into the system. 
In the PNF filter of FIG. 8, we choose to gate the coefficient selection on 
the state signal u(n). Since the coefficient signal will have the same 
effective fundamental as the driving input signal, we can expect the 
resultant sidebands to fall on multiples of the effective fundamental of 
the input signal, thereby driving at least some supported modes of the 
system. The PNF sidebands are, therefore, tuned exactly right for energy 
spreading to occur into nearby system modes. 
FIG. 13 shows the gradual spreading out of spectral energy of a waveguide 
resonator system terminated with a PNF. 
While the present invention has been described with reference to a few 
specific embodiments, the description is illustrative of the invention and 
is not to be construed as limiting the invention. Various modifications 
may occur to those skilled in the art without departing from the true 
spirit and scope of the invention as defined by the appended claims.