Get a fundamental frequency using the FFT Arduino library

Hello,
I'm currently working on a project using an arduino and processing the FFT using this library:

http://wiki.openmusiclabs.com/wiki/ArduinoFFT

My code is close to the example on the website :

http://wiki.openmusiclabs.com/wiki/Example

So I have two little problems:

How can I get the result of the Serial.write(fft_log_out, 128) on my compûter?

How can I get the fundamental frequency after processing the FFT ?

Thanks !

How can I get the result of the...on my compûter?

The Arduino is writing data to the serial port. You need some application on the PC that is reading the data.

How can I get the fundamental frequency after processing the FFT ?

Can't help you with that.

Heliops:
How can I get the fundamental frequency after processing the FFT ?

  1. Define the characteristics of a fundamental frequency
  2. Write code to analyze those characteristics.

There is much more of a problem with #1 than with #2. For example, with mixed sound sources, a tone could be a fundamental, or it could be an overtone of another fundamental.

To see the results of the FFT transformation on the serial monitor, replace

Serial.write(fft_log_out, 128)

with

  for (int i=0; i<FFT_N/2; i++) {
    Serial.print(i);
    Serial.print(" ");
    Serial.println(fft_log_out[i]);
  }

Thank you for your answers. Now I have my graph but I still don't have the frequency. I don't see how to get the fundamental frequency because I haven't got any information about the signal. All the calculation is in the function. So i don't know how to get it.

Can anyone help me a bit more about that please?.

What does the FFT library documentation say?

I don't see how to get the fundamental frequency because I haven't got any information about the signal.

We don't have any information about your signal either, so we can't help you.

The best way to test your program is to generate a signal of known frequency and analyze that signal.

Once you understand how that works, then you can begin to analyze an unknown signal.

My signal is received by a microphone connected to the ADC. Then the signal is used by the functions

fft_window(); // window the data for better frequency response
  fft_reorder(); // reorder the data before doing the fft
  fft_run(); // process the data in the fft
  fft_mag_log(); // take the output of the fft

But in the library, there is nothing about how to get the frequency.

Heliops:
But in the library, there is nothing about how to get the frequency.

No wonder, since "getting the frequency" from an arbitrary sample could be the subject of a PHD dissertation.