Close

Seeing the Light with FFT

A project log for Automatic Ukulele Tuner

Choose a note, Pluck a string, Let the device do the rest.

angelpepsangelpeps 01/01/2018 at 03:370 Comments

I received a lot of guidance from a fellow classmate about using FFT for my project, and in an hour so I received a lot of information and realized that I was actually on the right track for my project. I was playing around with Amanda Ghassaei's code, since that made the most sense to me, and it turned out he was able to successfully reproduce her results in the past. The first problem he helped me tackle was the fact that the FFT code wasn't printing anything readable on my arduino. We used an oscillator and a wave signal generator to test the code that he used for a similar project and it worked perfectly, crossing off the possibility that my arduino was not functional.

AFG-2105 5MHz AWG Function Generator + Counter, Sweep, AM/FM/FSK ModulationImage result for electronic oscillator with screen

After looking at the electret microphone, we realized that automatic gain and voltage range (0-2.5 instead of 0-5) was the reason why the code didn't read anything from it. Since the code calculates the frequency using the amplitude and midpoint, we halved all of the values from 128 to 63, and then we got legible data. However, since the equipment I was using had automatic gain (which increased when no sound was detected and vice versa) we realized it would be better to use a piezo, which was my original plan, so the signal could be clean.

The main reason why I was testing FFT with a microphone in the first place was because I didn't have a simple way to boost the signal from the piezo sensors I was using. My friend also led me to some resources that i can look at to easily create an op amp circuit, but I will most likely also look into ordering one in the future to make the overall device more compact. For now, I will get used to using the oscillator (i don't really need the wave signal generator since I know the code works) to test out my eventual op amp circuit that I will begin working on in January. If everything goes to plan, I should be able to strum my ukulele and get an accurate frequency reading very soon.

Discussions