Modeling to Produce music Juan Manuel Agudo Carrizo (UE2526361)
Digital Signal Processing Design Project
1. Digital Waveguide Modeling
For my project I have decided to model an acoustic guitar. Following the steps of : " Smith, Julius O. Digital Waveguide Modeling of Musical Instruments http://www-ccrma.stanford.edu/~jos/waveguide/".
The computer works in a discrete way, not in a continuous one, that means that it works with numbers, that we keep in vectors.
To make sounds we need a signal that in this case is a vector with a lot of numbers, that vector must contain the sound.
The sound is a vibration, a wave that we see in a sinusoidal way.
In the vector we keep the values of the signal. An analogy to understand this matter would be to visualize it this way: A string that is moving itself, vibrating, and in a certain moment we take a picture of it. When the string is not moving we say it has a zero value, while it is moving from left to right it is getting values, the ones we measure in the middle of the string from the point where it is quite. It biggest elongation will be 1 (to the right) and -1 (to the left):
As the movement is a vibration, I have to keep these values each certain time interval, it would be like taking pictures of my wave each second, now is when the concept of "sample frequency" receives a meaning.
The sample frequency "fs" is the quantity of samples (pictures in my analogy) that are taken in one second.
Now, we model the vibration of a string using a digital waveguide. "Two delay lines represent two travelling waves moving in opposite directions. By summing the values at a certain location along the delay lines at every time step, we obtain a waveform. This waveform is the sound heard with the pickup point placed at that relative location. The delay elements are initialized with a shape corresponding to the initial displacement of the string. For simplicity a triangular wave is used even though in reality the initial displacement of a plucked string will not be shaped exactly like a triangle. Simply using two delay lines in this fashion would require arbitrarily long delay lines depending on the length of the desired output. By feeding the delay lines into each other a system can be created that can run for an arbitrary amount of time using fixed size delay elements.
Digital waveguide with initial conditions of delay lines set to triangular waves.
In modeling a guitar it is important to note that the ends of the string are rigidly terminated, so the waves reflect at either end of the string. This effect can be modelled by negating each sample after it reaches the end of a delay line, before feeding it into the next delay line, as shown in Figure 1. Finally, we must add an attenuation factor. Without the attenuation factor, the model described up until now results in ideal string vibration that never decays. In the real world, due to friction and air resistance, the amplitude of the string vibrations decay over time, so it...