-
Notifications
You must be signed in to change notification settings - Fork 159
Optimizations
Existing optimziations are focused on improving the algorithm performance by improving speed and most of them are not mutually exclusive (Several can be used simultaneously). The only exception is FFT_SQRT_APPROXIMATION
and sqrt_internal
Replaces most divisions in the code, instead using a multiplication by a reciprocal value. This is faster but prone to precision errors caused by the binary representation of decimal values.
When including the library, add #define FFT_SPEED_OVER_PRECISION
before #include <arduinoFFT.h>
Allows specifying which function to use for the square root operations.
When including the library, add #define sqrt_internal sqrt
or #define sqrt_internal sqrtf
before #include <arduinoFFT.h>
. If nothing is specified, sqrt
is selected by default.
This definition supersedes the sqrt_internal
definition. Uses a square root approximation based on the "Quake 3 fast inverse square root" instead of calling the sqrt() function. More information here
When including the library, add #define FFT_SQRT_APPROXIMATION
before #include <arduinoFFT.h>
Stores factors for the FFT computation along with the program instead of computing them as required. Only has effect on AVR architecture devices.
When including the library, add #define USE_AVR_PROGMEM
before #include <arduinoFFT.h>
Does bit reversal on both the real and imaginary parts of the input data. Without this definition, the default behaviour is to assumed that the imaginary part of the input data is irrelevant, which reduces processing time. Add this definition to override that.
When including the library, add #define COMPLEX_INPUT
before #include <arduinoFFT.h>