SKIP TO CONTENT
← ALL POSTS
BuildMay 13, 20262 MIN READ

Denoising Elephant Infrasound When Generic Denoisers Fail

Generic speech denoisers delete 10–20 Hz elephant rumbles along with the noise. The harmonic-structure pipeline that cleans field recordings without killing the call.

DSPPythonAudioMachine Learning

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 the off-the-shelf stuff fails

Speech and music denoisers assume 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. And the dominant field noise (generators, vehicles, aircraft) sits right on top of those low frequencies.

So a learned denoiser sees energy at 15 Hz, decides "that's rumble noise," and removes it. Call and all. You can't separate signal from noise by frequency band when they share the band.

separate by structure, not frequency

What actually 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:

  1. Ingestion. Parse the CSV/XLSX annotations, load each call segment at native sample rate, and pull the noise-only gaps between calls to profile the hum. A resolution check runs first to make sure the STFT bin width can even see a 10–20 Hz fundamental.
  2. STFT + HPSS. A harmonic/percussive separation pass surfaces the harmonic content and informs fundamental-frequency (f0) detection.
  3. Comb masking. Build a comb mask tuned to the detected f0 and its harmonics. Keep the energy at the call's harmonic series, attenuate everything between the teeth.
  4. Reconstruction, and this is the important bit: reconstruct from the original magnitude times the comb mask, plus the original phase. HPSS informs f0 detection but never gets reconstructed from. You keep the real spectrogram, just masked.
  5. noisereduce last. A final spectral-subtraction pass runs on the comb-masked waveform, not the raw one, so it's cleaning residue instead of fighting the call.

There's also optional multi-speaker separation for overlapping animals.

things that bit us

  • Trust the original phase. Reconstructing from an estimated phase smears the low end. Keep original magnitude and phase, only mask.
  • Order matters. Running noisereduce first 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 step after it 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. That's the part I'm proudest of. A hackathon weekend turned into something a field researcher can point at noisy tape and actually use.