70 {
71
72
73
74 out->clear();
75
78
83 const float delta_f = (maxf - minf) /
m_cq_cfg.bands;
84
85 for (
int i = 0; i <
m_cq_cfg.bands; ++i) {
86 i32 real = cq[i].r;
87 i32 imag = cq[i].i;
88 float r2 = float(real * real);
89 float i2 = float(imag * imag);
90 float magnitude = sqrt(r2 + i2);
91 float magnitude_db = 20 * log10(magnitude);
92 float f_start = minf + i * delta_f;
93 float f_end = f_start + delta_f;
96
97 if (magnitude <= 0.0f) {
98 magnitude_db = 0.0f;
99 }
100
101
102
103
104 out->bins_raw.push_back(magnitude);
105 out->bins_db.push_back(magnitude_db);
106 }
107 }
#define FASTLED_STACK_ARRAY(TYPE, NAME, SIZE)
void apply_kernels(kiss_fft_cpx fft[], kiss_fft_cpx cq[], struct sparse_arr kernels[], struct cq_kernel_cfg cfg)
void kiss_fftr(kiss_fftr_cfg st, const kiss_fft_scalar *timedata, kiss_fft_cpx *freqdata)
#define FASTLED_UNUSED(x)