0 like 0 dislike
5 views
I want to write a software tuner for guitar (like AP Guitar Tuner), but unfortunately I'm in this thread did not guided. Some imagine that you need to do, but how to approach a problem I do not know. Advise resources or literature on the same topic. Thank you.
| 5 views

0 like 0 dislike
musicdsp.org and EVOH forum, and e-mail newsletter.
In Russian, any book on digital signal processing will give a normal base.
\r
In your situation the algorithm is this:
microphone(sound)=>ADC(digital array)=>windowed FFT(array of complex numbers)=>array of amplitudes(array of real numbers)=>relative frequency is high=>high frequency=>note
\r
For your situation you need to know the api of removing the sound from the microphone. Api will issue a portion of the sound pieces, for example, 1024 float. (At frequency of sampling 44100 it will be 44100/1024 = 43 milliseconds).
This piece need to use a windowed fast Fourier transform (FFT), look for somewhere a normal article in which it is due (useful book on digital signal processing). In the Internet there are plenty of library functions.
To know what the conversion is doing, I suggest to put Adobe^Audition W^W free audio editor with a spectrum analyzer and see what is happening with the sound of the different notes, what affects the size of the window, etc. the Brain itself also works with range, not with the actual signal, so intuitive, all meant to cheer.
\r
From the FFT, the more data, the higher spectral resolution. For the required permissions, you might need FFT'it is 8192 bytes or so. The FFT will give an array of 8192 complex numbers, the module of each of these numbers give the amplitude of the spectrum. The values 4096-8191 will be a mirrored copy of 0-4095, this is the feature of the algorithm. From complex numbers to obtain the amplitude, phase in this case is not necessary, and the amplitude is sqrt(re^2+im^2). Well, after finding max in the array.
\r
The maximum is the relative frequency (array-0-4095, and the frequency 0-44100/2). To translate absolute to relative, it is necessary to proportion multiplied by 44100/8192. I.e. the sampling frequency divided by the window size of FFT. And now to translate the frequency of the note. There is an exponential dependence (the frequency of the next note higher frequencies of previous to the twelfth root of two), with labels of the form (A4 440; A#4 465.96] find next is not difficult.
by
0 like 0 dislike
Thank you very much!
by
0 like 0 dislike
Would to recommend you the book "foundations of analog and digital sound". To read a short info about her and where she can buy here.
by
0 like 0 dislike
An excellent example on Codeproject, working tuner, written in C#. For the fast Fourier transform is generally used library FFTW
by

0 like 0 dislike