## 4 Educational Guide
### Content-Based Audio Retrieval (Part 7)
Providing suitable functions for visualizing the results of all intermediate steps (including feature representations, cost matrices, matching functions, and retrieved matches) is a central feature of the notebook, which allows students to analyze the results and create their own illustrations. As an alternative to diagonal matching, we study in the FMP **Notebook**_Subsequence DTW_ a matching approach based on a DTW variant (following [1], Section 7.2.3). The Python code of the subsequence DTW algorithm closely follows the original DTW implementation of the FMP **Notebook**_Dynamic Time Warping (DTW)_ of **Part 3**, which allows students to recognize the differences between the two approaches immediately. Again we draw attention to indexing conventions used in Python (where indexing starts with the index 0) and go through easy-to-understand toy examples. Furthermore, we highlight conceptual differences between the matching functions obtained by diagonal matching and subsequence DTW and discuss their relation to different step size conditions. Finally, we compare our implementation with the one provided by the Python package librosa and discuss various parameter settings. In the FMP **Notebook**_Audio Matching_, we put the individual components together to create a complete audio matching system [45]. We apply our implementation to several real-world music examples starting with three performances (two orchestral and one piano version) of [PERSON]'s Fifth Symphony. Then, we consider two performances of the second waltz of [PERSON]'s Jazz Suite No. 2, which contains repeating parts with different instrumentation. This example is very instructive when using one of these parts as a query since it illustrates to what extent the matching procedure is capable of identifying the other parts across different instrumentations and performances. We also present an experiment, which shows how the matching results' quality crucially depends on the length of the query: queries of short duration (having low specificity) will generally lead to a large number of spurious matches while enlarging the query length (thus increasing its specificity) will generally reduce the number of such matches. Finally, using the song \"In the Year 2525\" by [PERSON] and [PERSON], we implement the transposition-invariant matching function and provide a visualization function that produces Figure 19.  
Turning to the task of version identification, we introduce in the FMP **Notebook**_Common Subsequence Matching_ another sequence alignment variant that drops the boundary condition for both sequences. In our implementation, we follow the same line as with the original DTW and subsequence DTW, thus facilitating an easy comparison of the different algorithms. Furthermore, to round off the alignment topic, we also provide an implementation of the partial matching algorithm, which replaces the step size with a weaker monotonicity condition. In the FMP **Notebook**_Version Identification_, we present a baseline system that integrates common subsequence matching as a main algorithmic component (similar to [41, 46]). We illustrate how the system works by using the original recording and a cover version of the Beatles song \"Day Tripper\" as input documents. Using chromagrams of the two recordings, we first create a score matrix that encodes potential relations between the two input sequences. In the notebook, we provide an implementation for computing such a score matrix using path-enhancement and thresholding techniques, as introduced in the FMP **Notebook**_Audio Thumbnailing_ of **Part 4**. We then apply common subsequence matching for computing a potentially long path of high similarity, show this path for our Beatles example, and provide the audio excerpts that correspond to the two induced segments. The Python functions provided in this notebook may serve as a suitable basis for mini projects within a music processing curriculum.