Elecom: Elephant Call Isolation & Analysis

Inspiration

Elephants communicate in infrasound — frequencies so deep the human ear cannot detect them. They've been having conversations across kilometers of African savanna for millions of years, coordinating migrations, warning each other of danger, calling out to lost family members.

ElephantVoices spent decades capturing these voices. But the recordings were being buried under the noise of human civilization encroaching on elephant habitat — generators, vehicles, airplanes drowning out one of nature's most sophisticated communication systems.

That tension felt deeply personal. We are simultaneously the problem and the solution. Our machines create the noise. Our technology can recover what was lost.

There's something humbling about building a signal processing pipeline and realizing what it's actually doing — clearing away human interference so an elephant's voice can finally be heard clearly.

Elecom is a small act of listening. The elephants have always been talking. We just needed to learn how to listen.

🐘 The Problem

ElephantVoices has spent decades recording elephant vocalizations in the wild. But elephant rumbles live at 10–20 Hz — completely inaudible to humans. Every time a vehicle drives by, a plane flies overhead, or a generator kicks on, the recording becomes scientifically unusable.

212 calls. 44 recordings. Real data from Dr. Mickey Pardo at ElephantVoices. All degraded by noise.

🔬 What Elecom Does

Elecom is a production-grade bioacoustics signal processing pipeline that:

  1. Detects the elephant's unique harmonic signature using the YIN pitch estimation algorithm
  2. Cleans noise using a 3-tier intelligent masking system
  3. Analyzes every call with 16 acoustic features
  4. Scores each recording with a cleanability metric

⚙️ How The Pipeline Works

The pipeline runs in 6 steps:

  1. Load & Segment — pull WAV files from ElephantVoices Google Drive, segment by labeled timestamps
  2. Noise Profiling — extract 2-second noise reference window before each call
  3. Spectral Subtraction — remove broadband noise floor using adaptive Wiener filtering
  4. 3-Tier Harmonic Masking:
    • Tier 1: YIN pitch estimation → harmonic mask (when f0 reliable)
    • Tier 2: CV geometric band detection (when YIN fails)
    • Tier 3: Pretrained ResNet18 CNN feature extraction (fallback)
  5. Phase-Aligned Reconstruction — rebuild clean audio preserving original phase
  6. Feature Extraction — compute 16 metrics including f0, HNR, SNR improvement, FM depth, spectral centroid, and cleanability score

🧠 The Key Scientific Insight

Elephant harmonics never cross each other. Noise harmonics do.

That's how the algorithm knows exactly what to keep and what to remove. Each noise type gets different treatment:

  • Generator → notch filters at 50Hz harmonics + harmonic masking
  • Vehicle → adaptive frequency detection + spectral subtraction
  • Airplane → broadband masking + noisereduce library

🌿 The Dashboard

The Herd Map visualizes every call as an elephant silhouette on a Frutiger Aero savanna scene. Each elephant's glow shows signal quality. Click any elephant to open the Herd Field Station showing before/after spectrograms, audio playback, and Gemini 2.5 Flash behavioral analysis.

📊 Results

  • 15 calls processed across 3 noise types
  • 0 failures
  • Average SNR improvement: +10.8 dB
  • Average HNR improvement: +1.26 dB
  • 100% YIN detection rate across all noise categories

What I learned

  • How elephant infrasound works scientifically and why it's so hard to isolate from noise
  • Implementing YIN pitch estimation and harmonic masking from scratch
  • Building a 3-tier fallback system combining signal processing, computer vision, and deep learning
  • That the hardest part of bioacoustics isn't the algorithm, it's the data pipeline
  • How to prompt AI tools (Antigravity, v0, Codex) effectively as a force multiplier

Challenges

  • Google Drive rate limiting blocked bulk downloads, solved with individual file downloads and caching
  • YIN pitch estimation fails on heavily noisy segments, solved with 3-tier masking fallback system
  • Vehicle noise overlaps directly with elephant frequencies, solved with adaptive noise frequency detection using Welch power spectrum analysis
  • Git history conflicts from merging separate frontend and backend repos mid-hackathon

🔭 What's Next

  • Process all 212 calls in the full dataset
  • Train a lightweight CNN on cleaned outputs
  • Deploy as an open API for bioacoustics researchers
  • Integrate with ElephantVoices annotation workflow

Every recording we recover expands the world's largest elephant communication database.

The elephants have always been talking. Now we can finally listen.

Built With

Share this project:

Updates