I am trying to build an Android application that needs to implement pitch detection. Many resources dealing with pitch detection deal with this magical FFT with which I am not familiar.
A Fast Fourier Transform changes a function from time domain to frequency domain. So instead of f(t)
where f
is the signal that you are getting from the microphone and t
is the time index of that signal, you get g(θ)
where g
is the FFT of f
and θ
is the frequency. Once you have g(θ)
, you just need to find which θ
with the highest amplitude, meaning the "loudest" frequency. That will be the primary pitch of the sound that you are picking up.
As for actually implementing the FFT, if you google "fast fourier transform sample code", you'll get a bunch of examples.