## 2 Materials and Methods
### OneBitPitch Algorithm  
The algorithm proposed in this paper is aimed at ultra-fast pitch detection, for real-time usage, and was developed as a starting point for future hardware implementation and for heavy-duty, latency-free live use. \begin{table}
\begin{tabular}{c c} \hline \hline
**Name** & **Description** \\ \hline
2 harm & Pure sine waves plus the first two harmonics with random amplitude between 0 and 1 \\
2 harm\_wgn15 & Pure sine waves plus 2 harmonics (random amplitude between 0 and 1) plus white Gaussian noise \\  & with SNR = 15 \\
4 harm & Pure sine waves plus 4 harmonics with random amplitude between 0 and 1 \\
4 harm\_4 part\_wgn15 & Pure sine waves plus 4 harmonics (random amplitude between 0 and 1) and 4 partials (linearly decreasing amplitude) \\
4 harm\_high & Pure sine waves plus 4 harmonics with random amplitude between 0 and 3 \\
4 harm\_wgn15 & Pure sine waves plus 4 harmonics with random amplitude between 0 and 1 plus white Gaussian noise with SNR = 15 \\  & Pure sine waves plus 10 harmonics (random amplitude between 0 and 2) and 10 partials (maximum amplitude = 2), plus white Gaussian noise with SNR = 1 and reverb (0.1 RMS) \\  & Pure sine waves plus 10 harmonics (random amplitude between 0 and 2) and 10 partials (maximum amplitude = 2), plus white Gaussian noise with SNR = 10 and reverb (0.1 RMS) \\  & Pure sine waves \\ pure\_wgn0P3 & Pure sine waves plus white Gaussian noise with SNR = 0.3 \\ square\_pure & Square waves \\ square\_wgn10 & Square waves plus white Gaussian noise with SNR = 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Name and description of the signal categories making up the SYNTHPITCH dataset. The order is alphabetical. Figure 1: Sample signals from the SYNTHPITCH dataset (F0 = 100 Hz): (**a**) “2 harm” sample (blue); (**b**) “4 harm\_high” sample (red); (**c**) “full1” sample (black); (**d**) “square\_wgn10” sample (green). With these premises, our proposed algorithm aims to reduce the computational complexity to its bare minimum, sacrificing accuracy while still staying in acceptable territories, to provide the highest possible speed performances. The OneBitPitch (OBP for short) algorithm exploits a modified version of the autocorrelation in time approach highly optimized for execution time and computational complexity. The basic idea is that reducing the resolution of a signal, i.e., the number of quantization bits, worsens the signal but retains its periodicity. Taking this idea to its limit, we can state the following:  
Let \(x\) be a digital signal modeled as a zero-average periodic sequence quantized with \(N\) bits and with \(F0\) being its fundamental frequency. Re-quantizing \(x\) with \(M<N\) bits, the original \(F0\) is preserved in the re-quantized signal. This can be easily proven by considering that, for a periodic signal in which F0 is the reciprocal of a period T0, the time duration of such a period does not change with truncation (re-quantization), although the exact timeframe can be anticipated/delayed according to rounding conventions [26; 27; 28]. With the assumption of no aliasing (anti-aliasing has been performed priorly), this holds true for any amount of bits, up to the minimum limit of 1-bit quantization, which basically results in the sign function. Although discretizing the amplitudes might indeed insert artifacts that generate new periodicities, the original frequency that acted as a fundamental is ultimately preserved. No matter how coarsely quantized, a sequence will still be repeating itself regardless of the discretization steps. Figure 2 explains this by showing an infinite precision signal, a down-quantized version and a \"sign\" signal quantized with 1 bit. With the period starting at 0, it can be shown that all signals re-start at the exact same moment, despite the quantization error being increasingly high. The mathematical principles for pitch detection are based on the intuition that the maximum of the autocorrelation [29] of a signal is when such a signal repeats itself, i.e., at its fundamental frequency.