Denoising Elephant Infrasound When Generic Denoisers Fail
Generic speech denoisers destroy 10–20 Hz elephant rumbles. A harmonic-structure pipeline — STFT, HPSS, comb masking — that cleans field recordings without killing the call.
Point a normal denoiser at an elephant field recording and it will happily delete the elephant. That's the whole problem ElephantVoices set out to solve.
Why off-the-shelf denoisers fail here
Speech and music denoisers are trained on the assumption that the signal lives roughly where human hearing does and the noise is broadband hiss. Elephant communication breaks both assumptions:
- The fundamentals are infrasonic — roughly 10–20 Hz — with harmonics stretching up into the kHz range.
- The dominant noise (generators, vehicles, aircraft) sits right on top of those low frequencies.
A learned denoiser sees energy at 15 Hz, decides "that's rumble noise," and removes it — taking the call with it. You can't separate signal from noise by frequency band when they share the band.
The lever: harmonic structure, not frequency
The thing that distinguishes an elephant rumble from generator hum isn't where it sits — it's that the rumble is harmonic (a fundamental plus integer multiples), while engine noise is comparatively inharmonic and stationary. So the pipeline separates by structure:
- Ingestion — parse CSV/XLSX annotations, load each call segment at native sample rate, and pull the noise-only gaps between calls to profile the generator hum. A resolution check makes sure the STFT bin width is fine enough to even see a 10–20 Hz fundamental before anything else runs.
- STFT + HPSS — a harmonic/percussive source separation pass to surface the harmonic content and inform fundamental-frequency (f0) detection.
- Comb masking — build a comb mask tuned to the detected f0 and its harmonics, so we keep energy at the call's harmonic series and attenuate everything between the teeth.
- Reconstruction — and this is the important bit: reconstruct from the original magnitude × the comb mask + the original phase. HPSS informs f0 detection but does not get reconstructed from — you keep the real spectrogram, just masked.
- noisereduce last — a final spectral-subtraction pass runs on the comb-masked waveform, not the raw one, so it's cleaning residue rather than fighting the call.
Optional multi-speaker separation handles overlapping animals.
A couple of things that bit us
- Trust the original phase. Reconstructing from a modified/estimated phase smears the low end. Keep original magnitude and phase; only mask.
- Order matters. Running
noisereducefirst nukes the infrasound before the comb mask can protect it. Last, not first. - Verify frequency resolution up front. If your STFT can't resolve 15 Hz, every downstream step is theater.
It ships as a FastAPI service with a small React + Vite UI, and the pipeline has since been used in real bioacoustic research — which is the part I'm proudest of. A hackathon weekend that turned into something a field researcher can actually point at noisy tape and use.
Related project
ElephantVoices Denoiser