FFT Pitch Detection for iOS using accelerator system?

I read about detecting FFT and Pitch Detection for a while, but I had trouble building all of this.

I developed that the Accelerate view is probably the best way to go with this, and I read the sample code from apple to find out how to use it for FFT. What is the input for FFT if I want to run real-time pitch determination? Am I just transferring the audio stream from the microphone? How can I do it?

Also, after receiving the FFT output, how can I get the frequency from this? I read everywhere and can't find any examples or explanations for this?

Thanks for any help.

+6
source share
2 answers

Frequency and step are not the same thing: frequency is a physical quantity, step is a psychological perception - they are similar, but there are important differences that may or may not matter to you, depending on the type of instrument you are trying to measure step.

You need to read a little about the various algorithms for determining the pitch (and the meaning of the tone itself), decide which algorithm you want to use, and only then proceed with its implementation. See this Wikipedia page for a good overview of pitch and pitch (note that you can use FFT for methods based on autocorrelation and frequency domain).

Regarding the use of FFT for identifying peaks in the spectrum and associated frequencies, there are many questions and answers related to this, see, for example: How to get the frequencies of each value in the FFT?

+6
source

I have an example of implementing an autocorrelation function available on the Internet for ios 5.1. Check out this post for links to implementations and features on how to find the closest note and how to create a string representing the pitch (A, A #, B, B #, etc.)

While FFT is very useful in many applications, it may not be the most accurate if you are trying to make a simple pitch selection. (It may be just as accurate, but you have to deal with complex numbers to do a lot of phase calculations)

+3
source

Source: https://habr.com/ru/post/914488/


All Articles