1
$\begingroup$

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 ?

$\endgroup$

2 Answers 2

1
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ Thanks, I'm a beginner in DSP, can you give more details about this interpolation or keywords so that I can search ? $\endgroup$
    – user7439
    Apr 2, 2014 at 15:30
  • $\begingroup$ 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. $\endgroup$
    – Jazzmaniac
    Apr 12, 2014 at 7:50
1
$\begingroup$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.