Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: FFT example code for use with Arduino UNO

  1. #1

    FFT example code for use with Arduino UNO

    Hi

    Could anyone pls help me with modifying the Teensy FFT codes for use with Arduino code ?

    The LineIn in the audio board could be replaced withe the analog port in the audio board.
    (i.e.) The output from the pre-amplifier is connected to any of the Analog ports in the Arduino board.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    Arduino Uno is far too slow to run that code.

  3. #3
    Yeah....
    But just a simple program that can get Data croon the analog port and represent it as fft data......

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,565
    Quote Originally Posted by funfrancis View Post
    Yeah....
    But just a simple program that can get Data croon the analog port and represent it as fft data......
    It makes more sense to use a Teensy, it's not worth the time and effort to make it work on Uno

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    Quote Originally Posted by funfrancis View Post
    Yeah....
    But just a simple program ... ......
    Ok then, go forth and write this simple program. It's supposed to be simple, right?

  6. #6
    I need your help in writing the program

    Also could you provide me the updated FFT library for the Teensy as I get "missing library errors" as I try to run them.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    The FFT for Teensy is part of the Teensy Audio Library, which comes with the Teensyduino installer. Just run the installer, and in Arduino select Teensy 3.2 from Tools > Boards. Then you will find the library under File > Examples > Audio.

    Please watch the tutorial video. FFT is shown starting at 34:56.

    http://www.pjrc.com/teensy/td_libs_Audio.html

    All of the code used in the video can be found in File > Examples > Audio > Tutorials.

    It only works on Teensy 3.2. Arduino Uno is incompatible.

  8. #8
    Sure, I'll get it running!!!

  9. #9
    Hi

    Could you pls tell me the formula for the FFT curve.

  10. #10
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,145
    Quote Originally Posted by funfrancis View Post
    Hi

    Could you pls tell me the formula for the FFT curve.
    https://en.wikipedia.org/wiki/Fast_Fourier_transform

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    Also here: http://www.dspguide.com/ch31.htm

    But really, why? Your scientific calculator has SIN, COS, TAN buttons... do you spend weeks or months studying Taylor series and CORDIC algorithms before using them? The internal details of FFT are horribly complicated.

    @funfrancis - You've posted dozens of absolute beginner level questions, both here on on Arduino's forum. Really, it's ok to be a beginner. Everyone has to start somewhere. But this is *not* beginner level material. If you're still struggling with the very basic aspects of programming, like for loops, do not waste your time (and the time of numerous people on forums) with extremely advanced stuff that you have no hope of mastering until you develop your own programming skills much more.

  12. #12
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,145
    Quote Originally Posted by PaulStoffregen View Post
    Also here: http://www.dspguide.com/ch31.htm

    But really, why? Your scientific calculator has SIN, COS, TAN buttons... do you spend weeks or months studying Taylor series and CORDIC algorithms before using them? The internal details of FFT are horribly complicated.
    I assume this was for me.

    Well, I consider the Fourier decomposition of arbitrary waveforms as one of the fundamental theorems in mathematics and IMO, everyone trying to do signal processing, MUST at least once in their live, programmed a DFT and understand a the implementation of a Cooley-Tukey radix two algorithm. OK, most EE will do that in early curses, but everyone else should not be afraid to try to understand at least the mathematical language behind a Fourier series.

    To your question: Yes, I do that indeed, as it was part of my job to improve existing signal processing algorithms or to apply them in areas that differ from the areas they were developed for.

    Anyhow, you are correct, to use an FFT one does not need to know the details but only a good cookbook, but funfrancis asked for a formula and even Wikipedia can give the formula plus a lot of references.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •