<?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="m0040">

  <name>A Signal's Spectrum</name>

  <metadata>
  <md:version>2.19</md:version>
  <md:created>2000/07/21</md:created>
  <md:revised>2007/05/10 15:30:16.299 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:maintainer id="bfite">
      <md:firstname>Benjamin</md:firstname>
      
      <md:surname>Fite</md:surname>
      <md:email>bfite@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>half wave rectified sinusoid</md:keyword>
    <md:keyword>rectification</md:keyword>
    <md:keyword>signal spectrum</md:keyword>
  </md:keywordlist>

  <md:abstract>This is a general overview of how to solve simple electrical engineering problems.</md:abstract>
</metadata>
  <content>

    
    <para id="introductoryparagraph"> 

      A periodic signal, such as the half-wave rectified sinusoid,
      consists of a sum of elemental sinusoids.  A plot of the Fourier
      coefficients as a function of the frequency index, such as shown
      in
      <cnxn target="fourier" strength="9"/>,       
      displays the signal's <term>spectrum</term>. The word "spectrum"
      implies that the independent variable, here
      <m:math><m:ci>k</m:ci></m:math>, corresponds somehow to
      frequency.  Each coefficient is directly related to a sinusoid
      having a frequency of
      <m:math>
	<m:apply>
	  <m:divide/>
	  <m:ci>k</m:ci>
	  <m:ci>T</m:ci>
	</m:apply>
      </m:math>.  
      Thus, if we half-wave rectified a 1 kHz sinusoid,   
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:ci>k</m:ci> 
	  <m:cn>1</m:cn>
	</m:apply>
      </m:math>
      corresponds to 1 kHz,   
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:ci>k</m:ci>  
	  <m:cn>2</m:cn>
	</m:apply>
      </m:math>
      to 2 kHz, etc.
    </para>


    <figure id="fourier" orient="vertical">
      <name>Fourier Series spectrum of a half-wave rectified sine wave</name>
	<media type="image/png" src="spectrum2.png"/>
      <caption>
	The Fourier series spectrum of a half-wave rectified sinusoid
	is shown. The index indicates the
	multiple of the fundamental frequency at which the signal has
	energy.
      </caption>
    </figure>   

    <para id="secondparagraph"> 
      A subtle, but very important, aspect of the Fourier spectrum is
      its <emphasis>uniqueness</emphasis>: You can unambiguously find
      the spectrum from the signal

      (<cnxn target="coefficients" document="m0039" strength="7">decomposition</cnxn>) 

      and the signal from the spectrum

      (<cnxn target="sine" document="m0039" strength="7">composition</cnxn>).

      Thus, any aspect of the signal can be found from the spectrum
      and vice versa.  <emphasis>A signal's frequency domain
      expression is its spectrum</emphasis>.  A periodic signal can be
      defined either in the time domain (as a function) or in the
      frequency domain (as a spectrum).
</para>

      <para id="fdtd">A fundamental aspect of solving electrical engineering
	problems is whether the time or frequency domain provides the
	most understanding of a signal's properties and the simplest way of manipulating
	it. The uniqueness
	property says that either domain can provide the right answer.
      As a simple example, suppose we want to know the (periodic)
      signal's maximum value.  Clearly the time domain provides the
      answer directly. To use a frequency domain approach would
      require us to find the spectrum, form the signal from the
      spectrum and calculate the maximum; we're back in the time
      domain!
    </para>

    <para id="para1white">
      Another feature of a signal is its average <term>power</term>. A
      signal's instantaneous power is defined to be its square. The
      average power is the average of the instantaneous power over
      some time interval. For a periodic signal, the natural time
      interval is clearly its period; for nonperiodic signals, a
      better choice would be entire time or time from onset.  For a
      periodic signal, the average power is the square of its
      root-mean-squared (rms) value. We define the <term>rms</term> value of a
      periodic signal to be 

      <equation id="eqn1">
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">rms</m:ci>
	      <m:ci>s</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:root/>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:divide/>
		  <m:cn>1</m:cn>
		  <m:ci>T</m:ci>
		</m:apply>
		<m:apply>
		  <m:int/>
		  <m:bvar><m:ci>t</m:ci></m:bvar>
		  <m:lowlimit><m:cn>0</m:cn></m:lowlimit>
		  <m:uplimit><m:ci>T</m:ci></m:uplimit>
		  <m:apply>
		    <m:power/>
		    <m:apply>
		      <m:ci type="fn">s</m:ci>
		      <m:ci>t</m:ci>
		    </m:apply>
		    <m:cn>2</m:cn>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
      </equation>

      and thus its average power is

      <equation id="eqn2">
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">power</m:ci>
	      <m:ci>s</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:power/>
	      <m:apply>
		<m:ci type="fn">rms</m:ci>
		<m:ci>s</m:ci>
	      </m:apply>
	      <m:cn>2</m:cn>
	    </m:apply>
	    <m:apply>
	      <m:times/>
	      <m:apply>
		<m:divide/>
		<m:cn>1</m:cn>
		<m:ci>T</m:ci>
	      </m:apply>
	      <m:apply>
		<m:int/>
		<m:bvar><m:ci>t</m:ci></m:bvar>
		<m:lowlimit><m:cn>0</m:cn></m:lowlimit>
		<m:uplimit><m:ci>T</m:ci> </m:uplimit>
		<m:apply>
		  <m:power/>
		  <m:apply>
		    <m:ci type="fn">s</m:ci>
		    <m:ci>t</m:ci>
		  </m:apply>
		  <m:cn>2</m:cn>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
      </equation>
    </para>

    <exercise id="exer1">
      <problem>
	<para id="probpara1">
	  What is the rms value of the half-wave rectified sinusoid?
	</para>
      </problem>
      <solution>
	<para id="solpara1">
	  The rms value of a sinusoid equals its amplitude divided by
	  <m:math>
	    <m:apply>
	      <m:root/>
	      <m:degree><m:cn>2</m:cn></m:degree>
	      <m:cn>2</m:cn>
	    </m:apply>
	  </m:math>.	  
	  As a half-wave rectified sine wave is zero during half of
	  the period, its rms value is
	  <m:math>
	    <m:apply>
	      <m:divide/>
	      <m:ci>A</m:ci>
	      <m:apply>
		<m:times/>
		<m:cn>2</m:cn>
		<m:apply>
		  <m:root/>
		  <m:degree><m:cn>2</m:cn></m:degree>
		  <m:cn>2</m:cn>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>.
	</para>
      </solution>
    </exercise>

    <para id="para2">
      To find the average power in the frequency domain, we need to
      substitute the spectral representation of the signal into this
      expression.

	<m:math display="block">
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">power</m:ci>
	      <m:ci>s</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:times/>
	      <m:apply>
		<m:divide/>
		<m:cn>1</m:cn>
		<m:ci>T</m:ci>
	      </m:apply>
	      <m:apply>
		<m:int/>
		<m:bvar><m:ci>t</m:ci></m:bvar>
		<m:lowlimit><m:cn>0</m:cn></m:lowlimit>
		<m:uplimit><m:ci>T</m:ci></m:uplimit>
		<m:apply>
		  <m:power/>
		  <m:apply>
		    <m:plus/>
		    <m:ci>
		      <m:msub>
			<m:mi>a</m:mi>
			<m:mn>0</m:mn>
		      </m:msub>
		    </m:ci>
		    <m:apply>
		      <m:sum/>
		      <m:bvar><m:ci>k</m:ci></m:bvar>
		      <m:lowlimit><m:cn>1</m:cn></m:lowlimit>
		      <m:uplimit><m:infinity/></m:uplimit>
		      <m:apply>
			<m:times/>
			<m:ci>
			  <m:msub>
			    <m:mi>a</m:mi>
			    <m:mi>k</m:mi>
			  </m:msub>
			</m:ci>
			<m:apply>
			  <m:cos/>
			  <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:sum/>
		      <m:bvar><m:ci>k</m:ci></m:bvar>
		      <m:lowlimit><m:cn>1</m:cn></m:lowlimit>
		      <m:uplimit><m:infinity/></m:uplimit>
		      <m:apply>
			<m:times/>
			<m:ci>
			  <m:msub>
			    <m:mi>b</m:mi>
			    <m:mi>k</m:mi>
			  </m:msub>
			</m:ci>
			<m:apply>
			  <m:sin/>
			  <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:cn>2</m:cn>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
      The square inside the integral will contain all possible
      pairwise products. However, the

      <cnxn document="m0039" target="orthogonality" strength="5">orthogonality
	properties</cnxn> 
      say that most of these crossterms integrate to zero. The
      survivors leave a rather simple expression for the power we
      seek.
      
      <equation id="power">
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">power</m:ci>
	      <m:ci>s</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:plus/>
	      <m:apply>
		<m:power/>
		<m:ci>
		  <m:msub>
		    <m:mi>a</m:mi>
		    <m:mn>0</m:mn>
		  </m:msub>
		</m:ci>
		<m:cn>2</m:cn>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:divide/>
		  <m:cn>1</m:cn>
		  <m:cn>2</m:cn>
		</m:apply>
		<m:apply>
		  <m:sum/>
		  <m:bvar><m:ci>k</m:ci></m:bvar>
		  <m:lowlimit><m:cn>1</m:cn></m:lowlimit>
		  <m:uplimit><m:infinity/></m:uplimit>
		  <m:apply>
		    <m:plus/>
		    <m:apply>
		      <m:power/>
		      <m:ci>
			<m:msub>
			  <m:mi>a</m:mi>
			  <m:mi>k</m:mi>
			</m:msub>
		      </m:ci>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:power/>
		      <m:ci>
			<m:msub>
			  <m:mi>b</m:mi>
			  <m:mi>k</m:mi>
			</m:msub>
		      </m:ci>
		      <m:cn>2</m:cn>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
      </equation>
    </para>


    <figure id="fig1">
      <name>Power Spectrum of a Half-Wave Rectified Sinusoid</name>
      <media type="image/png" src="fourier3.png"/>
      <caption>
	Power spectrum of a half-wave rectified sinusoid.
      </caption>
    </figure>

    
    <para id="para3">
      It could well be that computing this sum is easier than
      integrating the signal's square. Furthermore, the contribution
      of each term in the Fourier series toward representing the
      signal can be measured by its contribution to the signal's
      average power. Thus, the power contained in a signal at its
      <m:math>
	<m:ci>k</m:ci>
      </m:math>th harmonic is
      <m:math>
	<m:apply>
	  <m:divide/>
	  <m:apply>
	    <m:plus/>
	    <m:apply>
	      <m:power/>
	      <m:ci>
		<m:msub>
		  <m:mi>a</m:mi>
		  <m:mi>k</m:mi>
		</m:msub>
	      </m:ci>
	      <m:cn>2</m:cn>
	    </m:apply>
	    <m:apply>
	      <m:power/>
	      <m:ci>
		<m:msub>
		  <m:mi>b</m:mi>
		  <m:mi>k</m:mi>
		</m:msub>
	      </m:ci>
	      <m:cn>2</m:cn>
	    </m:apply>
	  </m:apply>
	  <m:cn>2</m:cn>
	</m:apply>
      </m:math>. 
      The <term>power spectrum</term>,
      <m:math>
	<m:apply>
	  <m:ci type="fn">
	    <m:msub>
	      <m:mi>P</m:mi>
	      <m:mi>s</m:mi>
	    </m:msub></m:ci>
	  <m:ci>k</m:ci>
	</m:apply>
      </m:math>,
      such as shown in 
      <cnxn target="fig1" strength="7"/>,
      plots each harmonic's contribution to the total power.
    </para>


    <exercise id="exer2">
      <problem>
	<para id="probpara2">In high-end audio, deviation of a sine wave from the
	  ideal is measured by the <term>total harmonic distortion</term>, which
	  equals the total power in the harmonics higher than the
	  first compared to power in the fundamental. Find an
	  expression for the total harmonic distortion for any
	  periodic signal.  Is this calculation most easily performed
	  in the time or frequency domain?
	</para>
      </problem>
      <solution>
	<para id="solpara2">
	  Total harmonic distortion equals 
	  <m:math>
	    <m:apply>
	      <m:divide/>
	      <m:apply>
		<m:sum/>
		<m:bvar><m:ci>k</m:ci></m:bvar>
		<m:lowlimit><m:cn>2</m:cn></m:lowlimit>
		<m:uplimit><m:infinity/></m:uplimit>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:power/>
		    <m:ci>
		      <m:msub>
			<m:mi>a</m:mi>
			<m:mi>k</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:cn>2</m:cn>
		  </m:apply>
		  <m:apply>
		    <m:power/>
		    <m:ci>
		      <m:msub>
			<m:mi>b</m:mi>
			<m:mi>k</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:cn>2</m:cn>
		  </m:apply>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:plus/>
		<m:apply>
		  <m:power/>
		  <m:ci>
		    <m:msub>
		      <m:mi>a</m:mi>
		      <m:mn>1</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:cn>2</m:cn>
		</m:apply>
		<m:apply>
		  <m:power/>
		  <m:ci>
		    <m:msub>
		      <m:mi>b</m:mi>
		      <m:mn>1</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:cn>2</m:cn>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>. 
	  Clearly, this quantity is most easily computed in the
	  frequency domain. However, the numerator equals the square
	  of the signal's rms value minus the power in the average and
	  the power in the first harmonic.
	</para>
      </solution>
    </exercise>

  </content>
</document>
