# Audio Time Stretching Using Fuzzy Classification of Spectral Bins
## 3 Novel Time-Scale Modification Technique
### Proposed Phase Propagation  
The phase vocoder TSM is based on the differentiation and subsequent integration of the analysis STFT phases in time. This process is known as phase propagation. The phase propagation in the new TSM method is based on a modification to the phase-locked vocoder by [PERSON] and [PERSON] [21]. The phase propagation in the phase-locked vocoder can be described as follows. For each frame in the analysis STFT (1), peaks are identified. Peaks are defined as spectral bins, whose magnitude is greater than the magnitude of its four closest neighboring bins. Figure 4: (**a**) Tonalness, (**b**) noisiness, and (**c**) transientness values for the short-time Fourier transform (STFT) bins of the example audio signal. Cf. Figure 1.  
The phases of the peak bins are differentiated to obtain the instantaneous frequency for each peak bin:  
\[\omega_{inst}[m,k]=\omega_{k}+\frac{1}{H_{a}}\kappa[m,k], \tag{7}\]  
where \(\kappa[m,k]\) is the estimated \"heterodyned phase increment\":  
\[\kappa[m,k]=\big{[}\angle X[m,k]-\angle X[m-1,k]-H_{a}\omega_{k}\big{]}_{2\pi}. \tag{8}\]  
Here, \(\big{[}\cdot\big{]}_{2\pi}\) denotes the principal determination of the angle, i.e., the operator wraps the input angle to the interval \([-\pi,\pi]\). The phases of the peak bins in the synthesis STFT \(Y[m,k]\) can be computed by integrating the estimated instantaneous frequencies according to the synthesis hop size \(H_{s}\):  
\[\angle Y[m,k]=\angle Y[m-1,k]+H_{s}\omega_{inst}[m,k], \tag{9}\]  
The ratio between the analysis and synthesis hop sizes \(H_{a}\) and \(H_{s}\) determines the TSM factor \(\alpha\). In practice, the synthesis hop size is fixed and the analysis hop size then depends on the desired TSM factor:  
\[H_{a}=\frac{H_{s}}{\alpha}. \tag{10}\]  
In the standard phase vocoder TSM [20], the phase propagation of (7)-(9) is applied to all bins, not only peak bins. In the phase-locked vocoder [21], the way the phases of non-peak bins are modified is known as phase locking. It is based on the idea that the phase relations between all spectral bins, which contribute to the representation of a single sinusoid, should be preserved when the phases are modified. This is achieved by modifying the phases of the STFT bins surrounding each peak such that the phase relations between the peak and the surrounding bins are preserved from the analysis STFT. Given a peak bin \(k_{p}\), the phases of the bins surrounding the peak are modified by:  
\[\angle Y[m,k]=\angle X[m,k]+\big{[}\angle Y[m,k_{p}]-\angle X[m,k_{p}]\big{]} _{2\pi}, \tag{11}\]  
where \(\angle Y[m,k_{p}]\) is computed according to (7)-(9). This approach is known as identity phase locking. As the motivation behind phase locking states, it should only be applied to bins that are considered sinusoidal. When applied to non-sinusoidal bins, the phase locking introduces a metallic sounding artifact to the processed signal. Since the tonalness, noisiness, and transientness of each bin are determined, this information can be used when the phase locking is applied. We want to be able to apply phase locking to bins which represent a tonal component, while preserving the randomized phase relationships of bins representing noise. Thus, the phase locking is first applied to all bins. Afterwards, phase randomization is applied to the bins according to the estimated noisiness values. The final synthesis phases are obtained by adding uniformly distributed noise to the synthesis phases computed with the phase-locked vocoder:  
\[\angle Y^{\prime}[m,k]=\angle Y[m,k]+\pi A_{n}[m,k](u[m,k]-\frac{1}{2}), \tag{12}\]  
where \(u[m,k]\) are the added noise values and \(\angle Y[m,k]\) are the synthesis phases computed with the phase-locked vocoder. The pseudo-random numbers \(u[m,k]\) are drawn from the uniform distribution \(\mathcal{U}(0,1)\).