<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Pitch Shifting Using The Fourier Transform</title>
	<link>http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/</link>
	<description>Advanced Signal Processing Tutorials &#38; Software</description>
	<pubDate>Sat, 05 Jul 2008 16:31:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Loren Wilton</title>
		<link>http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/#comment-506</link>
		<dc:creator>Loren Wilton</dc:creator>
		<pubDate>Sun, 22 Jun 2008 22:54:44 +0000</pubDate>
		<guid>http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/#comment-506</guid>
		<description>A couple of questions, the first one trivial:  In the code where you compute magnitude from the first FFT result, why do you multiply the sqrt value by 2? I always thought magnitude was simply (a^2+b^2)^1/2?

The second problem I'm having is perhaps less trivial.  If I implent this algorithm and set it to zero pitch shift, I cna run a sine wave frequency sweep through it with no obvious distortion.  But if I set for instance one semitone of pitch shift (about 1.06) and sweep a sine wave, I find many points that the signal will nearly or completely cancel.  I can hold one of these points and the signal will remain at a low unchanging amplitude, indicating that it isn't an obvious roundoff problem.  Looking at the since wave reconstructed from the rfft before windowing, I see almost the inverse of the windowed sine wave presented to the input fft.  That is, the magnitude of the wave is 1 at the edges of the fft, and approaches 0 in the middle of the fft output.

I suspect this has something to do with erroneous phase reconstruction, but I don't understand the math well enough to see how to fix this.  Can you explain what is happening?  (I have fixed the problem with the 'phase' term being unbounded by constraining it using essentially the same algorithm used in the analysis phase; perhaps this is incorrect?)

Thanks, and thanks a lot for the code and overall explanation!</description>
		<content:encoded><![CDATA[<p>A couple of questions, the first one trivial:  In the code where you compute magnitude from the first FFT result, why do you multiply the sqrt value by 2? I always thought magnitude was simply (a^2+b^2)^1/2?</p>
<p>The second problem I&#8217;m having is perhaps less trivial.  If I implent this algorithm and set it to zero pitch shift, I cna run a sine wave frequency sweep through it with no obvious distortion.  But if I set for instance one semitone of pitch shift (about 1.06) and sweep a sine wave, I find many points that the signal will nearly or completely cancel.  I can hold one of these points and the signal will remain at a low unchanging amplitude, indicating that it isn&#8217;t an obvious roundoff problem.  Looking at the since wave reconstructed from the rfft before windowing, I see almost the inverse of the windowed sine wave presented to the input fft.  That is, the magnitude of the wave is 1 at the edges of the fft, and approaches 0 in the middle of the fft output.</p>
<p>I suspect this has something to do with erroneous phase reconstruction, but I don&#8217;t understand the math well enough to see how to fix this.  Can you explain what is happening?  (I have fixed the problem with the &#8216;phase&#8217; term being unbounded by constraining it using essentially the same algorithm used in the analysis phase; perhaps this is incorrect?)</p>
<p>Thanks, and thanks a lot for the code and overall explanation!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernsee</title>
		<link>http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/#comment-446</link>
		<dc:creator>Bernsee</dc:creator>
		<pubDate>Tue, 03 Jun 2008 11:12:44 +0000</pubDate>
		<guid>http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/#comment-446</guid>
		<description>There may be stupid answers but I don't think that I ever heard a dumb question.

First, about windowing: you need to window the signal twice because in the case of any "realworld" signal the bin phases in your signal will lose sync after some time. IOW, upon resynthesis the individual bin phases are not aligned in the same way they were before the pitch was changed - this will introduce reverberation into the signal and will also smear any transient signal in time. An impulse will be spread out over several milliseconds and the same is true for your input window. So, you need to apply a synthesis window in order to make the individual buffers overlap in a way that doesn't create discontinuities.

Second, about the gain factor. We use only half the analysis bins in the reconstruction, which is why our signal will be reduced in gain on resynthesis. Using half the number of bins adds up to a factor of 2 that we need to apply to get the gain right. Also, if we overlap and add by a factor of osamp we need to reduce the volume by that same factor to avoid distortion.

Our FFT has an output that isn't normalized (that is just a particular feature of our FFT as well as one of many others), so we need to divide by fftFrameSize2 to correct for this. I think this topic is covered in more detail in the Fourier transform tutorial.

Hope this helps
--smb</description>
		<content:encoded><![CDATA[<p>There may be stupid answers but I don&#8217;t think that I ever heard a dumb question.</p>
<p>First, about windowing: you need to window the signal twice because in the case of any &#8220;realworld&#8221; signal the bin phases in your signal will lose sync after some time. IOW, upon resynthesis the individual bin phases are not aligned in the same way they were before the pitch was changed - this will introduce reverberation into the signal and will also smear any transient signal in time. An impulse will be spread out over several milliseconds and the same is true for your input window. So, you need to apply a synthesis window in order to make the individual buffers overlap in a way that doesn&#8217;t create discontinuities.</p>
<p>Second, about the gain factor. We use only half the analysis bins in the reconstruction, which is why our signal will be reduced in gain on resynthesis. Using half the number of bins adds up to a factor of 2 that we need to apply to get the gain right. Also, if we overlap and add by a factor of osamp we need to reduce the volume by that same factor to avoid distortion.</p>
<p>Our FFT has an output that isn&#8217;t normalized (that is just a particular feature of our FFT as well as one of many others), so we need to divide by fftFrameSize2 to correct for this. I think this topic is covered in more detail in the Fourier transform tutorial.</p>
<p>Hope this helps<br />
&#8211;smb</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Adolf</title>
		<link>http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/#comment-428</link>
		<dc:creator>Sebastian Adolf</dc:creator>
		<pubDate>Fri, 30 May 2008 07:14:50 +0000</pubDate>
		<guid>http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/#comment-428</guid>
		<description>Thanks for this great tutorial! One thing i don't really get is the cause of windowing the signal two times... 
and what is the matter for gOutputAccum[k] += 2.*window*gFFTworksp[k][0]/(fftFrameSize2*osamp); ? Why do you multiplicated the left part the divisor with 2 and why does the right part consist of (fftFrameSize2*osamp) and not just osamp?
Sorry if this is a dumb question ;)</description>
		<content:encoded><![CDATA[<p>Thanks for this great tutorial! One thing i don&#8217;t really get is the cause of windowing the signal two times&#8230;<br />
and what is the matter for gOutputAccum[k] += 2.*window*gFFTworksp[k][0]/(fftFrameSize2*osamp); ? Why do you multiplicated the left part the divisor with 2 and why does the right part consist of (fftFrameSize2*osamp) and not just osamp?<br />
Sorry if this is a dumb question <img src='http://www.dspdimension.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
