Go Down

Topic: HELP WITH THE LIBRARY FFT (Read 1 time) previous topic - next topic

boganazhapa

Hello world arduino

I'm in a project is to demonstrate and plot the spectral diagram of an analog signal and not to start.???? ..... =(

First of all I read about arduino Seller FFT and see that is the only option to apply, but my problem is, as I can use it and do not know how?? .... =(.

I would like some help or some examples of how to use and get the amplitude and phase of each analog signal with this program because I need to extract all the amplitudes and phases of all the harmonics existing one signal and calculate the THD.

Thank you thank you

Erdin

A link to the library ?
What is your sketch ?

When you also post the question in another language, you could add a link to it.

boganazhapa

Hi, I'm new to programming in arduino

This is the library:

https://code.google.com/p/neuroelec/downloads/detail?name=ffft_Library.zip&can=2&q=

I do not know how to use the code,

I want to acquire analog 6-channel, and the code provided below is valid for 6 analog channels:

ISR(ADC_vect)
{
  if (position >= FFT_N)
    return;
 
  capture[position] = ADC + zero;
  if (capture[position] == -1 || capture[position] == 1)
    capture[position] = 0;

  position++;
}


also
void adcCalb(){
  Serial.println("Start to calc zero");
  long midl = 0;
  // get 2 meashurment at 2 sec
  // on ADC input must be NO SIGNAL!!!
  for (byte i = 0; i < 2; i++)
  {
    position = 0;
    delay(100);
    midl += capture[0];
    delay(900);
  }
  zero = -midl/2;
  Serial.println("Done.");
}


And I do not understand if the prescale is activated for all analog ports, or is necessary to activate for each port.

Thanks you



Go Up