(created page)
 
Line 9: Line 9:
 
The Karplus-Strong algorithm uses a noise burst as an initial condition, a filter of the designer's choice, and a positive feedback loop to produce a signal that sounds similar to a note being played on a guitar:
 
The Karplus-Strong algorithm uses a noise burst as an initial condition, a filter of the designer's choice, and a positive feedback loop to produce a signal that sounds similar to a note being played on a guitar:
 
* Initial Condition: The initial input to the algorithm is a signal with length L. This corresponds to the input of energy when a guitar string is plucked. The examples at the bottom of the article show what happens to the output when random white noise, a cycle of a sawtooth wave, and a cycle of a square wave are chosen as the initial condition for the algorithm.
 
* Initial Condition: The initial input to the algorithm is a signal with length L. This corresponds to the input of energy when a guitar string is plucked. The examples at the bottom of the article show what happens to the output when random white noise, a cycle of a sawtooth wave, and a cycle of a square wave are chosen as the initial condition for the algorithm.
* The Filter: The filter is another design decision that can be chosen. This corresponds to the atmosphere and friction acting to reduce energy from the string. Depending on the characteristics of the chosen filter, you can model more energy being taken from the lower frequencies on the string, or more energy being taken from the higher frequencies on the string. The examples at the bottom of the article show what happens to the output when 2 different low-pass filters are chosen: a simple averaging filter and a rect filter.
+
* The Filter: The filter is another design decision that can be chosen. This corresponds to the atmosphere and friction acting to reduce energy from the string. Depending on the characteristics of the chosen filter, you can model more energy being taken from the lower frequencies on the string, or more energy being taken from the higher frequencies on the string. The examples at the bottom of the article show what happens to the output when a simple averaging filter is applied.
* The Feedback Loop:
+
* The Feedback Loop: The feedback loop aspect of the algorithm is what puts all the pieces together to form the sound. The processed input is fed back into the loop to create the output signal. We didn't explicitly cover the stability of a feedback loop in 438, but it is still important to know that for this loop, the gain of the filter has to be less than 1 for any given input, for the entire system to remain stable. So, the frequency response of the filter from the previous bullet point should be less than 1 for any given frequency, to ensure the system is a stable positive feedback system.
  
[to be completed later]
+
The output signal from this process will be a varied and random disturbance that gradually smooths out, which is a reasonably simple model of a plucked string. Here are some examples of the algorithm at work:
+
  
  
 +
Example 1
 +
 +
Example 2
 +
 +
Example 3
 +
  
<math>f_s = \frac{1}{T_s}</math>
+
Sources/Extra Info:
 +
https://en.wikipedia.org/wiki/Karplus%E2%80%93Strong_string_synthesis
 +
https://ccrma.stanford.edu/~jos/pasp/Karplus_Strong_Algorithm.html
 +
http://sites.music.columbia.edu/cmc/MusicAndComputers/chapter4/04_09.php

Revision as of 23:00, 1 December 2019

Modeling the sound of an acoustic guitar using the Karplus-Strong algorithm


Introduction/Theory:

We spent some time in lecture modeling speech by analyzing a simplified physical model and deriving the corresponding transfer function. The same thing can be done for other types of sounds, both more complex and less complex than speech. The sound of a plucked string on a guitar is one such sound.

The Karplus-Strong algorithm uses a noise burst as an initial condition, a filter of the designer's choice, and a positive feedback loop to produce a signal that sounds similar to a note being played on a guitar:

  • Initial Condition: The initial input to the algorithm is a signal with length L. This corresponds to the input of energy when a guitar string is plucked. The examples at the bottom of the article show what happens to the output when random white noise, a cycle of a sawtooth wave, and a cycle of a square wave are chosen as the initial condition for the algorithm.
  • The Filter: The filter is another design decision that can be chosen. This corresponds to the atmosphere and friction acting to reduce energy from the string. Depending on the characteristics of the chosen filter, you can model more energy being taken from the lower frequencies on the string, or more energy being taken from the higher frequencies on the string. The examples at the bottom of the article show what happens to the output when a simple averaging filter is applied.
  • The Feedback Loop: The feedback loop aspect of the algorithm is what puts all the pieces together to form the sound. The processed input is fed back into the loop to create the output signal. We didn't explicitly cover the stability of a feedback loop in 438, but it is still important to know that for this loop, the gain of the filter has to be less than 1 for any given input, for the entire system to remain stable. So, the frequency response of the filter from the previous bullet point should be less than 1 for any given frequency, to ensure the system is a stable positive feedback system.

The output signal from this process will be a varied and random disturbance that gradually smooths out, which is a reasonably simple model of a plucked string. Here are some examples of the algorithm at work:


Example 1

Example 2

Example 3


Sources/Extra Info: https://en.wikipedia.org/wiki/Karplus%E2%80%93Strong_string_synthesis https://ccrma.stanford.edu/~jos/pasp/Karplus_Strong_Algorithm.html http://sites.music.columbia.edu/cmc/MusicAndComputers/chapter4/04_09.php

Alumni Liaison

has a message for current ECE438 students.

Sean Hu, ECE PhD 2009