# The Wave Digital Piano Hammer

In this section, we use a model of the piano hammer to introduce wave digital filtering techniques. This approach to modeling the piano hammer was developed by Scott Van Duyne, John Pierce, and Julius Smith and reported in Traveling wave implementation of a lossless mode-coupling filter and the wave digital hammer,'' Proceedings of the International Computer Music Conference, Århus, Denmark, 1994.

## The Hammer Model

• The piano hammer, or a felt mallet, can be modeled as a non-linear spring and mass system.

• The spring represents the felt portion of the hammer or mallet and its compliance is considered to vary with felt compression. In this way, the felt is modeled as a non-linear spring with a stiffness constant'' that increases as it is compressed.

• First consider a linear mass and spring system as shown in Fig. 11. The mass is assumed to have an initial velocity at time zero.

• Since the mass and spring are in parallel, the driving force applied on the left side of the spring, f, is equally applied to the spring and to the mass:

f = fk = fm.

• The driving point velocity, v, is equal to the sum of the spring compression velocity and the mass velocity,

v = vk + vm.

• By Hooke's law, the restoring force of the spring is given by

where x(t) is the compression distance of the spring and k is the spring stiffness constant.

• By Newton's law, the force of the mass is

where represents an initial momentum impulse setting the mass in motion with velocity v0.

• Both of these force equations can be expressed in terms of their Laplace transforms and written as a driving-point admittance:

The admittance function, (s2 + k / m) / k s, is the steady-state response of the system with zeros at . The v0 / s term represents the transient effect of the momentum impulse applied at time zero.

## Traveling-Wave Decomposition of the Lumped System

• The lumped driving-point admittance of the mass-spring system can be defined in terms of wave variables in a manner analogous to distributed systems.

• An applied force can be written as , where is viewed as a force wave traveling into the admittance and is viewed as a force wave traveling out of the admittance.

• In a similar way, we can define .

• In distributed systems, waves have a finite propagation speed and force and velocity wave components can be related by a wave impedance, which is defined by the parameters of the medium of travel.

• In lumped systems, however, traveling waves may only be understood to travel instantaneously and there is no particular medium. But an arbitrary reference impedance, Rh, can still be defined such that:

• Making this change of variables, the velocity transfer function can be written

• Using the bilinear transform to convert from a continuous-time system to a discrete-time system, we obtain

where the continuous-time impulse function mapping has been bandlimited as and the coefficients are defined as

• Because the reference impedance Rh is arbitrary, it is possible to choose a value such that the coefficient b0 = 0, as

• In this way, a unit of delay can be factored out of the second-order transfer function, such that

where

with a0 given by

• It is then possible to rewrite Rh in terms of a0, eliminating k, as

## The Scattering Junction Connection

• A piano hammer strikes the string and then remains in contact with it for a certain time duration (before being thrown off by forces propagating in the string).

• During the time the hammer is in contact with the string, the string is loaded'' by the hammer impedance and wave scattering occurs.

• A lossless three-port scattering junction, as shown in Fig. 13, can be developed that defines the energy transfer between the hammer and the two sections of string.

• At the junction, the velocities of the string sections and the hammer spring must all be equal,

• In addition, the sum of the forces at the junction must be zero, since it is a massless point,

• Using these expressions and the previous wave variable definitions, the scattering equations become:

## Making the Felt Nonlinear

• As originally discussed, the felt is modeled as a nonlinear spring with a spring constant'' that increases as the compression of the spring increases. In this way, the spring stiffness constant k(xk) is dependent on xk.

• Because xk = fk/k and because the driving-point force on the mass and spring system is equal to fk, we can write

• The above expression can then be written in terms of a0 as

• At any time in the model, the value of xk can be used to lookup or determine an appropriate value for the spring constant k.

## The Lossless Digital Model

• The resulting system of equations can be combined as shown in the block diagram of Fig. 14.

• S is the three-port scattering junction.

• H is a time-varying allpass filter.

• G is the modified integrator that integrates the incoming initial hammer velocity impulse signal, vI[n], taking into account the wave decomposition and the nonlinear effects of the hammer felt.

• X computes the actual felt compression, taking advantage of the fact that the force of compression on the felt is instantaneously proportional to the felt compression.

• K is a look-up table for the stiffness coefficient, a0[n], indexed by felt compression.

• R computes the time-varying wave impedance of the hammer system from a0.

• Rh[n] = 0 when the hammer is not touching the string and k(xk) = 0 as well, so the string equations are then not affected by the hammer system.