I want to write an algorithm to implement a pitch-shifter, like in this article: http://www.guitarpitchshifter.com/matlab.html. And I need to do it in realtime, not with a signal already defined earlier. I don't understand if I need overlapping in STFT to play the sound back.

Why can't I just record, say, 1024 samples, then process them and then output it and so on (without overlapping)? This seems to be easier to implement but I guess there is a reason they added an overlapping which I can't understand.

Can you help me understand, is overlapping needed in there? And if yes, why?

  • $\begingroup$ Do you mean that the windows are precisely adjacent? Gaps between windows can cause problems. Also, sometimes non-overlapping STFTs cause modulations at the "frame rate" because of modification of the energy of the signal components (e.g. because of windowing). $\endgroup$ – Peter K. Mar 18 '15 at 21:13

Note that the algorithm in the article uses a windowed FFT for analysis. Window functions help avoid certain FFT artifacts, but they strongly attenuate any signal at the ends of the window. So if you don't overlap, almost all the audio (any pitch changes, etc.) at both edges of each window would be lost, and you would end up with a choppy re-synthesized result. Also, the window function usually peaks in the middle of the window, and is thus produces more accurate analysis there. So the closer together the window centers, the more accurate the analysis involved in the pitch shift algorithm. But the window needs to be longer than this distance for accuracy in frequency estimation. Thus the overlap of 75% instead of just 50% in the article.

Synthesis for playback often involves the phase vocoder algorithm plus cross-fading of overlapped windows to avoid discontinuity ticks and other glitches at the synthesis window boundaries.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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