ApproxFFT: Fastest FFT Function for Arduino

This function performs FFT with very good speed while maintaining accuracy.

Dec 23, 2020

28051 views

1 respects

Components and supplies

1

Arduino Mega 2560

Apps and platforms

1

Arduino IDE

Project description

Code

ApproxFFT

arduino

This code performs FFT with good speed

ApproxFFT.ino

arduino

ApproxFFT

arduino

This code performs FFT with good speed

ApproxFFT.ino

arduino

ApproxFFT_V2_060521

arduino

Comments

Only logged in users can leave comments

carloneb

a month ago

Thanks for your work, I'm building a mini oscilloscope with stm32 (bluepill) and it seems to work well, now I'm implementing the FFT function with your last ApproxFFT_V2_060521. Everything seems to work with 1024 samples. With a sinusoid (at various test frequencies) I can correctly plot the fundamental frequency and the relative maximum peak. What I don't understand is that with a square wave input, in addition to the fundamental, I don't see all the "infinite" harmonics, what you see is similar to the plot of a sinusoidal wave. Am I doing things wrong? Do you have any suggestions? Thanks

gusto2

2 months ago

Thank you very much for the inspiration.

Anonymous user

2 years ago

interesting, i wonder how much could this or EasyFFT be expanded with Teensy 4.1

Anonymous user

2 years ago

This is great! One note though, I think there is an error on line 70 of ApproxFFT.ino and ApproxFFT above (but fixed in ApproxFFT V2). I think: `out_r[i]=0; out_r[i]=0;` should be: `out_r[i]=0; out_im[i]=0;`. In the current code, out_im[] never gets initialized, and it hangs without throwing any warnings. Otherwise, awesome code! Thanks for sharing!

Anonymous user

2 years ago

I like this efficient code! It would be good to not use native data types, so the type size is the same on all boards, so don't use int, but int16_t and so on..

Anonymous user

3 years ago

interesting, i wonder how much could this or EasyFFT be expanded with Teensy 4.1

Anonymous user

4 years ago

Nice. Does not use machine code and seems easily portable.