<?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>Schroeder Reverberator</name>
  <metadata>
  <md:version>1.2</md:version>
  <md:created>2007/10/04 09:00:40 GMT-5</md:created>
  <md:revised>2008/03/18 11:25:11.609 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>all-pass filter</md:keyword>
    <md:keyword>comb filter</md:keyword>
    <md:keyword>impulse response</md:keyword>
    <md:keyword>LabVIEW</md:keyword>
    <md:keyword>reverberation</md:keyword>
  </md:keywordlist>

  <md:abstract>The Schroeder reverberator uses parallel comb filters followed by cascaded all-pass filters to produce an impulse response that closely resembles a physical reverberant environment. Learn how to implement the Schroeder reverberator block diagram as a digital filter in LabVIEW, and apply the filter to an audio .wav file.</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">
		<term>Reverberation</term> is a property of concert halls that greatly adds to the enjoyment of a musical performance.
		The on-stage performer generates sound waves that propagate directly to the listener's ear. However, sound waves
		also bounce off the floor, walls, ceiling, and back wall of the stage, creating myriad copies of the direct sound that are
		time-delayed and reduced in intensity.</para>

<para id="par3">		In the prerequisite module <cnxn document="m15471">Reverberation</cnxn>, you learned how the <term>comb filter</term> 
		structure can efficiently create replicas of a direct-path signal that are time delayed and reduced in intensity. However,
		the comb filter produces replicas that are time delayed by exactly the same amount, leading to the sensation of 
		a pitched tone superimposed on the signal. Refer back to <cnxn document="m15471">Reverberation</cnxn> to hear
		an audio demonstration of this effect. Put another way, the impulse response of the comb filter contains impulses with
		identical spacing in time, which is not realistic.</para>

<para id="par4">		The <term>Schroeder reverberator</term> (see "References" section) uses a combination of comb filters and <term>all-pass filters</term> 
		to produce an impulse response that more nearly resembles the random nature of a physical reverberant environment.</para>

<para id="par5">		This module introduces you to the Schroeder reverberator and guides you through the implementation process in LabVIEW.
		As a preview of what can be achieved, watch the <cnxn target="video-demo"/> screencast video to see and hear
		a short demonstration of a LabVIEW VI that implements the Schroeder reverberator.
		The speech clip used in the video is available
		here: <link src="speech.wav">speech.wav</link> (audio courtesy of the Open Speech Repository,
		<link src="http://www.voiptroubleshooter.com/open_speech">www.voiptroubleshooter.com/open_speech</link>; 
		the sentences are two of the many phonetically balanced <term>Harvard Sentences</term>, an important standard
	       for the speech processing community).
</para>

<figure id="video-demo">
<media type="image/png" src="snd_reverb-schroeder-demo.html">
   <param name="thumbnail" value="snd_reverb-schroeder-demo.png"/>
   </media>
<caption>
   [video] Demonstration of the <term>Schroeder reverberator</term> as implemented in LabVIEW
</caption>
</figure>

</section>

<section id="sec7">
<name>Structure of the Schroeder Reverberator</name>

<para id="par8">
		The <cnxn target="video-theory"/> screencast video presents the structure of the Schroeder
		reverberator and describes the rationale for its design.
</para>

<figure id="video-theory">
<media type="image/png" src="snd_reverb-schroeder-theory.html">
   <param name="thumbnail" value="snd_reverb-schroeder-theory.png"/>
   </media>
<caption>
   [video] Structure of the <term>Schroeder reverberator</term> and rationale for its design
</caption>
</figure>

</section>

<section id="sec10">
<name>All-Pass Filter</name>

<para id="par11">
		The Schroeder reverberator uses <term>all-pass filters</term> to increase the pulse density produced by the
		parallel comb filters. You perhaps are familiar with the frequency response of an all-pass filter: its magnitude
		response is unity (flat) for all frequencies, and its phase response varies with frequency. For example, the all-pass filter
		is used to create a variable fractional delay as described in
		<cnxn document="m15490">Karplus-Strong Plucked String Algorithm with Improved Pitch Accuracy</cnxn>.</para>

<para id="par12">		From an intuitive standpoint it would seem that a flat magnitude response in the frequency domain should correspond
		to an impulse response (time-domain) containing only a single delta function (recall that the impulse function and
		a constant-valued function constitute a Fourier transform pair). However, the all-pass filter's 
		impulse response is actually a large negative impulse followed by a series of positive decaying impulses.</para>

<para id="par13">		In this section, derive the transfer function and difference equation of the all-pass filter structure
		shown in <cnxn target="img-apfstructure"/>. Note that the structure is approximately of the same
		level of complexity as the comb filter: it contains a delay line of N samples and an extra gain
		element and summing element.
</para>

<figure id="img-apfstructure">
<media type="image/png" src="snd_reverb-schroeder-apfstructure.png">
   </media>
<caption>
   All-pass filter structure
</caption>
</figure>

<exercise id="exer15">
<problem>
<para id="par16">Determine the transfer function
<!-- 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:mrow>
 <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYb1uaebbnrfifHhDYfgasaacH8YjY=vipgYlh9vqqj=hEeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9q8qqaq=dir=f0=yqaiVgFr0xfr=xfr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamisaiaacIcacaWG6bGaaiykaaaa@3861@</m:annotation>
 </m:semantics>
</m:math>
<!-- MathType@End@5@5@ --> for the all-pass filter structure of <cnxn target="img-apfstructure"/>.
	</para>
</problem>
<solution>
<para id="par17">
<!-- 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:mo>−</m:mo><m:mi>g</m:mi><m:mo>+</m:mo><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:mrow>
     <m:mn>1</m:mn><m:mo>−</m:mo><m:mi>g</m:mi><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:mfrac>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYb1uaebbnrfifHhDYfgasaacH8YjY=vipgYlh9vqqj=hEeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9q8qqaq=dir=f0=yqaiVgFr0xfr=xfr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamisaiaacIcacaWG6bGaaiykaiabg2da9maalaaabaGaeyOeI0Iaam4zaiabgUcaRiaadQhadaahaaWcbeqaaiabgkHiTiaad6eaaaaakeaacaaIXaGaeyOeI0Iaam4zaiaadQhadaahaaWcbeqaaiabgkHiTiaad6eaaaaaaaaa@44A8@</m:annotation>
 </m:semantics>
</m:math>
<!-- MathType@End@5@5@ -->
	</para>
</solution>
</exercise>
<exercise id="exer18">
<problem>
<para id="par19">Based on your result for the previous exercise, write the difference equation for the all-pass filter.</para>
</problem>
<solution>
<para id="par20">
<!-- 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:mo>−</m:mo><m:mi>g</m:mi><m:mi>x</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:mo>+</m:mo><m:mi>g</m:mi><m:mi>y</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=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamyEaiaacIcacaWGUbGaaiykaiabg2da9iabgkHiTiaadEgacaWG4bGaaiikaiaad6gacaGGPaGaey4kaSIaamiEaiaacIcacaWGUbGaeyOeI0IaamOtaiaacMcacqGHRaWkcaWGNbGaamyEaiaacIcacaWGUbGaeyOeI0IaamOtaiaacMcaaaa@4B71@</m:annotation>
 </m:semantics>
</m:math>
<!-- MathType@End@5@5@ -->
</para>
</solution>
</exercise>
</section>

<section id="sec21">
<name>All-Pass Filter Impulse Response</name>

<para id="par22">
		As described in the video of  <cnxn target="video-theory"/>, two all-pass filters are placed in cascade (series) with the summed output of the
		parallel comb filters. An understanding of the all-pass filter impulse response reveals why a cascade connection increases the pulse density of the
		comb filter in such a way as to emulate the effect of natural reverberation.</para>

<para id="par23">		The <cnxn target="video-apf-impulse-response"/> screencast video derives the impulse response of the all-pass filter; the loop time and
		reverb time of the all-pass filter are also presented.
</para>

<figure id="video-apf-impulse-response">
<media type="image/png" src="snd_reverb-schroeder-apf-impulse-response.html">
   <param name="thumbnail" value="snd_reverb-schroeder-apf-impulse-response.png"/>
   </media>
<caption>
   [video] Derivation of the all-pass filter impulse response
</caption>
</figure>

<para id="par25">
		The <cnxn target="video-apfdemo"/> screencast video demonstrates the sound of the all-pass filter impulse response compared to
		that of the comb filter. Moreover, the audible effect of increasing the comb filter pulse density with an all-pass filter is also demonstrated in the video.
</para>

<para id="par26">
		<media type="image/png" src="LabVIEW.png"/> Download the LabVIEW VI presented in the video: <link src="apfdemo.zip">apfdemo.zip</link>
		Refer to <cnxn document="m15430">TripleDisplay</cnxn> to install the front-panel indicator required by the VI.
</para>

<figure id="video-apfdemo">
<media type="image/png" src="snd_reverb-schroeder-apfdemo.html">
   <param name="thumbnail" value="snd_reverb-schroeder-apfdemo.png"/>
   </media>
<caption>
   [video] Audio demonstration of the all-pass filter impulse response combined with comb filter
</caption>
</figure>

</section>

<section id="sec28">
<name>Project: Implement the Schroeder Reverberator in LabVIEW</name>

<para id="par29">
		As described in the <cnxn target="video-theory"/> screencast video, two all-pass filters are placed in cascade (series) with the summed output of four
		parallel comb filters. The video of <cnxn target="video-apf-impulse-response"/> explains how the all-pass filter "fattens up" each comb filter
		output impulse with high density pulses that rapidly decay to zero. Selecting mutually-prime numbers for the loop times ensures that the comb filter
		impulses do not overlap too soon, which further increases the effect of randomly-spaced impulses.</para>

<para id="par30">		The table in <cnxn target="img-timetable"/> lists the required reverb times (T60) and loop times (tau) of the Schroeder reverberator. Note
		that the comb filters all use the same value (the desired overall reverb time).
</para>

<figure id="img-timetable">
<media type="image/png" src="snd_reverb-schroeder-timetable.png">
   </media>
<caption>
   Reverb time and loop time values for the comb filters and all-pass filters of the Schroeder reverberator
</caption>
</figure>

<para id="par32">
		The <cnxn target="video-build"/> screencast video provides everything you need to know to build your
		own LabVIEW VI for the Schroeder reverberator. 
</para>

<para id="par33">
		<media type="image/png" src="LabVIEW.png"/> Download the .wav reader subVI mentioned in the video : <link src="WavRead.vi">WavRead.vi</link>.
</para>

<figure id="video-build">
<media type="image/png" src="snd_reverb-schroeder-build.html">
   <param name="thumbnail" value="snd_reverb-schroeder-build.png"/>
   </media>
<caption>
   [video] Suggested LabVIEW techniques to build your own Schroeder reverberator
</caption>
</figure>

</section>

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

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

<item> Schroeder, M.R., and B.F. Logan, "Colorless Artificial Reverberation," Journal of the Audio Engineering Society 9(3):192, 1961. </item>
<item> Schroeder, M.R., "Natural Sounding Artificial Reverberation," Journal of the Audio Engineering Society 10(3):219-223, 1962. </item>
<item> Moore, F.R., "Elements of Computer Music," Prentice-Hall, 1990, ISBN 0-13-252552-6. </item>
<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>
