# What's a simple way to shift the pitch?

Basically I want to perform an FFT to find the frequencies of the sound, then stretch the frequencies (for example a stretch by 2 means copy the value of the fourier coefficient X(n) to X(n/2) then use an inverse FFT. Will this work ?

To stretch the spectrum, you will also need to do some high quality (Sinc kernel) interpolation to fill in any bins that don't have an integer submultiple source.

• Thanks, I'm a beginner in DSP, can you give more details about this interpolation or keywords so that I can search ? Apr 2, 2014 at 15:30
• It's correct that you need to care about interpolation. You're not answering the question of the OP however. So I think this should rather be a comment than an answer. Apr 12, 2014 at 7:50

Your approach intuitively makes sense, but it will not work the way you probably imagine. Homogenous stretching in frequency domain is exactly equivalent to stretching with the inverse factor in time domain. This holds for the continuous signal domain and up to aliasing also for the discrete domain.

What this means is that if you perform this operation on a windowed section of your audio all you get is a locally time-domain resampled signal, i.e. the window frame is just played back faster or slower. If you combine this with some kind of overlap add scheme you get something that is usually called granular synthesis.

If you pick the right grain size and overlap you can make it work with a lot of audible artefacts, but only for signals with a single pitch. And, like I said above, you don't need any kind of Fourier transform for that.

There are way better methods if you want to pitch shift single pitch signals or even polyphonic signals. Monophonic methods usually start with first determining the pitch. So this might be a good starting point for your research.

• Jazz has it right. probably the first thing to do is to think of pitch-shifting as the combination of time-scaling and resampling. Apr 11, 2014 at 13:18
• Why the down vote and no comment? Apr 12, 2014 at 13:56