View Full Version : FFT example code for use with Arduino UNO

funfrancis

02-20-2016, 11:26 AM

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.

PaulStoffregen

02-20-2016, 03:20 PM

Arduino Uno is far too slow to run that code.

funfrancis

02-20-2016, 03:28 PM

Yeah....

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

Frank B

02-20-2016, 03:54 PM

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

PaulStoffregen

02-20-2016, 05:39 PM

Yeah....

But just a simple program ... ......

Ok then, go forth and write this simple program. It's supposed to be simple, right?

funfrancis

02-20-2016, 11:13 PM

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.

PaulStoffregen

02-20-2016, 11:18 PM

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.

funfrancis

02-21-2016, 12:16 AM

Sure, I'll get it running!!!

funfrancis

03-05-2016, 11:11 AM

Hi

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

Hi

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

https://en.wikipedia.org/wiki/Fast_Fourier_transform

PaulStoffregen

03-06-2016, 07:00 PM

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.

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.

Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.