diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-06 18:31:14 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-06 18:31:14 +0100 |
| commit | 69fd884aaec5523871696149cd39aff6b10c9397 (patch) | |
| tree | f76401c7fbea84910e19fdc17be363eb35115a7f /doc/BUILD_OPTIMIZATION_PROPOSAL.md | |
| parent | 819394afe35a754f8408a98dc3f42e58ef5f69f9 (diff) | |
IMPLEMENTATION:
- Added --normalize flag to spectool analyze command
- Default target RMS: 0.15 (customizable via --normalize [rms])
- Two-pass processing: load all PCM → calculate RMS/peak → normalize → DCT
- Peak-limiting safety: prevents clipping by limiting scale factor if peak > 1.0
- Updated gen_spectrograms.sh to use --normalize by default
ALGORITHM:
1. Calculate original RMS and peak of input audio
2. Compute scale factor to reach target RMS (default 0.15)
3. Check if scaled peak would exceed 1.0 (after windowing + IDCT)
4. If yes, reduce scale factor to keep peak ≤ 1.0 (prevents clipping)
5. Apply scale factor to all PCM samples before windowing/DCT
RESULTS:
Before normalization:
- RMS range: 0.054 - 0.248 (4.6x variation, ~13 dB)
- Some peaks > 1.0 (clipping)
After normalization:
- RMS range: 0.049 - 0.097 (2.0x variation, ~6 dB) ✅ 2.3x improvement
- All peaks < 1.0 (no clipping) ✅
SAMPLES REGENERATED:
- All 14 .spec files regenerated with normalization
- High dynamic range samples (SNARE_808, CRASH_DMX, HIHAT_CLOSED_DMX)
were peak-limited to prevent clipping
- Consistent loudness across all drum and bass samples
GITIGNORE CHANGE:
- Removed *.spec from .gitignore to track normalized spectrograms
- This ensures reproducibility and prevents drift from source files
handoff(Claude): RMS normalization implemented and working. All samples now have consistent loudness with no clipping.
Diffstat (limited to 'doc/BUILD_OPTIMIZATION_PROPOSAL.md')
0 files changed, 0 insertions, 0 deletions
