<?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:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="None">
  <name>Reconstructing A DFT With A Pitch Shift</name>
  <metadata>
  <md:version>1.2</md:version>
  <md:created>2004/12/17 04:58:54 US/Central</md:created>
  <md:revised>2004/12/18 00:33:06.598 US/Central</md:revised>
  <md:authorlist>
      <md:author id="ahlfing">
      <md:firstname>Robert</md:firstname>
      
      <md:surname>Ahlfinger</md:surname>
      <md:email>ahlfing@rice.edu</md:email>
    </md:author>
      <md:author id="bcheese">
      <md:firstname>Brenton</md:firstname>
      
      <md:surname>Cheeseman</md:surname>
      <md:email>bcheese@rice.edu</md:email>
    </md:author>
      <md:author id="pdoody">
      <md:firstname>Patrick</md:firstname>
      
      <md:surname>Doody</md:surname>
      <md:email>pdoody@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="ahlfing">
      <md:firstname>Robert</md:firstname>
      
      <md:surname>Ahlfinger</md:surname>
      <md:email>ahlfing@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="bcheese">
      <md:firstname>Brenton</md:firstname>
      
      <md:surname>Cheeseman</md:surname>
      <md:email>bcheese@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="pdoody">
      <md:firstname>Patrick</md:firstname>
      
      <md:surname>Doody</md:surname>
      <md:email>pdoody@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>Elec 301</md:keyword>
    <md:keyword>Harmonics</md:keyword>
    <md:keyword>Pitch</md:keyword>
    <md:keyword>Wyld Stallyns</md:keyword>
  </md:keywordlist>

  <md:abstract>This is an overview of the technique used to recompse an audio signal from one half of the DFT as well as shifting the harmonics in the signal.</md:abstract>
</metadata>

  <content>
<section id="sec1">
<name>Reconstructing the First Half of the DFT</name>
<para id="para1">
	With the first harmonic in hand (if, of course, it exists) the program is ready to manipulate the signal chunk by building a new DFT from scratch but based upon the original.  The pitch you hear is the position of the fundamental frequency – the first harmonic.  So the new DFT must take the frequencies at and around the original first harmonic and copy them, without alteration, to a spot further down the spectrum.  Further, in fact, by exactly the desired pitch shift.  The frequency of the second harmonic needs to be twice as large as the first so that the new voice sounds like it came from a real person, so the second harmonic and its neighboring frequencies are shifted twice as far down the spectrum as the first group.  This is repeated with every harmonic in a similar way until half of the new DFT is full.    
</para>
</section>
<section id="sec2">
<name>Reconstructing the Second Half of the DFT</name>
<para id="para2">
	To reduce computational complexity, there is no need to perform this same task starting at the end of the original DFT working our way towards the middle.  We know that the resulting time-domain signal we produce must be comprised of real numbers since people are going to actually listen to it, so we can exploit the symmetry properties of the DFT.  That is, the DFT of a real-valued signal follows rule that the real part of the samples in the first half is a mirror image of the real part of the samples in the second half.  Similarly, the imaginary part of the samples in the second half is a flipped (negative) mirror image of the imaginary part of the samples in the second half.  This line simple for loop constructs the entire second half of the new DFT without any further analysis or computation.

Here is an example of the magnitude of the spectrum for a chunk of signal before and after pitch manipulation.  Notice how the harmonics are not merely shifted over, but spread out as well.
</para>

<figure id="fig1">
<name>DFT of Signal Sample</name>
	    <subfigure id="subfig1">

	      <media type="image/bmp" src="http://cnx.rice.edu/GroupWorkspaces/wg221/DFT_B.bmp"/>
<caption>
Discrete Fourier Transform showing the spectra for one 512 sample chunk of the speech signal before manipulation by the Pitch Synthesizer. 
</caption>	    

</subfigure>
	    <subfigure id="subfig2">

	      <media type="image/bmp" src="http://cnx.rice.edu/GroupWorkspaces/wg221/DFT_A.bmp"/>
<caption>
Discrete Fourier Transform of the original DFT spectra for one 512 sample chunk of the speech signal after manipulation by the Pitch Synthesizer. 
</caption>	    



</subfigure>
	  </figure>
</section> 
  </content>
  
</document>
