Peak detection of audio frequencies with Arduino

Discussion in 'Programmer's Corner' started by Mel Pereira, Feb 15, 2017.

  1. Mel Pereira

    Thread Starter New Member

    Feb 15, 2017
    2
    0
    Hey guys, I'm working in a new project that I have to detect the four highest frequencies in an array. How can I do that using an arduino code? It would be perfect if I could keep the index of those frequencies! Can someone help me?
     
  2. BR-549

    Well-Known Member

    Sep 22, 2013
    2,472
    519
    What is the range of frequencies that can or do occupy the array? Are all frequencies the same amplitude?

    How often?

    We need details.
     
  3. Mel Pereira

    Thread Starter New Member

    Feb 15, 2017
    2
    0
    The maximum frequency is 15000 Hz and the frequencies do not have the same amplitude, it is audio analysis, more specifically words for command.
     
  4. BR-549

    Well-Known Member

    Sep 22, 2013
    2,472
    519
    How big is, and how do you fill your array with frequencies? I am by no means a DSP expert.

    But I am curious.......will the four highest frequencies identify the command?

    All four of the highest frequencies of the audio duration could be very weak. Will there be amplitude limits.

    Or do you mean the four frequencies have have the greatest amplitude over a period of time?
     
  5. MrChips

    Moderator

    Oct 2, 2009
    13,152
    3,695
    Let me see if I get this right.
    You have an array of sampled voltages, coming from audio frequency sound signal, 0-15kHz.
    You want to know the frequencies of the four highest amplitudes.

    What is your sampling frequency?

    This can be done using Fast Fourier Transformation (FFT).
    Arduino will be struggling doing this because of speed and memory limitations.
    Can you find FFT code that runs on Arduino?
     
Loading...