Domain repetitionilla hexagridi
This commit is contained in:
@ -71,8 +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]
|
||||
float db = 20.0f * log10f(mag + 1e-6f); // Decibels
|
||||
float normalized = (db + 60.0f) / 60.0f; // [0,1]
|
||||
freq_out[i] = mag;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user