chipKIT® Development Platform

Inspired by Arduino™

FFt guitar project help

Created Wed, 04 Feb 2015 12:25:52 +0000 by hazmx17


hazmx17

Wed, 04 Feb 2015 12:25:52 +0000

Hi There,

I am currently researching a project, which involves measuring the frequency of guitar strings very accuratly, I want to test out an FFT method of doing this.

I will be measuring frequencies from 60Hz to 400Hz and need an accuracy of at least + or - 0.5Hz.

I have bought a ChipKit Max 32, however i am a bit stuck on how to programme it to do a FFT on a signal from the analog input.

Once the frequency has been measured it will then need to command a motor to tune the guitar string.

Any help or advice on where i should start or how to programme this would be amazing!

Thanks in advance


majenko

Wed, 04 Feb 2015 13:11:52 +0000

I have a kind of library with FFT code in it you might like to use as a starting point - or at least to rip apart and use the bits you want:

https://github.com/MajenkoLibraries/FFT

Also I have a TFT library that has an example in it which does high speed interrupt based sampling of audio:

https://github.com/TFTLibraries/TFT/blob/master/examples/PICadillo-35T/HSWave/HSWave.ino

Feel free to use whatever bits you want.


hazmx17

Thu, 05 Feb 2015 11:18:54 +0000

Do you have any example code using this library for lets say performing a FFT on the signal from an anologue input?

Thanks again!


majenko

Thu, 05 Feb 2015 17:27:30 +0000

FFT::convert(real, complex, 10);

where "real" and "complex" are arrays of 16-bit integers (int16_t) of 1024 entries each. "real" contains the samples, "complex" is empty, then after conversion they contain the real and complex components of the FFT buckets.