Exponential smoothing FFT:n arvoille. Rauhoittaa piikkien pomppimista.

This commit is contained in:
2025-07-15 17:15:49 +03:00
parent cc6619f9a0
commit 34230e18e5
2 changed files with 10 additions and 3 deletions

View File

@ -71,7 +71,8 @@ void compute_fft(float* time_data, float* freq_out) {
for (int i = 0; i < FFT_SIZE / 2; ++i) {
float mag = sqrtf(real[i] * real[i] + imag[i] * imag[i]) / FFT_SIZE;
//float db = 20.0f * log10f(mag + 1e-6f); // Decibels
//float normalized = (db + 60.0f) / 60.0f; // [0,1]
freq_out[i] = mag;
}
}