Bat echolocation sonar

A bat hunts a moth in a cave with call beams, sonar-equation echoes and Doppler shifts.

Switch to 2D

Presets

Playback

Bat and call

Camera

Layers

Quality

Model check

The science

What is modelled

A bat flies through a cave and finds obstacles and a moth with nothing but its own calls. Each call is a narrow beam; each echo is judged by its round-trip time, its level against a threshold that rises with background noise, and its Doppler shift.

Equations

  • Range from time of flight: R = c t / 2, c = 343 m/s.
  • Sonar equation for a point-like target: EL = SL - 2 (20 log10 R + αR) + TS + 2 D(ψ). SL is the call level at 1 m, α the air absorption in dB/m, TS the target strength and D(ψ) the beam gain in dB. An echo is heard when EL exceeds the threshold (15 dB + 0.4 x the noise setting).
  • Beam: the mouth is a circular piston of radius 4 mm, so the pressure gain off axis is 2 J1(x)/x with x = k a sinψ. Higher frequency means a narrower beam. The same pattern is used for transmitting and listening.
  • Moth: σ = π a2 for a 12 mm equivalent radius (scaled by (ka)4 when ka < 1) and TS = 10 log10(σ/4π). Cave formations are vertical cylinders with TS = 10 log10(a l2 / 2λ), the lit length l limited to the Fresnel length. Walls act as flat mirrors (image source, -3 dB).
  • Two-way Doppler for a moving bat and a moving moth: f' = f0 (c + vt)(c + vb) / ((c - vb)(c - vt)) with closing speeds vb and vt.
  • Range ambiguity: an echo that returns after the next call has gone out cannot be assigned to its call, so only targets closer than c / (2 x call rate) are used. This is why real bats raise the call rate only when the prey is close.

Checks run in the page

  • The Doppler formula equals a direct timing of two wavefronts through emission, reflection from a receding target and return.
  • The exact ray-cylinder range equals the analytic value and c t / 2.
  • The detection range found by bisection agrees with the rule that decides detections in the flight.
  • At the half-power angle the beam pattern gives 0.5, and the integral Bessel function matches the power series.

Honest simplifications

  • Absorption follows a smooth fit (1.3 dB/m at 40 kHz, growing as f1.4), close to published values at 20 C and 50 % humidity but not exact. Real target strengths depend on shape, orientation and surface; the numbers here are order-of-magnitude.
  • A wall echo comes only from the beam axis; there are no multiple reflections and no clutter echoes from the rough rock.
  • Steering uses a simple map of 5 x 3 sectors and pure pursuit when a moth echo is fresh; real bats also use call shape, frequency sweeps and a 3D memory of the cave. Bearing is the beam direction plus random error, not true binaural timing.
  • The rings are drawn at 9 m/s so they can be seen; all numbers use the true speed of sound. Wing flapping is cosmetic. Real bats compensate Doppler shifts by shifting the call frequency; here the shift is only displayed.

What to try

  • Raise the frequency to 90 kHz: the beam narrows to about 13 degrees and the detection range collapses because of air absorption.
  • Use the feeding buzz preset: the unambiguous range drops to about 1 m.
  • Raise the noise: the faint moth echo disappears first.
Loading model...
Loading Blender model...
Echo level vs range
Beam pattern of the call
Moth detection range vs call frequency
Made with 🟠 Blender · Three.js