Application

Desktop Analysis Software

In parallel, a desktop app capable of analysing and visualizing data in real time was to be developed. The app was also designed to reflect our project's mission, ensuring accessibility to all computer platforms, while still being capable of detailed scientific analysis of both voltage signals and ultrasonic data.

Audio Analysis Mode

FFT Spectrum View

The main window displays the FFT spectrum of the current frame.

  • X-axis: frequency (20–80 kHz)
  • Y-axis: magnitude (volts)

A frame slider allows navigation through the recording. Playback controls can automatically advance frames.

FFT Spectrum View
Microphone Normalization

PlantLeaf can compensate for the non-flat frequency response of the SPU0410LR5H-QB microphone.

Enable:

Analysis → Normalize FFT Window

The corrected spectrum appears as a red curve over the raw spectrum.

FFT Spectrum View
Inverse FFT (iFFT)

The iFFT tool reconstructs the time-domain waveform from FFT magnitude and phase data, allowing analysis with higher temporal resolution.

The window shows:

  • top panel: FFT spectrum
  • bottom panel: reconstructed waveform (512 samples)
FFT Spectrum View
Waveform characterization

Envelope and Decay Analysis

Additional tools are available for waveform characterization:

These measurements help identify genuine ultrasonic click events.

Envelope and Decay Analysis
Detection pipeline

Automatic Click Detection

The PlantLeaf app includes a 4-stage algorithm capable of detecting ultrasonic cavitation clicks in real time. It was calibrated by manually analysing over 50 hours of recordings across three experimental conditions — empty room, unstressed plant, and mechanical-stressed plant — and all its parameters can be fine-tuned to adapt to different recording setups.

Automatic Click Detection Algorithm
1
Energy gate + noise burst rejection

Each 2.56 ms frame is scored by its average FFT energy. Only frames that exceed the background mean by more than 5 standard deviations are passed forward. Any consecutive above-threshold frame group longer than 4 frames is discarded entirely, since a genuine cavitation click lasts at most ~2 ms.

2
FFT amplitude and spectral shape filters

The FFT spectrum is normalised to correct for the microphone's non-flat frequency response. The peak bin must exceed 0.85 mV, and the Spectral Peak Ratio (SPR) must stay below a threshold. A real click spreads energy broadly across many bins (low SPR); electrical interference concentrates it in 1–3 bins (high SPR) and is rejected.

3
Six-criterion temporal validation

Surviving frames are reconstructed via inverse FFT and their Hilbert envelope is computed. All six criteria must pass:

Minimum amplitude — peak must reach at least 130 µV.
Silence before click — signal before peak must be near noise floor.
Energy decay — first quarter of post-peak window must hold ≥2× energy of last quarter.
Onset asymmetry — fast onset and slower decay; symmetric spikes are rejected.
Physical decay time (τ) — must be between 0.045 ms and 1.3 ms.
Decay quality (R²) — log-linear regression of post-peak envelope must give R² > 0.45.
4
Deduplication

When a click straddles two consecutive frames, only the frame with the higher peak amplitude is kept, eliminating any double counts.

Result

Tested on ten hours of recording in an empty room, the algorithm produced a false detection rate of just 0.7 clicks/hour.

For full parameter details and the mathematical derivations, see the technical documentation on GitHub:

GitHub Documentation