## 2 Data Model
### Time-Frequency Representation  
Due to the sinusoidal nature of the tone model (2), it is advantageous to consider the signal in the frequency domain rather than the time domain. However, in reality, music is not stationary over longer periods of time; tones start, end, and change in volume or frequency. Therefore, we only consider the frequency spectrum of short excerpts in time, which is called a _time-frequency representation_. We compute the _short-time Fourier transform_ (STFT) of a signal \(X\in L_{2}(\mathbb{R})\) via:  
\[\mathcal{V}_{w}X(t,f)=\int_{-\infty}^{\infty}X(\tau)\,w(\tau-t)\,e^{-i2\pi f \tau}\,\mathrm{d}\tau, \tag{4}\]  
where \(t,f\in\mathbb{R}\) correspond to the time and frequency axes and \(w\in L_{2}(\mathbb{R})\) is the real-valued _analysis window_, cf. [35]. In our notation, the uppercase letters \(X,Z,Y\) always refer to measured data, while their lowercase counterparts \(x,z,y\) are our corresponding models.  
We sample the representation as:  
\[Z[k,l]\coloneqq\mathcal{V}_{w}X(\alpha k,\beta l)\,e^{i2\pi\alpha k\beta l}, \qquad k,l\in\mathbb{Z}, \tag{5}\]  
with the time and frequency constants \(\alpha,\beta>0\). For \(\alpha\beta<1\) and with the Gaussian window  
\[w(t)=\frac{1}{\sqrt{2\pi\zeta^{2}}}\exp\left(-\frac{t^{2}}{2\zeta^{2}}\right),\qquad\zeta>0, \tag{6}\]  
a so-called _Gabor frame_ is formed, meaning that any function \(X\in L_{2}(\mathbb{R})\) is uniquely determined by its respective set of _analysis coefficients_\(Z[k,l]\), \(k,l\in\mathbb{Z}\), cf. [35]. In practice, we only consider a finite number of indices \(k=1,\ldots,n_{\text{len}}\) (for time) and \(l=0,\ldots,n_{\text{spc}}-1\) (for frequency) with \(n_{\text{len}},n_{\text{spc}}\in\mathbb{N}\), where we again neglect negative frequencies. If \(X\) is real-valued, we have \(Z[k,-l]=\overline{Z[k,l]}\).  
For the tone model (2), the STFT yields:  
\[\mathcal{V}_{w}x(t,f)=\sum_{h}a_{h}\exp\left(-\frac{(f-f_{h})^{2}}{2\sigma^{2 }}-i2\pi(f-f_{h})t\right), \tag{7}\]  
with \(\zeta\sigma=1/(2\pi)\). For tones at very low frequencies, the negative frequencies that were omitted from the tone model (2) can cause interference with the positive part of the frequency spectrum. With typical audio signals, this interference is not strong enough to become a problem. It would be straight-forward to add them back in, but this would increase the computational cost. When sampling according to (5), we obtain:  
Figure 1: Illustrative example for the signal model with a fundamental frequency of \(f_{1}^{\circ}=440\,\mathrm{Hz}\) and an inharmonicity parameter of \(b=10^{-2}\).  
\[z[k,l] =\mathcal{V}_{w}x(\alpha k,\beta l)\,e^{i2\pi ak\beta l} \tag{8}\] \[=\sum_{h}a_{h}\exp\left(-\frac{(\beta l-f_{h})^{2}}{2\sigma^{2}}-i2 \pi(\beta l-f_{h})\alpha k\right)e^{i2\pi ak\beta l}\] \[=\sum_{h}a_{h}\exp\left(-\frac{(\beta l-f_{h})^{2}}{2\sigma^{2}}+ i2\pi f_{h}\alpha k\right).\]  
Thus, for each harmonic \(h\), the phase is constant for a fixed time index \(k\).  
Our default choice, assuming a sampling frequency of \(f_{\mathrm{s}}=48\,\mathrm{kHz}\), is:  
\[\zeta=\frac{1024}{f_{\mathrm{s}}}=21.\overline{3}\,\mathrm{ms},\quad\alpha= \frac{\zeta}{2}=\frac{512}{f_{\mathrm{s}}}=10.\overline{6}\,\mathrm{ms},\quad \beta=\frac{1}{12\zeta}=\frac{f_{\mathrm{s}}}{122,88}=3.906\,25\,\mathrm{Hz}. \tag{9}\]  
The value of \(\zeta\) is short enough to capture rhythm, while the quantity \(1/(2\pi\zeta)\approx 7.46\,\mathrm{Hz}\), that will become important later, is well below the fundamental frequencies considered. Our choice of \(\alpha\) ensures that Gaussian windows spaced by \(\alpha\) overlap narrowly.  
For practical computations, it is common to limit the support of the window \(w\) to \([-1/(2\beta),1/(2\beta)]\). Due to \(1/(2\beta)=6\zeta\), our value for \(\beta\) makes the resulting error negligible.