Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

8
Circular Buffer Audio Generation Using the Karplus- Strong String Synthesis Algorithm

description

My Approach To study the concept of applying white noise, storing the values in an array, averaging its scope every loop, and sending an integer frequency to the speaker for duration of time.

Transcript of Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

Page 1: Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm

Page 2: Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

Purpose

• Generate an acoustic guitar plucking noise at various frequencies to demonstrate the effectiveness of the Karplus-Strong Algorithm on Analog Devices’ Blackfin BF533.

• Verify the function’s operation by calling the LEDs, speakers, and push buttons

Page 3: Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

My Approach

To study the concept of applying white noise, storing the values in an array, averaging its scope every loop, and sending an integer frequency to the speaker for duration of time.

Page 4: Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

Possibile Approaches

• Apply the algorithm to a Low-Pass Filter, and use MATLAB fdatool to produce a C header file to apply directly to the tones.

• Calculate highest value of N for a frequency and use it in a function that calculates the desired tones in a circular loop.

Page 5: Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

Desired Result

• A Random number that averages in a recursive fashion into a near-sinusoidal waveform. This would simulate the harsh striking of a guitar string, followed by the string ringing out to a natural frequency.

Page 6: Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

Output to SpeakerFrequency of 440Hz for 0.1 seconds

Page 7: Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

Working MATLAB Karplus-Strong OutputFrequency of 400Hz for 0.1 seconds

Page 8: Circular Buffer Audio Generation Using the Karplus-Strong String Synthesis Algorithm.

Implementation

• Although the algorithm behaved properly, and integer values were sent to the speaker as required, the desired resulting sound was never obtained using the Blackfin.

• This is probably because the for loop is processing much faster than the sample rate in the ISR. If the rates were aligned, the output would go to the speakers normally.