Go Down

Topic: Frequency detection (Read 1 time) previous topic - next topic

sonacx

Hi every body !
Hope you're having a great day !! :D
I'm sorry to ask you this but can some one help me.
I need to detect the frequency played by a guitare string.
I planned to attach this preamplified microphone:
https://www.sparkfun.com/products/9964

I need a code that allow me to detect a sound frequency and give me the result at the end.
I need to use this code to build an automatic guitar tuner.
I only using a mic, an continous servo and an arduino uno.
thanks alot !! :D

CrossRoads

Going to make a robot tuner like this?
http://www.tronical.com/works/
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

michinyon

If you have a computer,  you can download a program which will tell you which note you are playing.



sonacx


bosleymusic

#1- Most of the tuners built with Arduino are neither verified against a known source, nor or are they accurate. Be careful what you trust.
#2 - If you're using a regular arduino, your options are limited to basic time domain methods.  Autocorrelation functions (ACF) and YIN (an advanced form of ACF) are possible, but you'll still have to probably employ a table look up of some sort to guess your instrument's pitch. Depending on your sampling rate, you won't be able to resolve higher frequencies even if you employed something like quadratic interpolation. To avoid octave and harmonic errors, a bit of adaptive low-pass filtering can also be used.

If you're working on one of the more powerful (32 bit) Arduino's, you could also try to employ methods involving the FFT. Harmonic Product Spectrum, the Phase Vocoder (not like a talkbox type vocoder), and general spectral peak picking are all good ways to go about it. Just realize, that using any of these methods you should use doubles in software to retain as much accuracy as possible, even if the hardware doesn't have a floating point unit.

There is a lot of good information on these types of things floating around on the Stanford CCRMA and J.O.Smith III websites.


Go Up