## 3 Onset Detection
The cepstrum is a mathematical transformation used in audio signal processing, in particular, for period estimation. Cepstral analysis is one of several methods that enables us to find out whether a signal contains periodic elements. This way, cepstral information can also be used to determine the pitch of a signal [57]. Cepstrum, \(c[n]\), is defined as the inverse DFT of the log magnitude of the DFT of a signal:

Figure 2:4

where \(F\) represents the DFT and \(F^{-1}\) is the inverse discrete Fourier transform (IDFT). For a windowed frame audio signal \(x[n]\), the cepstrum is as follows:

Figure 2:5

The cepstral coefficients describe the periodicity of the spectrum. A peak in the cepstrum denotes that the signal is a linear combination of multiples of the frequency pitch. The pitch period can be found as the number of the coefficient where the peak occurs. Figure 2:6 Preprocessing—(**a**) acquired audio frame in the time domain, (**b**) Hanning window representation, (**c**) windowed audio frame, and (**d**) windowed signal represented in the frequency domain after applying the DFT. Regarding the importance of the cepstral information in pitch estimation, we use it as our 5 th system input. Figure 8 shows the 5 system inputs: four of them are directly obtained from the DFT of the original input audio signal: real (_a_), imaginary (_b_), radius (_r_), and angle (\(\theta\)). The 5 th input (\(c[n]\)) is obtained from the original sound and is represented on a different scale (All the inputs are normalized to a max value of 1. The \(y\) scale of the cepstrum graph is limited to 0.1). Due to the variety and redundancy of information, in relation to the 5 inputs, we ensure that the \(\mathrm{CGP}\) system has a variety of representations of the same data, so that it can be able to choose the one that best fits to the problem. ### Individual Encoding

Usually, Cartesian genetic programming contains three node types: input nodes, function nodes, and output nodes. Our system has 5 input nodes and only one output node for each classifier. We used a CGP, graph which is a grid of nodes with one row and 100 columns. Thus, each individual will have a maximum allowance of 100 nodes, which is a common value for this type of approaches [10]. Each function node contains 5 different genes (Figure 9). There is a gene that represents the function number (\(F_{n}\)) from the pre-established function set. The next two genes encode the node inputs: they can be the system inputs or the outputs of other nodes, and they are 2 because that is the maximum arity of our function set. Finally, there are two genes for the real parameters (\(P_{1}\) and \(P_{2}\)) used as parameters for correct work of the corresponding mathematical functions from the function set. The \(F_{n}\) gene represents the function used by that node chosen from the function set represented by a lookup table. Note that all the functions are prepared to receive one or two vectors and that all of them return a vector. Our function set is almost comprised by filtering operations on vectors and by arithmetic operations with constants and vectors. Figure 2:7 System inputs for a chord with 3 pitches (70 + 75 + 94), bottom down—real part of DFT, imaginary part of DFT, radius of DFT, angle of DFT, and real Cepstrum calculated from the time domain signal. Only the first 500 of 2048 bins of all the 5 vectors are shown. Figure 9 also shows that there are two real parameters in the node genotype. These parameters are useful for the functions, since each function uses at most 2 parameters to accomplish its task. In fact, most functions need real parameters. However, the same parameter has a different meaning and a different domain from function to function. To avoid a tremendous increase in parameters and genes in each node, we used one real parameter to represent constants and another one to represent a percentage of an interval. This way, with only two additional genes, we managed to fulfill all function set needs.