0

I'd like to build a "low fidelity" spectrum analyzer to run on an Adafruit Trinket Pro. My primary goal is to intrigue my seven year-old niece with something that can be hacked. The plan is to pick up sound from a violin with a mic and use a set of 5 or 6 NeoPixels to represent octaves and use color for amplitude.

My first pass at this used Amanda Ghassaei's frequency detection code. It kind of worked, but seemed to be having problems with complex waveforms. After doing some more reading and looking at simple spectrum analyzers it seems that I'd do better using something like a FFT to collect the frequency information. It also seems that that might be stretching the capability of an Arduino…

Are there any FFT libraries that run well on the Arduino (over a range of about 200 to 4000 Hz)? Or are there other approaches that might work better?

4
  • A Trinket might be too slow; there are a number of FFT libraries for things like the Teensy which runs at 72MHz+, as in this Adafruit article Dec 24, 2015 at 0:52
  • 2
    I tell a lie, there do appear to be ones that run on slower processors. This article, also from Adafruit, describes one that samples at around 9.6kHz, which should be enough for up to 4.8kHz analysis. Dec 24, 2015 at 0:55
  • DFT is an alternative to FFT.
    – Gerben
    Dec 24, 2015 at 15:54
  • Thanks! As I understand it the DFT is simpler (as in easier to understand the math) than the FFT, but the computational requirements are heavier (O(N^2) vs O(Nlog2(N)), so I think, between the two I'd want to use the FFT – but I am in way over my head here…
    – dlu
    Dec 24, 2015 at 17:36

1 Answer 1

1

I havent used any of the libraries to make the FFT for my personal project, due to complexity. Instead I bought a spectrum chip, which returns 7 frequencies: MSGEQ7 ( 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz and 16kHz ).

Otherwise if you are very keen on using a library, this one is very famous and fast for Arduino processors.

But again, if you dont need to have a precise band and the MSGEQ7 is good enough to detect what you want, go for it.

2
  • The MSGE!7 is appealing. I wish I knew where to get one short notice.
    – dlu
    Dec 24, 2015 at 17:37
  • 1
    I think ebay or maybe from RS or Farnell
    – max246
    Dec 25, 2015 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.