Feat: documentation, UI/UX
This commit is contained in:
@@ -176,7 +176,7 @@ impl SpectrumAnalyzer {
|
||||
let avg = sum / (hi - lo) as f32;
|
||||
let amplitude = avg / (FFT_SIZE as f32 / 4.0);
|
||||
let db = 20.0 * amplitude.max(1e-10).log10();
|
||||
*mag = ((db + 60.0) / 60.0).clamp(0.0, 1.0);
|
||||
*mag = ((db + 80.0) / 80.0).clamp(0.0, 1.0);
|
||||
}
|
||||
|
||||
output.write(&bands);
|
||||
|
||||
Reference in New Issue
Block a user