96 kHz.org
Advanced Audio Recording

digital wave guide oscillator

Digital wave generation can easily by done with a so called wave guide oscillator. The method has first been introduced for music generation by Karplus & Strong in 1984. The common arbitrary wave form generation from memories we know from DDS and industrial applications was simply extended by a feedback to generate a looped sound whereby an additional damping filter treats the harmonics in loop over the time. By simply inserting a low pass filter, the high frequencies initially introduced are damped that way that a guitar like sound is obtained. Read more about this invention here KPA.

 

example of wave stages

digital wave guide generator - JS 2003

The circuit above uses a 6dB-IIR-Filter in the feedback loop and is initially fed with a non ideal signal by intention which contains harsh harmonics which do not meet the RAM length at all. It though produces a very effective sound which suddenly is squeezed into the grid defined by the RAM and comes more and more close to an ideal sine wave because the formerly included harmonic components disappear after some time in a strait forward way.

However a sine wave is maybe not the ulttimate conclusion regarding a music sound, so the circuit may be extented with some more features:

overcoming KP

Although the KPA is an intelligent solution in itself with regard to the use of RAM resources, it is musically limited in its original form. It also does not really match the real behavior of the guitar. Its sound is characterized, among other things, by the fact that a certain residual life remains in the sound, which is characterized by beats and harmonics, which do not fit perfectly to the string length, but have a dynamic phase behavior compared to the fundamental wave. Practically one finds the third harmonic a bit different from the ideal mathematical value. Both can be easily achieved by defining an additional tap in the RAM which generates a harmonic of a suitable frequency which is fed into the mix.
 

digital wave guide generator - JS 2002

 In this example 128 Taps are used using around a third of it to fed the signal back. Since 43 is not precisely 1/3 phase beating will occur. This method does not only simply distribute the energy of the system towards lower frequencies, as it is usual with the KPA - but it also supports the most important harmonic to a certain extent, as the guitar actually does in reality.

The signal chart below shows the resulting waves when feeding a signal into the RAMs which meets somehow the physical elongantion of string: 
 

 

digital wave guide generator with guitar emphasis

 

As one can see from the pictures, the third harmonic remains and "flows" constantly against the fundamental due to a small offset in frequency. The effect continues when other settings and taps are used. With certain instruments, other overtones can also come to the fore. A variety of such modifications are conceivable here, so I suggest playing around a little with additional settings for RAM access and also the frequency emphasis in the attenuating filter in order to extend the classic KPA.

 As a nice side effect, the patent is not infringed when the sounds are published :-)

 

More harmonics

Continuing this idea, additional access points can be added to the RAM to emphasize very specific overtones that may exist on a string: :

digital wave guide generator with more harmonics - JS 2002

To be able to tune the frequency in detail an interpolation filter might be added using the dedicated sample and 2 of its neighbours. In this way lower and higher frequencies can be achieved to be fed back into the RAM loop. In the example a above 120+1 Taps are used to be able to devide by 2,3,4 and 5 easily. TAP 121 is required to provide a sample which allows interpolation with 100% of the period.

Typical feedback settings for the inner loops should be in the range of some % only, because they are applied more often than the value from the outer loop! It also has to be made sure that the overall feedback still contains some attenuation since the circuit becomes instable otherwise.

Conclusion and Summary

 Modified wave guide algorithms can be used in various ways to produce music sounds similar to KP's algorithm.

 

Read more about the KP-Algorithm

 

© 2002 - Dipl.-Ing. Jürgen Schuhmacher