UW CSE
Winter 2004
CSE467 Advanced Digital Systems Design

Lab # 7

DUE: You will have until 5:00PM on Wednesday, March 3, to complete this lab assignment

Late Policy:
 Assignments handed in after lab will incur a 10% penalty for each day late.

Collaboration Policy:
Unless otherwise noted, your group may collaborate with other CSE467 groups on the lab assignments. Collaboration means that you may discuss the experiments and make notes during the discussion, but you may not copy another group’s work when doing the experiments; you may not copy experimental results from another group; and you may not copy any part of another group’s lab report. In addition, every individual in a group must understand the experiments, must participate in the writeup, and should understand the results. Collaboration does not mean that one person may perform the experiments and another write up the results – all lab partners must share equally in all parts of the lab assignment.

Project Groups:
Please see the home Web page for the list of project groups.  You will be working as a project team for the rest of the quarter.

Overview:

In this lab, you will complete a simple plucked string model using a digital waveguide. When you finish, you should be able to play “plucked string” notes using your keypad.

The figure on page 17 in the paper by Smith gives the basic structure of the digital waveguide:

1) A wavetable (at the left, not shown in the figure), provides an initial impulse to the string. When a key is pressed, the wavetable contents are shifted into the delay-line. This can be done easily by adding the output of the wavetable to the feedback from the filter to the delay-line input, or by selecting the wavetable as the input of the delay line. In the latter case, the wavetable should output 0 when it is not plucking the string.

2) A delay-line (shift register) that models the length (actually twice the length) of the string. The length of the delay-line determines the frequency of the string. You should not use a shift register to implement this; instead, use a memory, reading and writing one entry per cycle. You can change the length of the delay by using an input that indicates the size of the memory.  This can be set to just about anything dynamically. Note that the frequency is now quantized unless you can figure out how to insert a delay of less than one clock cycle!

3) A simple low-pass (FIR) filter provides frequency-dependent dampening. The low-pass filter should look as in the paper, with coefficients of 0.5. You should experiment with a damping term, e.g. .99, to make the tone die out. You should also check for overflow and “saturate”, i.e. set the result to the most positive or most negative on overflow. You should perform saturation whenever you are performing addition or multiplication.

 

Design each of the components of your model with an enable input, which you will assert only when you want to do a new computation. The TakingData from the codec interface then should be used to enable the string model. Since this model is so simple, you can easily generate a sample every cycle, so you can assert DataValid every cycle. The wavetable should always be sending samples: when it is not producing an impulse, it should be producing 0 to add into the delay-line.

 

Use simulation to test your design.  Don’t use the codec interface until you go to hardware – use the audioout_tf module instead so that you can go to a wave file.  About a minute of simulation will give you many seconds of audio.  You may want to prototype this in C just to make sure you understand things.  But it’s so simple, you might as well stay in Verilog.

 

Make sure everything is reset when you start.  Since this is a feedback system, if X’s get into the pipeline, they will propagate.  In particular, use an “initial” block (just like an always block but only executed once at the start of simulation), to clear the memory.  When you synthesize, the initial block will be ignored, but you don’t have to worry about the X’s in the real hardware.  (You could initialize the memory to random values and things would still work.)

 

Demonstrate your system to the TA, who will make sure that you can play notes from the keypad, that reset works reliably, that your keypad is debounced reliably, etc.

 

TA Signature: ____________________________________________________________________