# Advantages of the Karplus algorithm for sound synthesis

For a personal project I am trying to make a software to synthesize plucked and hammered string instruments. This is a whole research topic and there are already some models and algorithms such as the Karplus. I have thought a parallel way of solving the problem but I am trying to see whats wrong with it compared to existing models. I have physics knowledge in other fields so I am kind of new to signal processing.

Lets start with a guitar for instance, we can summarize the physics of the sound of this instrument in the next points:

• We pluck the string (initial string shape)
• The string vibrates and transmits the vibration to the soundboard
• The soundboard transmits the vibration to the air (air inside instrument and whole room)
• The sound is captured by a microphone with a certain frequency response at a certain position and orientation with respect to the instrument and room.

I assume that if we were to excite a certain string of the guitar at a pure frequency $$e^{j\omega}$$ (not necessarily the fundamental frequency), the whole instrument, room and microphone will vibrate at the same frequency and thus the mic will detect a signal $$A(\omega)~e^{j\omega}$$, where $$A(\omega)$$ is the phase and amplitude that accounts for all resonances of the instrument, room, phases, delays, distance decay of the amplitude, etc. By testing all frequencies we could store the function $$A(\omega)$$ for all $$\omega$$. So if the string were to vibrate in any way, we could do Fourier analysis on this movement at the end of the string, to then apply this "filter" $$A(\omega)$$ and infer the signal detected by the microphone.

On the other hand, we can assume a model for the physics of the string attached to fixed ends $$y(x, t)$$ that accounts for frequency dependent losses. These models predict infinite vibration modes that can be written as $$y_{n}(x, t) = \sin(\frac{n~\pi~x}{L})~e^{-\frac{t}{t_{0n}}}~e^{+-j~\omega_{n}~t}$$. The $$\omega_{n}$$ values are the actual frequencies of the harmonics (not necessarily multiples of the fundamental frequency, but slightly different values), and $$t_{0n}$$ are the time decay of the nth harmonic. By plucking the string, we excite these infinite modes at different amplitudes $$a_{n}$$, so we can think that the string vibrates in the frequencies of the Fourier transform of all the harmonics $$a_{n}~y_{n}(t)$$. Ta-da! given the we know the frequency response of the whole system $$A(\omega)$$ we can then infer the microphone signal. In this way, we only need the values of $$a_{n}$$, $$t_{0n}$$, $$w_{n}$$ and $$A(\omega)$$ to synthesize a sound.

However, as I understand, the Karplus algorithm assumes an explicit derivation of the full string wave, with two traveling waves to both directions. It then adds some filters that also account for the soundboard response and gets the output. The problem is that it involves a finite differences approach to solve the string differential equation, which I believe is extremely computationally expensive.

I think the model presented before is straightforward, but it doesn't seem to be used by anyone. Do you know what I am missing? I hope my explanation was clear.

• I think perhaps the main issue is that the model is too simplistic. Actually, what happens is that you don’t excite a single tone, but a wave packet (hopefully narrow in frequency). Different instruments have the same tone sound differently due to the shape of this packet, and due to the phase information which you completely disregard. Another issue is that your model is in continuous time, but your synthesis is in discrete time. There is a world of caveats for you to discover when crossing the boundary between these worlds. Enjoy the journey! May 20 at 6:55