<?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>Subtractive Synthesis Concepts</name>
  <metadata>
  <md:version>1.1</md:version>
  <md:created>2007/09/28 10:07:44.427 GMT-5</md:created>
  <md:revised>2007/11/02 11:39:20.055 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>FIR filter</md:keyword>
    <md:keyword>IIR filter</md:keyword>
    <md:keyword>LabVIEW</md:keyword>
    <md:keyword>pulse train</md:keyword>
    <md:keyword>subtractive synthesis</md:keyword>
    <md:keyword>time-varying digital filter</md:keyword>
    <md:keyword>wideband source</md:keyword>
  </md:keywordlist>

  <md:abstract>Subtractive synthesis describes a wide range of synthesis techniques that apply a filter (usually time-varying) to a wideband excitation source such as noise or a pulse train. The
filter shapes the wideband spectrum into the desired spectrum. This excitation/filter technique well-models many types of physical instruments and the human voice. Excitation sources and time-varying digital filters are introduced in this module.</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>Subtractive Synthesis Model</name>

<para id="par2">
		<term>Subtractive synthesis</term> describes a wide range of synthesis techniques that apply a
		filter (usually time-varying) to a wideband excitation source such as noise or a pulse train. The filter 
		shapes the wideband spectrum into the desired spectrum. The excitation/filter technique describes
		the sound-producing mechanism of many types of physical instruments as well as the human voice, making
		subtractive synthesis an attractive method for <term>physical modeling</term> of real instruments.</para>

<para id="par3">		<cnxn target="fig-model"/> illustrates the general model of subtractive synthesis.
		The excitation source parameters may include amplitude, bandwidth, and frequency (for repetitive
		pulse train input), and each parameter may change independently as a function of time. The filter
		parameters likewise may vary with time, and include center frequency, bandwidth, and resonant gain.
</para>

<figure id="fig-model">
<media type="image/png" src="sub_concept-model.png">
   </media>
<caption>
   Model of the subtractive synthesis process
</caption>
</figure>

</section>

<section id="sec5">
<name>Excitation Sources</name>

<para id="par6">
		Excitation sources for subtractive synthesis must be <term>wideband</term> in nature, i.e., they must contain significant
		spectral energy over a wide frequency range. A <term>white noise</term> source is an idealized source that contains
		constant energy over all frequencies. Practical noise sources do not have infinite bandwidth but can create uniform
		spectral energy over a suitable range such as the audio spectrum.</para>

<para id="par7">		Random number generators form the basis of a variety of noise sources on digital computers. For example, the LabVIEW
		"Signal Processing" palette contains the following noise sources: uniform, Gaussian, random, gamma, Poisson, 
		binomial, and Bernoulli.</para>

<para id="par8">		A <term>pulse train</term> is a repetitive series of pulses. It provides an excitation source that has
		a perceptible pitch, so in a sense the excitation spectrum is "pre-shaped" before applying it to a filter.
		Many types of musical instruments use some sort of pulse train as an excitation, notably wind instruments such
		as brass (trumpet, trombone, tuba) and woodwinds (clarinet, saxophone, oboe, bassoon). For example, consider the
		trumpet and its mouthpiece (<cnxn target="img-trumpet"/> and <cnxn target="img-mouthpiece"/>, respectively).
		Listen to the "buzzing" sound of the trumpet mouthpiece alone <link src="trumpet_mouthpiece.wav">trumpet_mouthpiece.wav</link>, and
		compare it to the mouthpiece plus trumpet <link src="trumpet.wav">trumpet.wav</link>. <cnxn target="img-trumpet-spectrum"/> 
		compares the time-domain waveform and frequency spectrum of each sound. Both sounds are the same pitch, so the
		same harmonics are visible in each. However, the mouthpiece buzz contains more spectral energy at higher frequencies.
</para>

<figure id="img-trumpet">
<media type="image/png" src="sub_concept-trumpet.png">
   <param name="thumbnail" value="sub_concept-trumpet_t.png"/>
   </media>
<caption>
   Trumpet instrument, a member of the brass family (click picture for larger image)
</caption>
</figure>

<figure id="img-mouthpiece">
<media type="image/png" src="sub_concept-mouthpiece.png">
   <param name="thumbnail" value="sub_concept-mouthpiece_t.png"/>
   </media>
<caption>
   Trumpet mouthpiece, approximately 3 inches in length (click picture for larger image)
</caption>
</figure>

<figure id="img-trumpet-spectrum">
<media type="image/png" src="sub_concept-trumpet-spectrum.png">
   <param name="thumbnail" value="sub_concept-trumpet-spectrum_t.png"/>
   </media>
<caption>
   Spectra of the trumpet mouthpiece alone and mouthpiece-plus-trumpet signals (click picture for larger image)
</caption>
</figure>

</section>

<section id="sec12">
<name>Time-Varying Digital Filters</name>

<para id="par13">
		Time-varying digital filters are typically implemented with <term>block processing</term>, in which an input
		signal is subdivided into short blocks (also called <term>frames</term>) for filtering. Each frame is
		processed by a constant-coefficient digital filter. However, the constants change from one frame to the
		next, thereby creating the effect of a time-varying filter.</para>

<para id="par14">		The choice of <term>frame length</term> involves a trade-off between the rate at which the filter coefficients
		must change and the amount of time required for the filter's transient response. Higher-order filters require
		more time to reach steady state, and the frame length should be no shorter than the length of the 
		filter's impulse response.</para>

<para id="par15">		Digital filters may be broadly classified as either <term>finite impulse response</term> (<term>FIR</term>) or
		<term>infinite impulse response</term> (<term>IIR</term>). The latter type is preferred for most implementations
		(especially for real-time filtering) because IIR filters have many fewer coefficients than comparable FIR filters.
		However, IIR filters have the disadvantage of potential stability problems, especially when finite-precision
		calculations are used.</para>

<para id="par16">		The digital filter coefficients usually are calculated independently for each frame. That is, it is generally not
		possible to calculate only two sets of filter coefficients and then interpolate in between. For example, suppose
		a digital filter is required to have a cutoff frequency that varies anywhere from 100 Hz to 5,000 Hz. Ideally one
		would be able to calculate a set of filter coefficients for the 100 Hz filter and another set for the 5,000 Hz filter,
		and then use linear interpolation to determine the coefficients for any intermediate frequency, i.e., 650 Hz.
		Unfortunately the interpolation technique does not work. For off-line or batch-type processing, filter coefficients
		can be computed for each frame. For real-time implementation, the filter coefficients must be pre-computed and
		stored in a lookup table for fast retrieval.</para>

<para id="par17">		<media type="image/png" src="LabVIEW.png"/> Download and run the LabVIEW VI <link src="filter_coeffs.vi">filter_coeffs.vi</link>. 
		
		This VI illustrates why it is generally not possible to interpolate filter coefficients
		between blocks. Try this: increase the "low cutoff frequency" slider and observe the values of the coefficients. Some
		coefficients vary monotonically	(such as a[1]), but others such as a[2] decrease and then increase again. Still
		others such as the "b" coefficients remain at a constant level and then begin increasing. You can also try different
		filter types (highpass, bandpass, bandstop) and filter orders.
</para>

</section>

</content>
</document>
