Logo of eSonarLab

eSonarLab

Near-inaudible sonar (18-22 kHz) and room radar for tablets: from the echoes and the ARCore/ARKit pose it draws the room box (walls, ceiling, large furniture). On Windows, with a simulated room.

Utilities Android Windows
Screenshot of eSonarLab

What it is

eSonarLab turns a tablet into a sonar and a room radar. It emits near-inaudible chirps, between 18 and 22 kHz, through the speaker, listens to the echoes with the microphone and, using the position given by the device's augmented reality, places each echo in space until it works out the "box" of the room: walls, ceiling and large furniture. It is a lab app for exploring what can be measured with the hardware of an ordinary tablet.

How it works

The Flutter interface talks to a Rust core through FFI: a JSON request goes in and a JSON response comes out. The pose comes from ARCore or ARKit through two small in-house plugins, with no camera view. Without augmented reality, the app works in distance-only mode.

The core processes the sound in four stages:

  1. Signal: a linear chirp with a Tukey window and a correlation by regularised deconvolution, from which the envelope is extracted without the carrier.
  2. Sync: each chirp is located in the continuous recording by its direct path, with no need to know the latency, and clock drift is corrected.
  3. Profile: the envelope is converted to distance, the blind zone is applied and echoes are extracted with parabolic interpolation.
  4. Planes: a Hough transform over direction and distance, limited to a cone towards where the tablet is facing, proposes walls and ceiling; they are then refined by least squares, the floor is set by augmented reality and second-order echoes are discarded.

At 20 kHz walls behave like mirrors: each echo gives the perpendicular distance to the wall. That is why the room box comes out well and corners stand out as retroreflectors.

Main features

  • Sonar screen with a PPI display: beam on the real heading with a trail, recent and scan echoes, and estimated box.
  • A-scan with the echo envelope against distance.
  • Emission settings: band, chirp length, rate and volume.
  • Calibration that subtracts the speaker-to-microphone coupling and reduces the blind zone.
  • Scan recording to gradually complete the room box and its coverage.
  • Estimation of walls, ceiling, corners and large flat furniture.
  • Simulated room to test the whole process without hardware: a living room with sofa, table and diffusers, with speaker directivity and air absorption.
  • Warning that dogs, cats and some young people can hear that band, with advice to lower the volume.

Technology

Interface in Flutter and Dart with the shared theme of the in-house apps. Core in Rust with rustfft for the transforms, cpal for audio, rtrb for the queues between threads and serde for the JSON exchange; unsafe code is limited to the FFI boundary and the Android binding. The pose comes from ARCore in Kotlin and ARKit in Swift.

Limits

Resolution between echoes is about 4 to 8 cm, the near blind zone is 0.3 to 0.5 m and the useful range is 5 to 6 m. Fabrics absorb the signal and the echo comes from the wall behind. The app assumes vertical walls and a horizontal ceiling, so it does not detect sloping surfaces. Results depend on the device's speaker and microphone reaching 20 kHz.

Requirements

Not part of the app: installed separately from their official websites, each under its own licence.

  • ARCore (Android) or ARKit (iPad) for the room radar; without them it only measures distance