Waveform independent frequency analysis If a musician (or a vocal coach) hears a human voice at a certain note, he/she can easily find the same note on piano.
Not only for human voice, if the waveform is square, or created with a synth, they will be able to figure out which note it is.
However, using DFT (or FFT) gives mixed results for any waveform other than sinusoidal. It makes sense, because we use sinusoids as base functions (or base vectors).
Now, I want to learn if there is any way we can implement a signal processing algorithm in order to detect tones regardless of their waveform. Googling didn't help. Can you help me DSP SE?
What you are asking about is typically called &quot;pitch detection&quot;. There are 100s of articles written on the topic. A good starter would be this one: https://ccrma.stanford.edu/~pdelac/154/m154paper.htm
If you need fairly high precision (for example a tuner application), I recommend a phase locked loop (PLL) or delay locked loop. There is a fundamental trade off between precision and tracking speed and with a PLL you can adjust this easily.