## 3 Onset Detection
This process is illustrated in Figure 6.

This innovation in our CGP systems is useful to enlarge the number of positive cases on the training dataset and consequently allows us to enlarge the number of negative original cases maintaining the balance in the two classes. This way, we can train the classifiers with a more extensive and diverse negative training datasets. Another important advantage is that, this way, we also force the classifiers to learn and infer not only when the onset detector is accurate but also when it does not estimate the onset time with high precision (delays and advances). ### Preprocessing

One important decision in designing classifier systems is defining the inputs and their structure. The original sound signals acquired from wave files are float vectors, representing input audio signals in the time domain. However, the frequency domain contains a lot of important information for multi-pitch estimation problems. As mentioned in Section 1, the polyphonic signals can also be expressed as a sum of harmonic sources plus a residual (Equation (1)). Thus, in the frequency domain, we have the information we need about the Fundamental Frequencies (F0) that composes the acoustic input signal. This stresses for a need for converting the input audio signal to the frequency domain. This transformation is done by employing the discrete Fourier transform (Equation (6)). For the preprocessing task, the three audio frames acquired in the data augmentation process are windowed (Equation (4)) using an Hanning window function (Equation (5)) to avoid spectral leakage. The windowing process is illustrated in Figure 7.

\[x_{w}[n]=w[n]\cdot x[n]. \tag{4}\]

\[w[n]=0.5\bigg{(}1-\cos\bigg{(}\frac{2\pi n}{N-1}\bigg{)}\bigg{)}. \tag{5}\]

The windowed audio frames are transformed from the time domain to the frequency domain using discrete Fourier transform (DFT):

\[X[k]=\sum_{n=0}^{N-1}x_{w}[n]e^{-j\big{(}\frac{2\pi}{N}\big{)}nk},(k=0,1,\cdots,N-1), \tag{6}\]

In discrete time processing, DFT is typically computed using the fast Fourier transform algorithm (FFT), which is much faster. We obtained the signal in the frequency domain \(X[k]\) using Equation (6), where \(x_{w}[n]\) is the windowed time signal and \(N\) is the number of samples. Any time signal cannot be uniquely represented for frequencies above \(\frac{f_{s}}{2}\) (also known as the Nyquist frequency), where \(f_{s}\) is the sampling frequency of the sequence. Due to the periodicity of the frequency domain signal resulting from DFT, period \([0;f_{s}]\), and the Nyquist theorem where the symmetry of the real part and the anti-symmetry of the imaginary part relative to Nyquist frequency, \(\frac{f_{s}}{2}\), we use half of the resulting signal of the DFT. Thus, from the resulting frequency signal representing in the frequency interval \([0;f_{s}]\)

Figure 2:0 Data augmentation process using time translation—(**a**) in blue is the original piano signal in the time domain (\(\approx\)0.2 s), in black is the inferred onset location \(I_{os}\), and in red is the extracted frame, starting at \(I_{os}\); (**b**) audio frame extracted from the original signal, starting at instant \(I_{os}-512\); and (**c**) audio frame extracted from the original signal, starting at \(I_{os}+512\). with a size of 4096, we can use only the first half represented in the interval \([0;\frac{\ell_{i}}{2}]\), with a 2048 length. The preprocessing process is illustrated in Figure 2:1

### Inputs

As depicted in Figure 8, our system uses 5 input vectors, all acquired from the sample time vector. The vector \(X[k]\) resulting from Equation (6) is in the frequency domain and is a vector of complex numbers. This lets us use two different vector representations of complex numbers (\(z\)): cartesian (Equation (7)) and polar (Equation (8)). Figure 2:2

Figure 2:3

This way, we have a pair of vectors for each representation (2 components), making 4 usable inputs: \(a\), \(b\), \(r\), and \(\theta\). An additional 5 th input was added to the system: the signal cepstrum.