2 #include "AudioLibs/AudioFFT.h"
7 FFTDisplay *selfFFTDisplay =
nullptr;
8 #if defined(USE_CONCURRENCY)
21 selfFFTDisplay =
this;
37 magnitudes.resize(p_fft->
size());
38 for (
int j = 0; j < p_fft->
size(); j++) {
50 if (idx >= magnitudes.size()) {
51 idx = magnitudes.size() - 1;
53 total += magnitudes[idx];
58 int getMagnitudeScaled(
int x,
int max) {
60 static_cast<float>(max));
62 LOGD(
"fft_max_magnitude too small: current value is %f",
getMagnitude(x))
65 return min(result, max);
70 selfFFTDisplay->loadMangnitudes();
77 void loadMangnitudes() {
79 #if defined(USE_CONCURRENCY)
80 LockGuard guard(fft_mux);
82 for (
int j = 0; j < p_fft->
size(); j++) {
84 magnitudes[j] = value;