Hello and excuse me for my english level in advance,
I'm a French student and I want to find the fundamental frequency of a note played by a guitar in order to tune it. So after many hours of research, I've thought the fix_fft library was the more easy way to do that. So I've used this program :
char im[128];
char data[128];
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}void loop() {
// put your main code here, to run repeatedly:
int static i = 0;
static long tt;
int val;if (millis() > tt){
if (i < 128){
val = analogRead(A0);
data = val / 4 - 128;
_ im = 0;_
* i++; ** }*
* else{*
* //this could be done with the fix_fftr function without the im array.
fix_fft(data,im,7,0);
_ // I am only interessted in the absolute value of the transformation*_
* for (i=0; i< 64;i++){*
data = sqrt(data * data + im * im*);** }*
* Serial.println(data[0]);** }*
* tt = millis();*
* }*
}[/quote]
I've used Serial.println(data[0])" because I've understood it's here I'll find the frequency value, this program should work according to this topic (FFT Library - Audio - Arduino Forum) . The problem is that the monitor's screen scrolls and nothing is written. I use an adafruit microphone for arduino and I've amplified it, but amplified or not, the result is the same. The wiring is good, 9600 baud for the serial works for other programs, there's no error message so I really don't know what's wrong.
I sincerely hope someone will be able to help me
Thank you