What is time stretching?


Time stretching is a digital process which is altering the perceived passage of time in an audio signal without of intention of modifying its spectral characteristics, such as changing its pitch for example. Implementing generalized time stretching is difficult to achieve without introducing the audible artifacts. However, in some musical contexts artifacts can be acceptable, or even useful. This is because they add additional spectral interest when stretching radios are large. This process is also known as Time compression or expansion.

Time stretching is a tool that you will find in just about any DAW. It is mostly a simple functional tool, a really good option to get your drum loops in time with the grid. With it, you can also change the tempo of the track in a DJ set. Moreover, you can use it to create some really interesting mangled sounds. Additionally, you can also implement it on most of the audio material (vocals, synths, drums, FX, you name it).


Phase Vocoder & Time Domain


The Time stretching is usually based on complex algorithms such as phase vocoder or time domain. These algorithms are trying to “guess”, though frequency analysis, the need for elimination or interpolation of certain samples. Once you know the tempo of the original audio, it is fairly easy to adjust the tempo to the new tempo track. It is useful to keep in mind that it’s always better to increase the tempo of an audio file than to decrease it. This is because in the first example the computer will eliminate some samples. The second example will have to generate new samples thru the process of interpolation.


Time Stretching algorithms


Algorithms for time stretching has been studied since Gabor`s (1946) early work on granular synthesis. Granular synthesis works by dividing the audio stream into granules, which are snippets of audio, for example, 100 ms in length. To time expand the audio, it repeats certain granules, and to time compress the audio, it removes some granules from the stream. The crossfading between the granules boundaries helps to minimize artifacts. However, the artifacts introduced by such a scheme are not noticeable for all but very small stretching factors.

Rabiner and Schafer (1978) developed a time domain technique called time domain harmonic scaling (TDHS). Firstly, they estimated the fundamental frequency of an audio segment using autocorrelation or other means. Then to time stretch the audio, they copied the input audio to an output audio buffer by using the overlap-add mechanism. This varies the relative rates of traversal through the input and output buffers so that one can time-stretch the audio. Traversal through the input audio is constrained to keep the pitch of the estimated fundamental frequency synchronous. This technique is also called pitch synchronous overlap-add (PSOLA) created by Moulines and Laroche (1995). Verhelst and Roelands (1993) developed an alternative scheme.


Additional Resources & Source Texts