# A Review of Time-Scale Modification of Music Signals +
## 3 TSM Based on Overlap-Add (OLA)  
### The Procedure  
In the general scheme described in the previous section, a straightforward approach would be to simply define the synthesis frames \(y_{m}\) to be equal to the unmodified analysis frames \(x_{m}\). This strategy, however, immediately leads to two problems which are visualized in Figure 2. First, when reconstructing the output signal by using Equation (2), the resulting waveform typically shows discontinuities--perceivable as clicking sounds--at the unmodified frames' boundaries. Second, the synthesis hopsize \(H_{\mathrm{s}}\) is usually chosen such that the synthesis frames are overlapping. When superimposing the unmodified frames--each of them having the same amplitude as the input signal--this typically leads to an undesired increase of the output signal's amplitude.  
A basic TSM procedure should both enforce a smooth transition between frames as well as compensate for unwanted amplitude fluctuations. The idea of the _overlap-add_ (OLA) TSM procedure is to apply a window function \(w\) to the analysis frames, prior to the reconstruction of the output signal \(y\). The task of the window function is to remove the abrupt waveform discontinuities at the the analysis frames' boundaries. A typical choice for \(w\) is a _Hann window_ function  
\[w(r)=\begin{cases}0.5\ \left(1-\cos\left(\frac{2\pi(r+N/2)}{N-1}\right)\right),& \text{if }r\in[-N/2:N/2-1],\\ 0,&\text{otherwise}.\end{cases} \tag{3}\]  
The Hann window has the nice property that  
\[\sum_{n\in\mathbb{Z}}w\left(r-n\frac{N}{2}\right)=1\, \tag{4}\]  
for all \(r\in\mathbb{Z}\). The principle of the iterative OLA procedure is visualized in Figure 3. For the frame index \(m\in\mathbb{Z}\), we first use Equation (1) to compute the \(m^{\text{th}}\) analysis frame \(x_{m}\) (Figure 3a). Then, we derive the synthesis frame \(y_{m}\) by  
\[y_{m}(r)=\frac{w(r)\ x_{m}(r)}{\sum\limits_{n\in\mathbb{Z}}w(r-nH_{\text{s}})}. \tag{5}\]  
The nominator of Equation (5) constitutes the actual windowing of the analysis frame by multiplying it pointwise with the given window function. The denominator normalizes the frame by the sum of the overlapping window functions, which prevents amplitude fluctuations in the output signal. Note that, when choosing \(w\) to be a Hann window and \(H_{\text{s}}=N/2\), the denominator always reduces to one by Equation (4). This is the case in Figure 3b where the synthesis frame's amplitude is not scaled before being added to the output signal \(y\). Proceeding to the next analysis frame \(x_{m+1}\), (Figure 3c), this frame is again windowed, overlapped with the preceding synthesis frame, and added to the output signal (Figure 3d). Note that Figure 3 visualizes the case where the original signal is compressed (\(H_{\text{a}}>H_{\text{s}}\)). Stretching the signal (\(H_{\text{a}}<H_{\text{s}}\)) works in exactly the same fashion. In this case, the analysis frames overlap to a larger degree than the synthesis frames.  
Figure 2: Typical artifacts that occur when choosing the synthesis frames \(y_{m}\) to be equal to the analysis frames \(x_{m}\). The input signal \(x\) is stretched by a factor of \(\alpha=1.8\). The output signal \(y\) shows discontinuities (blue oval) and amplitude fluctuations (indicated by blue lines).  
OLA is an example of a _time-domain_ TSM procedure where the modifications to the analysis frames are applied purely in the time-domain. In general, time-domain TSM procedures are not only efficient but also preserve the timbre of the input signal to a high degree. On the downside, output signals produced by OLA often suffer from other artifacts, as we explain next.