## 4 Educational Guide
### Musically Informed Audio Decomposition (Part 8)
Intuitively, the problem arises from the STFT's overlapping windows, which reintroduce in the reconstruction some information from the previous and subsequent frames into the current frame. This fact, which is not easy to understand and often overlooked when employing black-box implementations for STFT inversion, may lead to unexpected signal artifacts. In the FMP Notebook_Signal Reconstruction_, we provide Python code that yields such an example. We strongly recommend that students experiment with such examples to gain a feeling on the intricacies of STFT inversion. As we already indicated in the FMP Notebook_STFT: Inverse_ of **Part 2**, signal reconstruction needs to be regarded as an optimization problem, where the objective is to estimate a signal whose STFT is at least as close as possible to the modified STFT with regard to a suitably defined distance measure. Using a measure based on the mean square error leads to the famous approach originally introduced by [PERSON] and [PERSON] [52]. This approach is often used as default in implementations of the inverse STFT, as, e.g., provided by the Python package librosa. In the FMP Notebook_Applications of HPS and HRPS_, we cover Python implementations for the applications sketched in ([1], Section 8.1.3). In particular, we show how to enhance a chroma representation by considering only a signal's harmonic component and how to enhance a novelty representation by considering only a signal's percussive component. While these simple applications should by seen only as an illustration of the HPS decomposition's potential, we also sketch a more serious application in the context of time-scale modification (TSM), where the task is to speed up or slow down an audio signal's playback speed without changing its pitch. The main idea of the TSM approach by [PERSON] et al. [53] is to first split up the signal into a harmonic and percussive component using HPS. The two components are then processed separately using specialized TSM approaches--one that is specialized to stretch tonal elements of music and one that is specialized to preserve transients. The final TSM result is then obtained by superimposing the two modified components (see Figure 21). For an implementation of this procedure, which goes beyond the scope of the FMP notebooks, we refer to [12]. In the next notebooks, we turn to the topic of melody extraction [54, 55], which serves as a motivating scenario for studying several important signal processing techniques. In the FMP Notebook_Instantaneous Frequency Estimation_, we show how one can improve the frequency resolution of the discrete STFT by exploiting the information hidden in its phase. Looking at the phases of subsequent frames, as described in ([1], Section 8.2.1), allows for adjusting the STFT's frame-independent grid frequency \(F_{\text{coef}}(k)\) (see [1], Equation 8.30) to obtain a frame-dependent instantaneous frequency \(F_{\text{coef}}^{\text{IF}}(k,n)\) (see [1], Equation 8.44). Besides providing an implementation, the notebook introduces visualizations that yield deeper insights into the IF estimation procedure. In particular, we look at a piano recording of the note C4 with fundamental frequency 261.5 Hz as an example (see Figure 22). The resulting visualization indicates that the IF estimation procedure assigns all frequency coefficients in a neighborhood of 261.5 Hz to exactly that frequency (see \(F_{\text{coef}}^{\text{IF}}\) of Figure 22). Furthermore, the difference \(F_{\text{coef}}^{\text{IF}}-F_{\text{coef}}\), which corresponds to the bin offset computed in ([1], Equation 8.45), is shown. The notebook closes with an experiment that indicates how the quality of the estimated instantaneous frequency depends on the hop-size parameter (with small hop sizes improving the IF estimate). In conclusion, an overall aim of the notebook is to emphasize the potential of the phase information--an aspect that is often neglected in a signal processing course.