<?xml version="1.0" encoding="utf-8"?>
<!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="m0044">

  <name>Filtering Periodic Signals</name>

  <metadata>
  <md:version>2.8</md:version>
  <md:created>2000/07/24</md:created>
  <md:revised>2002/07/12 00:00:00.008 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="dhj">
      <md:firstname>Don</md:firstname>
      
      <md:surname>Johnson</md:surname>
      <md:email>dhj@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="dhj">
      <md:firstname>Don</md:firstname>
      
      <md:surname>Johnson</md:surname>
      <md:email>dhj@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mrshawn">
      <md:firstname>Shawn</md:firstname>
      
      <md:surname>Stewart</md:surname>
      <md:email>mrshawn@alumni.rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>filtering</md:keyword>
    <md:keyword>linear circuit</md:keyword>
    <md:keyword>lowpass filter</md:keyword>
  </md:keywordlist>

  <md:abstract>This module demonstrates the effect that a time-invariant filter can have on periodic waveforms.</md:abstract>
</metadata>

  <content>
    <para id="introduction">       
      The Fourier series representation of a periodic signal makes it
      easy to determine how a linear, time-invariant filter reshapes
      such signals <emphasis>in general</emphasis>.  The fundamental
      property of a linear system is that its input-output relation
      obeys superposition:
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:apply>
	    <m:ci type="fn">L</m:ci>
	    <m:apply>
	      <m:plus/>
	      <m:apply>
		<m:times/>
		<m:ci>
		  <m:msub>
		    <m:mi>a</m:mi>
		    <m:mn>1</m:mn>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>s</m:mi>
		      <m:mn>1</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:ci>t</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:ci>
		  <m:msub>
		    <m:mi>a</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>s</m:mi>
		      <m:mn>2</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:ci>t</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	  <m:apply>
	    <m:plus/>
	    <m:apply>
	      <m:times/>
	      <m:ci>
		<m:msub>
		  <m:mi>a</m:mi>
		  <m:mn>1</m:mn>
		</m:msub>
	      </m:ci>
	      <m:apply>
		<m:ci type="fn">L</m:ci>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>s</m:mi>
		      <m:mn>1</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:ci>t</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	    <m:apply>
	      <m:times/>
	      <m:ci>
		<m:msub>
		  <m:mi>a</m:mi>
		  <m:mn>2</m:mn>
		</m:msub>
	      </m:ci>
	      <m:apply>
		<m:ci type="fn">L</m:ci>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>s</m:mi>
		      <m:mn>2</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:ci>t</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:apply>
      </m:math>.
      Because the Fourier series represents a periodic signal as a
      linear combination of complex exponentials, we can exploit the
      superposition property.  Furthermore, we found for linear
      circuits that their output to a complex exponential input is
      just the frequency response evaluated at the signal's frequency
      times the complex exponential.  Said mathematically, if
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:apply>
	    <m:ci type="fn">x</m:ci>
	    <m:ci>t</m:ci>
	  </m:apply>
	  <m:apply>
	    <m:exp/>
	    <m:apply>
	      <m:times/>
	      <m:imaginaryi/>
	      <m:apply>
		<m:divide/>
		<m:apply>
		  <m:times/>
		  <m:cn>2</m:cn>
		  <m:pi/>
		  <m:ci>k</m:ci>
		  <m:ci>t</m:ci>
		</m:apply>
		<m:ci>T</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:apply> 
	</m:apply>
      </m:math>,
      then the output   
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:apply>
	    <m:ci type="fn">y</m:ci>
	    <m:ci>t</m:ci>
	  </m:apply>
	  <m:apply>
	    <m:times/>
	    <m:apply>
	      <m:ci type="fn">H</m:ci>
	      <m:apply>
		<m:divide/>
		<m:ci>k</m:ci>
		<m:ci>T</m:ci>
	      </m:apply>
	    </m:apply>
	    <m:apply>
	      <m:exp/>
	      <m:apply>
		<m:times/>
		<m:imaginaryi/>
		<m:apply>
		  <m:divide/>
		  <m:apply>
		    <m:times/>
		    <m:cn>2</m:cn>
		    <m:pi/>
		    <m:ci>k</m:ci>
		    <m:ci>t</m:ci>
		  </m:apply>
		  <m:ci>T</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:apply> 
      </m:math>
      because 
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:ci>f</m:ci>
	  <m:apply>
	    <m:divide/>
	    <m:ci>k</m:ci>
	    <m:ci>T</m:ci>
	  </m:apply>
	</m:apply>
      </m:math>.
      Thus, if   
      <m:math>
	<m:apply>
	  <m:ci type="fn">x</m:ci>
	  <m:ci>t</m:ci>
	</m:apply>
      </m:math>
      is periodic thereby having a Fourier series, a linear circuit's
      output to this signal will be the superposition of the output to
      each component.

      <equation id="output">  
	<m:math> 
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">y</m:ci>
	      <m:ci>t</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:sum/>
	      <m:bvar>
		<m:ci>k</m:ci>
	      </m:bvar>
	      <m:uplimit>
		<m:infinity/>
	      </m:uplimit>
	      <m:lowlimit>
		<m:apply>
		  <m:minus/>
		  <m:infinity/>
		</m:apply>
	      </m:lowlimit>
	      <m:apply>
		<m:times/>
		<m:ci>
		  <m:msub>
		    <m:mi>c</m:mi>
		    <m:mi>k</m:mi>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:ci type="fn">H</m:ci>
		  <m:apply>
		    <m:divide/>
		    <m:ci>k</m:ci>
		    <m:ci>T</m:ci>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:exp/>
		  <m:apply>
		    <m:times/>
		    <m:imaginaryi/>
		    <m:apply>
		      <m:divide/>
		      <m:apply>
			<m:times/>
			<m:cn>2</m:cn>
			<m:pi/>
			<m:ci>k</m:ci>
			<m:ci>t</m:ci>
		      </m:apply>
		      <m:ci>T</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
      </equation>

      Thus, the output has a Fourier series, which means that it too
      is periodic. Its Fourier coefficients equal
      <m:math>
	<m:apply>
	  <m:times/>
	  <m:ci>
	    <m:msub>
	      <m:mi>c</m:mi>
	      <m:mi>k</m:mi>
	    </m:msub>
	  </m:ci>
	  <m:apply>
	    <m:ci type="fn">H</m:ci>
	    <m:apply>
	      <m:divide/>
	      <m:ci>k</m:ci>
	      <m:ci>T</m:ci>
	    </m:apply>
	  </m:apply>
	</m:apply>
      </m:math>.
      <emphasis>	
	To obtain the spectrum of the output, we simply multiply the
	input spectrum by the frequency response 
      </emphasis>.      
      The circuit modifies the magnitude and phase of each Fourier
      coefficient.  Note especially that while the Fourier
      coefficients do not depend on the signal's period, the circuit's
      transfer function does depend on frequency, which means that the
      circuit's output will differ as the period varies.
    </para>


    <figure id="filter" orient="vertical">
      <name>Filtering a period signal</name>
      <subfigure>
	<media type="image/png" src="sig14.png"/> 
	<caption>Periodic pulse signal</caption> 
      </subfigure> 
      <subfigure> 
	<media type="image/png" src="sig16.png"/>
	<caption>
	  Top plots show the pulse signal's spectrum for various
	  cutoff frequencies.  Bottom plots show the filter's output
	  signals.
	</caption>
      </subfigure>
      <caption>
	A periodic pulse signal, such as shown on the left part 
	(<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:divide/>
	      <m:ci>Δ</m:ci>
	      <m:ci>T</m:ci>
	    </m:apply>
	    <m:cn>0.2</m:cn>
	  </m:apply>
	</m:math>),
	serves as the input to an   
	<m:math>
	  <m:apply>
	    <m:times/> 
	    <m:ci>R</m:ci>
	    <m:ci>C</m:ci>
	  </m:apply>
	</m:math>
	lowpass filter.  The input's period was 1 ms (millisecond).
	The filter's cutoff frequency was set to the various values
	indicated in the top row, which display the output signal's
	spectrum and the filter's transfer function.  The bottom row
	shows the output signal derived from the Fourier series
	coefficients shown in the top row.
      </caption>
    </figure> 


    <example id="diagramsolved">
      <para id="exampleparagraph">
	The periodic pulse signal shown on the left above serves as
	the input to a
	<m:math>
	  <m:apply>
	    <m:times/> 
	    <m:ci>R</m:ci>
	    <m:ci>C</m:ci>
	  </m:apply>
	</m:math>-circuit that has the transfer function (calculated
	<cnxn target="magphase" document="m0028" strength="9">elsewhere</cnxn>)

	<equation id="transferfunction">  
	  <m:math> 
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">H</m:ci>
		<m:ci>f</m:ci>
	      </m:apply>
	      <m:apply>
		<m:divide/>
		<m:cn>1</m:cn>
		<m:apply>
		  <m:plus/>
		  <m:cn>1</m:cn>
		  <m:apply>
		    <m:times/>
		    <m:imaginaryi/>
		    <m:cn>2</m:cn>
		    <m:pi/>
		    <m:ci>f</m:ci>
		    <m:ci>R</m:ci>
		    <m:ci>C</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>

	<cnxn target="filter" strength="9"/> shows the output changes
	as we vary the filter's cutoff frequency.  Note how the
	signal's spectrum extends well above its fundamental
	frequency.  Having a cutoff frequency ten times higher than
	the fundamental does perceptibly change the output waveform,
	rounding the leading and trailing edges.  As the cutoff
	frequency decreases (center, then left), the rounding becomes
	more prominent, with the leftmost waveform showing a small
	ripple.
      </para>
    </example>


    <exercise id="exer1">
      <problem>
	<para id="frstprob">
	  What is the average value of each output waveform?  The
	  correct answer may surprise you.
	</para>
      </problem>
      <solution>
	<para id="frstprobsoln">
	  Because the filter's gain at zero frequency equals one, the
	  average output values equal the respective average input
	  values.
	</para>
      </solution>
    </exercise>

    
    <para id="finalconclusion"> 
      This example also illustrates the impact a lowpass filter can
      have on a waveform.  The simple
      <m:math>
	<m:apply> 
	  <m:times/>
	  <m:ci>R</m:ci>
	  <m:ci>C</m:ci>
	</m:apply>
      </m:math>
      filter used here has a rather gradual frequency response, which
      means that higher harmonics are smoothly suppressed. Later, we
      will describe filters that have much more rapidly varying
      frequency responses, allowing a much more dramatic selection of
      the input's Fourier coefficients.  
    </para>

    <para id="conclusion">       
      More importantly, we have calculated the output of a circuit to
      a periodic input <emphasis>without</emphasis> writing, much less
      solving, the differential equation governing the circuit's
      behavior.  Furthermore, we made these calculations entirely in
      the frequency domain.  Using Fourier series, we can calculate
      how <emphasis>any</emphasis> linear circuit will respond to a
      periodic input.
    </para>    

  </content>
</document>
