<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/technology/cnxml/schema/dtd/0.5/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" xmlns:m="http://www.w3.org/1998/Math/MathML" id="new">
  <name>Localization Cues</name>
  <metadata>
  <md:version>1.2</md:version>
  <md:created>2007/10/04 09:02:33 GMT-5</md:created>
  <md:revised>2008/03/18 09:48:31.926 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="doering">
      <md:firstname>Ed</md:firstname>
      
      <md:surname>Doering</md:surname>
      <md:email>doering@rose-hulman.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="doering">
      <md:firstname>Ed</md:firstname>
      
      <md:surname>Doering</md:surname>
      <md:email>doering@rose-hulman.edu</md:email>
    </md:maintainer>
    <md:maintainer id="eluther">
      <md:firstname>Erik</md:firstname>
      <md:othername>B</md:othername>
      <md:surname>Luther</md:surname>
      <md:email>erik.luther@ni.com</md:email>
    </md:maintainer>
    <md:maintainer id="SShearman">
      <md:firstname>Sam</md:firstname>
      <md:othername>D.</md:othername>
      <md:surname>Shearman</md:surname>
      <md:email>sam.shearman@ni.com</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>delay line</md:keyword>
    <md:keyword>interaural intensity difference</md:keyword>
    <md:keyword>interaural timing difference</md:keyword>
    <md:keyword>LabVIEW</md:keyword>
    <md:keyword>localization cues</md:keyword>
  </md:keywordlist>

  <md:abstract>Learn about two localization cues called interaural intensity difference (IID) and interaural timing difference (ITD), and learn how to create a LabVIEW implementation that places a virtual sound source in a stereo sound field.</md:abstract>
</metadata>

<content>

<table id="labview_banner" frame="none"><tgroup cols="2">
<colspec rowsep="0" colsep="0"/> <colspec colwidth="6in" rowsep="0" colsep="0"/>
<tbody>
  <row>
    <entry morerows="3"><media type="image/png" src="LabVIEWq.png"/></entry>
    <entry> This module refers to LabVIEW, a software development environment that features a graphical programming language.
       Please see the <cnxn document="m15428">LabVIEW QuickStart Guide</cnxn> module for tutorials and documentation that will help you:</entry>
  </row>
  <row> <entry>• Apply LabVIEW to Audio Signal Processing </entry> </row>
  <row> <entry>• Get started with LabVIEW</entry> </row>
  <row> <entry>• Obtain a fully-functional evaluation edition of LabVIEW</entry> </row>
</tbody>
</tgroup>
</table>


<section id="sec1">
<name>Introduction</name>

<para id="par2">
		Our enjoyment of synthesized or recorded sound is greatly enhanced when we perceive the actual locations of
		the various musicians on stage. In a high quality stereo recording of a jazz trio, for example, you can tell that
		the drummer is perhaps located slightly to the left of center, the saxophonist is on stage right and the bass player
		is on stage left. If you have ever flipped on the "mono" (monaural) switch on your stereo amplifier, then you know
		that the resulting sound is comparatively unpleasant, especially when wearing headphones. </para>

<para id="par3">		We live in a three-dimensional soundfield, and our ears continually experience slightly different versions of 
		any given sound. These variations allow us to place (or <term>localize</term>) the sound source, even when
		we cannot see it.</para>

<para id="par4">		In this module, learn about two <term>localization cues</term> called <term>interaural intensity difference</term> 
		and <term>interaural timing difference</term>, abbreviated <term>IID</term> and <term>ITD</term>, respectively.
		Each cue relies on presenting a slightly different version of a sound to each ear.
</para>

</section>

<section id="sec5">
<name>Interaural Intensity Difference (IID)</name>

<para id="par6">
		The interaural intensity difference (IID) localization cue relies on the fact that an off-center source produces
		a higher intensity sound in one ear compared to the other. This technique is also called <term>intensity panning</term>,
		and is most effective when the listener is wearing headphones. When a multi-speaker arrangement is used in a room,
		a given sound propagates to both ears. Lower frequencies have longer acoustic wavelengths and are therefore less
		directional than higher frequency sounds. Consequently, the IID effect works better at higher frequencies above
		1400 Hz (Dodge and Jerse, 1997).</para>

<para id="par7">		The <cnxn target="video-iid"/> screencast video continues the discussion by deriving the equations
		needed to implement the IID effect using a two-speaker arrangement.
</para>

<figure id="video-iid">
<media type="image/png" src="snd_localization-iid.html">
   <param name="thumbnail" value="snd_localization-iid.png"/>
   </media>
<caption>
   [video] Development of the equations needed to implement the <term>interaural intensity difference</term> (IID) localization cue
</caption>
</figure>

</section>

<section id="sec9">
<name>Interaural Timing Difference (IID)</name>

<para id="par10">
		The interaural timing difference (ITD) localization cue relies on the fact that sound waves from an off-center source 
		arrives at one ear slightly after the other ear. We can perceive this slight difference in time down to about 20 microseconds
		(Dodge and Jerse, 1997), and this difference helps us to place the sound source either to the left or right. The ITD
		cue works best in the lower frequency range of 270 to 500 Hz (Dodge and Jerse, 1997).</para>

<para id="par11">		The <cnxn target="video-itd"/> screencast video continues the discussion by deriving the equation
		needed to implement the ITD effect using a two-speaker arrangement.
</para>

<figure id="video-itd">
<media type="image/png" src="snd_localization-itd.html">
   <param name="thumbnail" value="snd_localization-itd.png"/>
   </media>
<caption>
   [video] Development of the equation needed to implement the <term>interaural timing difference</term> (ITD) localization cue
</caption>
</figure>

</section>

<section id="sec13">
<name>Project: Implement the IID and ITD Localization Cues in LabVIEW</name>

<para id="par14">
		You can easily experiment with both the IID and ITD localization cues in LabVIEW. The cues are probably easier to perceive when
		you choose a speech signal for your source. </para>

<para id="par15">		The ITD cue requires a delay or time shift between the two stereo channels. The delay line can be constructed as a digital filter with the
		transfer function shown in <cnxn target="eqn-delayline"/>:
</para>

<equation id="eqn-delay">


<!-- MathType@Translator@5@5@MathML2 (m namespace).tdl@MathML 2.0 (m namespace)@ -->
<m:math>
 <m:semantics>
  <m:mrow>
   <m:mi>H</m:mi><m:mo stretchy="false">(</m:mo><m:mi>z</m:mi><m:mo stretchy="false">)</m:mo><m:mo>=</m:mo><m:mfrac>
    <m:mrow>
     <m:msup>
      <m:mi>z</m:mi>
      <m:mrow>
       <m:mo>−</m:mo><m:mi>N</m:mi>
      </m:mrow>
     </m:msup>
    </m:mrow>
    <m:mn>1</m:mn>
   </m:mfrac>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYb1uaebbnrfifHhDYfgasaacH8YjY=vipgYlh9vqqj=hEeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9q8qqaq=dir=f0=yqaiVgFr0xfr=xfr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamisaiaacIcacaWG6bGaaiykaiabg2da9maalaaabaGaamOEamaaCaaaleqabaGaeyOeI0IaamOtaaaaaOqaaiaaigdaaaaaaa@3D28@</m:annotation>
 </m:semantics>
</m:math>
<!-- MathType@End@5@5@ -->

</equation>

<para id="par17">
		Stated as a difference equation, the filter is
<!-- MathType@Translator@5@5@MathML2 (m namespace).tdl@MathML 2.0 (m namespace)@ -->
<m:math>
 <m:semantics>
  <m:mrow>
   <m:mi>y</m:mi><m:mo stretchy="false">(</m:mo><m:mi>n</m:mi><m:mo stretchy="false">)</m:mo><m:mo>=</m:mo><m:mi>x</m:mi><m:mo stretchy="false">(</m:mo><m:mi>n</m:mi><m:mo>−</m:mo><m:mi>N</m:mi><m:mo stretchy="false">)</m:mo>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYb1uaebbnrfifHhDYfgasaacH8YjY=vipgYlh9vqqj=hEeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9q8qqaq=dir=f0=yqaiVgFr0xfr=xfr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamyEaiaacIcacaWGUbGaaiykaiabg2da9iaadIhacaGGOaGaamOBaiabgkHiTiaad6eacaGGPaaaaa@3E95@</m:annotation>
 </m:semantics>
 </m:math>, which states that the output is the same as the input but delayed by N samples. The forward (or "b") coefficients are therefore zero for all but
<!-- MathType@Translator@5@5@MathML2 (m namespace).tdl@MathML 2.0 (m namespace)@ -->
<m:math>
 <m:semantics>
  <m:mrow>
   <m:msub>
    <m:mi>b</m:mi>
    <m:mi>N</m:mi>
   </m:msub>
   <m:mo>=</m:mo><m:mn>1</m:mn>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYb1uaebbnrfifHhDYfgasaacH8YjY=vipgYlh9vqqj=hEeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9q8qqaq=dir=f0=yqaiVgFr0xfr=xfr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamOyamaaBaaaleaacaWGobaabeaakiabg2da9iaaigdaaaa@38ED@</m:annotation>
 </m:semantics>
 </m:math>, and the reverse (or "a") coefficients are zero for all but
<!-- MathType@Translator@5@5@MathML2 (m namespace).tdl@MathML 2.0 (m namespace)@ -->
<m:math>
 <m:semantics>
  <m:mrow>
   <m:msub>
    <m:mi>a</m:mi>
    <m:mn>0</m:mn>
   </m:msub>
   <m:mo>=</m:mo><m:mn>1</m:mn>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYb1uaebbnrfifHhDYfgasaacH8YjY=vipgYlh9vqqj=hEeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9q8qqaq=dir=f0=yqaiVgFr0xfr=xfr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamyyamaaBaaaleaacaaIWaaabeaakiabg2da9iaaigdaaaa@38D3@</m:annotation>
 </m:semantics>
</m:math>.
</para>

<para id="par18">
		<media type="image/png" src="LabVIEW.png"/> The <cnxn target="video-build"/> screencast video provides LabVIEW coding tips to 
		implement the equations and to generate a stereo audio signal.
</para>

<figure id="video-build">
<media type="image/png" src="snd_localization-build.html">
   <param name="thumbnail" value="snd_localization-build.png"/>
   </media>
<caption>
   [video] LabVIEW coding tips for the IID and ITD localization cues
</caption>
</figure>

</section>

<section id="sec20">
<name>References</name>

<list id="list21" type="bulleted">

<item> Dodge, C., and T.A. Jerse, "Computer Music: Synthesis, Composition, and Performance," 2nd ed., Schirmer Books, 1997,
			ISBN 0-02-864682-7 </item>

</list>

</section>

</content>
</document>
