ECE 5760: Laboratory 3
Multiprocessor Drum Synthesis.
Introduction.
For this exercise, you will simulate the 2D wave equation on a square mesh in realtime to produce drum-like sounds.
Procedure:
Read Study Notes on Numerical Solutions of the Wave Equation with the Finite Difference Method. The main result you will need to simulate is equation 2.18. A matlab program gives a sequential version of the algorithm and plots the Fourier modes of the drum. Another version is tuned to middle C (261 Hz). You can see in the figure below that the simulated sound spectrum (blue) matches the theoretical drum modes (red) up to about mode 8 or 9 (see Physical modeling with a 2D waveguide mesh for details) .
Modifying the boundary conditions, damping, wave speed, drum size, and distrubution of input energy can modifiy the sound of the simulation from drum-like, to chime-like, to gong-like or bell-like. You can modify the program further to include frequency-dependent damping and other effects. This version simluates a long, thin bar struck at one end.
You will probably want to read
for ideas on parallelization.
Student examples running on FPGA:
- 2008: Matt Meister and Cathy Chen wav file.
- 2008: Parker Evans and Jordan Crittenden wav1, wav2
- 2010: Skyler Schneider wav base drum
with n = 16 ,rho = 0.05, eta = 2e-4, alpha = 0.1, boundaryGain = 0.0, node hit = (8, 8), node probed = (8, 8)
- 2010: Peter Kung and Jsoon Kim, rho bit shifted = 6, 8, 10, 11, 14
- 2010: Kerran Flanigan, Tom Gowing, Jeff Yates, chickencan, glasshit, littlebongo, minibell
- 2011: Jinda Cui and Jiawei Yang, drum, bass drum, bowl
- 2011: Weiqing Li and Luke Ackerman, low, high
- 2011: João Diogo Falcão, growing grid, old MacDonald.
The growing grid starts at 7*34*4=952 nodes, (#columns*#lines*symmetry), and ends at 254*34*4=34544 nodes. This is with Rho=0.5 and Eta=0.000244.
Assignment
- Build a realtime drum simulator which produces sound from the audio interface.
- The simulator should solve the 2d wave equation to produce selectable effects. A minimum of two buttons on the DE2 should produce different timbers.
- Part of your grade will be determined by how many nodes you can simulate in realtime. The grade will be based on the product of
(number of wave equation nodes)*(audio sample frequency)
.
Each sample that you calculate must be output to the audio codec.
Each node simulated will require around 10 additions/multiplications. You may be able to use clever shifting schemes to avoid multiplys. Thus the computation rate will be about
10*(number of wave equation nodes)*(audio sample frequency)
.
For a minimal 10x10 grid at 44 kHz, you will need 1000x44000=44x106
operations/second. For a more accurate 20x20 grid you will need ~200x106
operations/sec. Clearly some parallel processing will be necessary. - You can use fine-grained parallelism or course-grained multiprocessors. You can use NiosIIs or not, as you wish.
- Record the audio output back into matlab to show that your simulation matches drum modes (under the correct boundary conditions, etc).
Be prepared to demo your design to your TA in lab.
Your written lab report should include the sections mentioned in the policy page, and :
- Mathematical considerations (what you actually implemented)
- Your parallelization scheme
- A plot of the power spectrum of your drum sounds
- A heavily commented listing of your Verilog design and GCC code (if you use NiosIIs).
Copyright Cornell University
October 13, 2011