<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="m10483">
  
  <name>Audio Effects: Real-Time Control using RTDX</name>
  <metadata>
  <md:version>1.1</md:version>
  <md:created>2007/10/23 13:29:40.004 GMT-5</md:created>
  <md:revised>2007/11/05 14:44:56.805 US/Central</md:revised>
  <md:authorlist>
      <md:author id="tbshen">
      <md:firstname>Thomas</md:firstname>
      
      <md:surname>Shen</md:surname>
      <md:email>tbshen@uiuc.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="tbshen">
      <md:firstname>Thomas</md:firstname>
      
      <md:surname>Shen</md:surname>
      <md:email>tbshen@uiuc.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>delay</md:keyword>
    <md:keyword>DSP</md:keyword>
    <md:keyword>echo</md:keyword>
    <md:keyword>feedback</md:keyword>
    <md:keyword>graphical user interface</md:keyword>
    <md:keyword>RTDX</md:keyword>
  </md:keywordlist>

  <md:abstract>You will implement a feedback-echo effect and adjust its parameters in real time with a MATLAB graphical user interface.</md:abstract>
</metadata>






  <content>
    <section id="sec5">
      <name>Implementation</name>
      <para id="para15">For this exercise, you will extend the system from <cnxn document="m15240">Audio Effects: Using External Memory</cnxn>
	to generate a feedback-echo effect. You will then extend this
	echo effect to use the USB port on the DSP EVM. The USB
	interface will receive data from a MATLAB GUI that allows the
	two system gains and the echo delay to be changed using
	on-screen sliders.
      </para>
      <section id="subsec2">
	<name>Feedback system implementation</name>
	<figure id="fig1">
	  <media type="image/png" src="system.png"/>
	  <caption>Feedback System with Test Points</caption>
	</figure>
	<para id="para17">First, modify code from <cnxn document="m15240">Audio
	  Effects: Using External Memory</cnxn> to create the
	  feedback-echo system shown in <cnxn target="fig1"/>. A
	  one-tap feedback-echo is a simple audio effect that sounds
	  remarkably good.  You will use both channels of input by
	  summing the two inputs so that either or both may be used as
	  an input to the system. Also, send several test signals to
	  the six-channel board's D/A converters:
	</para>
	<list id="list3">
	  <item>The summed input signal</item>
	  <item>The input signal after gain stage 
	    <m:math>
	      <m:ci><m:msub>
		  <m:mi>G</m:mi>
		  <m:mn>1</m:mn>
		</m:msub></m:ci>
	    </m:math>
	  </item>
	  <item>The data going into the long delay</item>
	  <item>The data coming out of the delay</item>
	</list>
	<para id="para18">
	  You will also need to set both the
	  input gain
	  <m:math>
	    <m:ci><m:msub>
		<m:mi>G</m:mi>
		<m:mn>0</m:mn>
	      </m:msub></m:ci>
	  </m:math> and the feedback gain
	  <m:math>
	    <m:ci><m:msub>
		<m:mi>G</m:mi>
		<m:mn>1</m:mn>
	      </m:msub></m:ci>
	  </m:math>
	  to prevent overflow. 
	</para>
	<para id="para19">
	  As you implement this code, ensure that the delay
	  <code>n</code> and the gain values
	  <m:math>
	    <m:ci><m:msub>
		<m:mi>G</m:mi>
		<m:mn>1</m:mn>
	      </m:msub></m:ci> 
	  </m:math> and
	  <m:math>
	    <m:ci><m:msub> 
		<m:mi>G</m:mi> 
		<m:mn>2</m:mn>
	      </m:msub></m:ci> 
	  </m:math> are stored in memory and can be easily changed
	  using the debugger. If you do this, it will be easier to
	  extend your code to accept its parameters from MATLAB in
	  <cnxn target="subsec3">MATLAB Interface
	  Implementation</cnxn>.
	</para>
	<para id="para20">
	  To test your echo, connect a CD player or microphone to the
	  input of the DSP EVM, and connect the output of the DSP EVM
	  to a loudspeaker.  Verify that an input signal echoes
	  multiple times in the output and that the spacing between
	  echoes matches the delay length you have chosen.
	</para>

      </section>
      <section id="subsec3">
	<name>MATLAB interface implementation</name>
	<para id="para21">After studying the MATLAB interface outlined at the end of <cnxn document="m14388">Using RTDX with a MATLAB GUI</cnxn>, write MATLAB code
	  to send commands to the USB interface based on three
	  sliders: two gain sliders (for
	  <m:math>
	    <m:ci><m:msub>
		<m:mi>G</m:mi>
		<m:mn>1</m:mn>
	      </m:msub></m:ci> 
	  </m:math> and
	  <m:math>
	    <m:ci><m:msub>
		<m:mi>G</m:mi>
		<m:mn>2</m:mn>
	      </m:msub></m:ci> 
	  </m:math>) and one delay slider (for <code>n</code>). Then
	  modify your code to accept those commands and change the
	  values for
	  <m:math>
	    <m:ci><m:msub>
		<m:mi>G</m:mi>
		<m:mn>1</m:mn>
	      </m:msub></m:ci> 
	  </m:math>,
	  <m:math>
	    <m:ci><m:msub>
		<m:mi>G</m:mi>
		<m:mn>2</m:mn>
	      </m:msub></m:ci> 
	  </m:math> and <code>n</code>. Make sure that <code>n</code>
	  can be set to values spanning the full range of 0 to
	  131,072, although it is not necessary that every number in
	  that range be represented.

	</para>
      </section>
    </section>

  </content>
  
</document>
