Loading...
Searching...
No Matches
Go to the documentation of this file.
18#ifndef FFT_PRECISION_H
19#define FFT_PRECISION_H
24#define FASTLED_FFT_FLOAT 1
25#define FASTLED_FFT_DOUBLE 2
26#define FASTLED_FFT_FIXED16 3
29#ifndef FASTLED_FFT_PRECISION
30#define FASTLED_FFT_PRECISION FASTLED_FFT_FIXED16
34#if FASTLED_FFT_PRECISION == FASTLED_FFT_FLOAT
36#elif FASTLED_FFT_PRECISION == FASTLED_FFT_DOUBLE
38#elif FASTLED_FFT_PRECISION == FASTLED_FFT_FIXED16
41 #error "Invalid FASTLED_FFT_PRECISION value"
47#if FASTLED_FFT_PRECISION == FASTLED_FFT_FLOAT
48 #define FFT_COS(x) fl::cosf((float)(x))
49 #define FFT_SIN(x) fl::sinf((float)(x))
50 #define FFT_EXP(x) fl::expf((float)(x))
51 #define FFT_LOG(x) fl::logf((float)(x))
52 #define FFT_SQRT(x) fl::sqrtf((float)(x))
53 #define FFT_POW(x,y) fl::powf((float)(x), (float)(y))
54#elif FASTLED_FFT_PRECISION == FASTLED_FFT_DOUBLE
55 #define FFT_COS(x) fl::cos((double)(x))
56 #define FFT_SIN(x) fl::sin((double)(x))
57 #define FFT_EXP(x) fl::exp((double)(x))
58 #define FFT_LOG(x) fl::log((double)(x))
59 #define FFT_SQRT(x) fl::sqrt((double)(x))
60 #define FFT_POW(x,y) fl::pow((double)(x), (double)(y))
61#elif FASTLED_FFT_PRECISION == FASTLED_FFT_FIXED16
63 #define FFT_COS(x) fl::cos((double)(x))
64 #define FFT_SIN(x) fl::sin((double)(x))
65 #define FFT_EXP(x) fl::exp((double)(x))
66 #define FFT_LOG(x) fl::log((double)(x))
67 #define FFT_SQRT(x) fl::sqrt((double)(x))
68 #define FFT_POW(x,y) fl::pow((double)(x), (double)(y))