Practical Audio Experiments using the TMS320C5505 USB Stick

“Echo and Reverberation"
Texas Instruments University Programme Teaching Materials

© 2010 Texas Instruments Inc

0-1

Echo and Reverberation

© 2010 Texas Instruments Inc

Chapter 3 - Slide 2

Objectives

• To explain echo and reverberation • To implement them in C code • To test the models using the Texas Instruments TMS320C5505 USB Stick with a microphone and headphones/computer loudspeakers.

© 2010 Texas Instruments Inc

Chapter 3 - Slide 3

about 400 meters per second • Click on icon to listen to echo.Echo • Echo is audible because the speed of sound is relatively slow.Slide 4 . Sound Source Direct Sound Echo Listener © 2010 Texas Instruments Inc Chapter 3 .

Block Diagram of Echo • For the time being. Gain < 1. we will consider only one echo path • Output = Input + Delayed Input Simplified Echo Input + + Delay Gain Delayed Input Output • Because of losses in the delayed path. © 2010 Texas Instruments Inc Chapter 3 .Slide 5 .

Slide 6 .Equation for Simplified Echo Simplified Echo x(n) + + z-N G y(n) G.x(n)z -N y (n)  x(n)  Gx(n) z  x(n)(1  Gz © 2010 Texas Instruments Inc N N ) Chapter 3 .

© 2010 Texas Instruments Inc Chapter 3 .Frequency Response • The frequency response of echo can be calculated using the following Matlab .m file.Slide 7 .

Slide 8 .Frequency Response of Echo © 2010 Texas Instruments Inc Chapter 3 .

Multiple Echo Paths • A real room will have several echo paths. Multiple Echo Paths Input + Delayed Input 1 Delay1 Gain1 + + Delayed Input 2 Delay2 Gain2 Output © 2010 Texas Instruments Inc Chapter 3 .Slide 9 .

echo is stable.Slide 10 .Summary of Echo • The Echo output is derived solely from the input • Certain frequencies are attenuated • Because the poles lie inside the unit circle. © 2010 Texas Instruments Inc Chapter 3 .

Slide 11 . but uses a slightly different configuration • Click on the icon to hear reverberation. © 2010 Texas Instruments Inc Chapter 3 .Reverberation • Reverberation is similar to echo.

Loudspeaker Performer Loudspeaker Microphone © 2010 Texas Instruments Inc Chapter 3 .Reverberation on Stage Sound reaches the microphone from both the performer and the the loudspeakers.Slide 12 .

Block Diagram of Reverberation • Output = Input + Delayed Output Simplified Reverberation Input + + Gain Output Delay Delayed Output © 2010 Texas Instruments Inc Chapter 3 .Slide 13 .

Slide 14 .Simplified Reverberation Equation Simplified Reverberation x(n) + + G y(n) Gy(n)z-N z-N y (n)  x(n)  Gy(n) z  x(n) /(1  Gz © 2010 Texas Instruments Inc N N ) Chapter 3 .

the frequency response of reverberation can be calculated using the following . © 2010 Texas Instruments Inc Chapter 3 .m file.Slide 15 .Matlab Model of Reverberation Using Matlab.

Reverberation Frequency Response © 2010 Texas Instruments Inc Chapter 3 .Slide 16 .

© 2010 Texas Instruments Inc Chapter 3 . the output will be amplified • Because the poles lie on the unit circle.Slide 17 .Summary of Reverberation • The output is derived from both the input and the previous output • At certain frequencies. reverberation can become unstable.

Slide 18 . Certain frequencies will be absorbed and there will be phase changes • Therefore.Real World Echo and Reverberation • A real room will have several echo paths • When sound is reflected off a surface there will be “coloration”. a commercial echo / reverberation unit will contain many different delay paths. © 2010 Texas Instruments Inc Chapter 3 .

Slide 19 .C Code Implementation © 2010 Texas Instruments Inc Chapter 3 .

C Code Implementation • This laboratory uses a sampling rate of 24000 Hz rather than 48000 Hz • This allows longer delay times to be implemented • The echo and delay buffers are implemented as circular buffers.Slide 20 . © 2010 Texas Instruments Inc Chapter 3 .

Introduction to Laboratory © 2010 Texas Instruments Inc Chapter 3 .Slide 21 .

Practical Echo and Reverberation • In the Laboratory you will build a C code implementation for echo and reverberation • You will be able to run different echo and reverberation effects on the TMS320C5505 USB Stick. © 2010 Texas Instruments Inc Chapter 3 .Slide 22 .

USB Stick Setup TMS320C5505 USB to PC Microphone Headphones © 2010 Texas Instruments Inc Chapter 3 .Slide 23 .

Slide 24 .Installing the Application • Copy the code from Application 3 Echo and Reverberation to the workspace • Follow the steps previously given in Chapter 1 to set up the new project. © 2010 Texas Instruments Inc Chapter 3 .

Files In Project © 2010 Texas Instruments Inc Chapter 3 .Slide 25 .

Slide 26 .Console © 2010 Texas Instruments Inc Chapter 3 .

Changing Echo Buffer Length © 2010 Texas Instruments Inc Chapter 3 .Slide 27 .

Adjusting the Echo • In the file echo.Slide 28 .c. change the size of the delay buffer N • How does the echo effect change as the value of N is decreased and increased? • What is the maximum value of N supported by the hardware? © 2010 Texas Instruments Inc Chapter 3 .

Changing the Reverberation Buffer Length © 2010 Texas Instruments Inc Chapter 3 .Slide 29 .

Listen to the effect • Question: What happens when DEPTH is 32767. The current value is 200ms • Change the value of DEPTH between 0 and 32767. change the value of N to change the reverberation buffer length. that is 100% is fed back? © 2010 Texas Instruments Inc Chapter 3 .c.Slide 30 .Adjusting the Reverberation • In the file reverberation.

Slide 31 . © 2010 Texas Instruments Inc Chapter 3 .Programming Challenge • In the real world there are multiple echo and reverberation paths • Write your own code to combine both echo and reverberation.

Slide 32 .Questions • What are the differences between echo and reverberation? • Which of echo and reverberation requires the least memory to write your program? • How would you ensure that reverberation remains stable? © 2010 Texas Instruments Inc Chapter 3 .

ISBN 0-8053-1684-1.References • A Digital Signal Processing Primer by Ken Steiglitz. © 2010 Texas Instruments Inc Chapter 3 .Slide 33 .