4

I'm making a guitar tuner for iOS with Objective-C.Due to the fact I'm Beginner I'm struggling a bit to gather all the resources and information about it. I know the theory like ( correct me if I'm wrong ) :-

  1. First I need to get the input from microphone.
  2. Then need to apply apply FFT algorithm to get the frequency
  3. Then compare the frequency with the fundamental frequency of notes.

while searching on stack and google I found people are talking a lot about AurioTouch example soo I take a look at the example but however I'm not able to figure out what is exactly going on under the hood because the code is mostly return with C++ and pointer that I can't understand at least for now. I also found the EZAudio example ,and that was a great one seems to be working fine but according to my research the fundamental frequency of the guitar are measured as:-

String  Frequency   
1 (E)   329.63 Hz
2 (B)   246.94 Hz
3 (G)   196.00 Hz
4 (D)   146.83 Hz
5 (A)   110.00 Hz
6 (E)   82.41  Hz

and from EZAudioFFT example I'm getting the frequency:-

String  Frequency   
1 (E)   333.02  Hz  
2 (B)   247.60  Hz   
3 (G)   398-193 Hz    (398 when start and 193 when end)
4 (D)   290-150 Hz    (290 when start and 150 when end)
5 (A)   333-215 Hz    (333 when start and 215 when end)
6 (E)   247-161 Hz    (247 when start and 161 when end)

One thing to notice the EZAudioFFT example was showing the Max Frequency.

So what I'm asking here is there anybody who have implemented this before and give me the direction and some detail information about the topic so In future nobody have to research more and more to gather all the resources.I need help with the following topics:-

  1. What is the best possible way to get the accurate frequency of guitar string and the libraries to use.
  2. Which type of frequency need to tune a guitar like maxFrequency, is there a role of altitude, magnitude (i have less information about this topic).
  3. What to do after getting the right frequency.

Any help would be truly appreciated and my apologies in advance if i'm asking something stupid , it would be great if someone provide me information taking Objective-C as the primary language also I found this beautiful Example but I was enable to implement it in Objective-C and was enable to compile amazing framework AudioKit maybe due to Xcode 8.0 and some swift issues.

tryKuldeepTanwar
  • 3,490
  • 2
  • 19
  • 49
  • For Step 2: I might be wrong but I think a `Fourier transform` gives you the individual sound waves and then you pick the one you want to work with (the loudest usually) and find it's frequency. – Albert Renshaw Feb 21 '17 at 09:13
  • honestly speaking , i don't know the right reason i'm driven by the variety of examples available on the internet that is causing so many confusion so I'm also looking for the right solution. @AlbertRenshaw as far as I'm concerned FFT is used to convert time domain to frequency domain by applying transform. – tryKuldeepTanwar Feb 21 '17 at 09:30
  • [This](http://www.cs.uregina.ca/Research/Techreports/2003-06.pdf) and [this answer](http://stackoverflow.com/a/11695969/1457385) hold a lot of information in regards to your requirement. Including sample projects. For a serious base frequency detection using the FFT frequency with the highest amplitude is not good enough though. One reason therefore is that you often get multiples of the base frequency. Better approaches can be found in [the DSP forum](http://dsp.stackexchange.com/a/1321/24805). There is a free and commonly used C++ library, but I forgot the name. – shallowThought Feb 21 '17 at 10:37
  • one more thing to ask why the upper string of guitar producing 250 Hz and more they should be generating between 80-147 Hz. – tryKuldeepTanwar Feb 21 '17 at 12:55

0 Answers0