Hydrofon wikiThe manual of an underwater listening app 文A eesti

Manual:Field trials

Other languages: eesti English

When we record with our own hydrophone in a test tank or open water, a bare WAV file is not enough. For honest evaluation we need to know the exact recording chain, settings, physical engine, and when the motor actually ran. This page summarises the field-trial protocol (docs/katse_manifest.md) and templates in docs/templates/ used by Karl, Aaron and Voldemar.

Templates and roles

The folder docs/templates/ holds three templates:

  • session_manifest.csv — one row per session (location, depths, hydrophone, preamplifier, sound card, gain, sample rate, AGC/filter state, people present, weather and water conditions). Karl fills this before the session with hardware details from Aaron and software settings from Voldemar.
  • trial_log.csv — one row per trial (trial_id, recording IDs, device ID, whether a motor ran, physical source ID, engine mode, distance, interferers, independent engine timeline, QC flags and notes). Updated immediately after each trial.
  • notes_template.txt — a ready-to-paste block for tab 2 (2 · Mark & save; see Reviewing and notes). It lists the 11 standard fields plus 9 uppercase manifest fields (SESSION_ID, TRIAL_ID, SESSION_ROLE, DEVICE_ID, SOURCE_INSTANCE_ID, PARENT_RECORDING_ID, AGC_FILTERS, ENGINE_TIMELINE, QC_FLAGS) so session and trial identifiers are stored inside every recording's JSON extra_fields.

Before you start

Copy the templates into your session working folder before the trial and delete the EXAMPLE- sample rows before entering real data.

Naming scheme

All identifiers are plain ASCII strings with no spaces so recordings can be grouped cleanly without data leakage in train/validation/test Splits (see also Labels and provenance):

ID Pattern Example When to create a new ID
session_id S<YYYY-MM-DD>-<location>-<NN> S2026-12-14-taltech-01 Every new day, new site, hydrophone repositioning or hardware-chain change.
trial_id T<NN> T01, T02, T03 Every separate trial run inside a session.
device_id DEV-<shortname>-<NN> DEV-taltech-loan01, DEV-diy-v1-01 Whenever the hydrophone, preamplifier or sound card (ADC) changes.
source_instance_id SRC-<type>-<NN> SRC-rcboat-elec-01, SRC-yamaha4hp-01 One ID per physical engine or boat. Reuse the same ID if that physical engine is tested again on another day; leave empty when no motor runs or the source is unknown.
recording_id rec:<WAV_stem> rec:2026-12-14_10-12-30 Created automatically by the app. Fill parent_recording_id only if a clip was cut from a longer recording.

Pasting notes_template.txt in the app

Keep one pre-filled copy of notes_template.txt open in a text editor during the session, with all session-wide fields already filled (SESSION_ID, SESSION_ROLE, DEVICE_ID, KOHT, HÜDROFONI SÜGAVUS (m), VEE SÜGAVUS (m), VÕIMENDUS (dB), SEADMED, AGC_FILTERS). After each recording, switch to tab 2, press Ctrl+A then Ctrl+V in the notes box, and edit only the trial-specific lines (TRIAL_ID, MOOTOR, MOOTORI TÜÜP, GAAS, KAUGUS (m), SOURCE_INSTANCE_ID, ENGINE_TIMELINE, QC_FLAGS, MÄRKUSED).

KOHT: ...
...
SESSION_ID:

TRIAL_ID:

SESSION_ROLE:

DEVICE_ID:

SOURCE_INSTANCE_ID:

PARENT_RECORDING_ID:

AGC_FILTERS:

ENGINE_TIMELINE:

QC_FLAGS:

Current code limitations

In tab 2, Copy fields from previous recording copies only the 11 standard fields, not extra_fields (SESSION_ID, DEVICE_ID, etc.), so always paste your pre-filled notes_template.txt directly. In addition, app/dataset.py currently groups own recordings by WAV filename stem (wav.stem) rather than by SESSION_ID/TRIAL_ID; wiring the manifest fields into dataset grouping is still pending.

Before, during and after each trial

Before the session

  1. Hardware and Windows (Aaron and Voldemar): switch off Windows AGC, noise suppression and Audio Enhancements. Fix the preamplifier gain and note the knob position or dB value.
  2. App settings (Voldemar): check 48000 Hz, PCM_24, the right input device, channel 0 and disk space. Run a 5–10 s listening check to confirm peaks stay below -1 dBFS (no red clipping warning) and a light tap shows on the spectrogram.
  3. Manifest and order (Karl): add the new row to session_manifest.csv, decide the alternating trial order and prepare the session's notes_template.txt.

During each trial (trial_id)

  1. Synchronise (Karl and Voldemar): start REC and an independent stopwatch or phone log at the exact same moment (“3-2-1-go”).
  2. Independent timeline (Karl): record the actual engine on/off times, throttle changes and interferers (pumps, waves, passing boats) from the stopwatch. Never use the detector's score or alarms as ground truth.
  3. Keep the chain steady (Aaron): do not change gain mid-recording. To change level, stop and start a new trial_id; if gain did change, add gain_changed to QC_FLAGS. Watch for cable touches, clipping and stream warnings.
  4. Quick markers (Voldemar, optional): you may tap 1, 2, 3 during recording, then set exact segments in tab 2 from the independent timeline.

Immediately after each trial

Stop REC and go straight to tab 2 (data/unsaved/ holds only one unsaved file). Paste notes_template.txt, fill in the trial fields, align state markers to the independent timeline, press Save and log rec:<stem> in trial_log.csv. At the end of the session, back up data/recordings/ together with both CSV files.

Independent timeline, alternating order and negative controls

  • Independent ground truth: engine_timeline / ENGINE_TIMELINE lists events in seconds from WAV start using dot decimals and semicolons, for example off@0.0;on@12.0;off@75.5 (write off@0.0 for a pure engine-off trial; an empty cell means no timeline was logged).
  • Alternating on/off order: alternate engine-off and engine-on trials across the session (for instance T01 off → T02 on → T03 off + interferer → T04 on → T05 off). Recording all controls first and all motor runs last confounds motor presence with preamp warm-up, battery voltage and ambient noise drift.
  • Engine-off negative controls: just as important as motor trials, because the false-event rate (false_events_per_hour = 3600 × N_false_events / T_negative) cannot be estimated without enough engine-free time. Record both quiet background (background) and known non-engine interferers (interference: pumps, splashes, waves, bubbles, voices).
  • SNR note: do not calculate signal-to-noise ratio simply from whole-file RMS without separating source and noise; instead report distance, gain, background and interferers honestly.

Quality-control flags (qc_flags) and unknown values

Record any technical issue in qc_flags / QC_FLAGS (semicolon-separated; leave empty for a clean trial). Never silently delete failed trials—log them.

Code When to add How to handle the recording
clipping Peak reaches -1 dBFS or the clipping warning appeared. Keep in the log, lower gain for the next trial, and mark the clipped span ignore in evaluation.
dropout Stream warning, dropped audio blocks or audible break. Documented data gap; never label the gap as negative.
cable_touch Physical knock or touch on hydrophone, cable or mount. Add a timestamped custom marker or bullet note (e.g. * cable_touch @ 68 s) so it can be marked ignore.
gain_changed Preamp or sound-card gain changed mid-recording. Note the timestamp in notes; start a new trial_id for new levels in future.
agc_or_filter_on OS AGC, noise suppression or an unknown filter was left on. Do not use for spectral or hardware comparisons; repeat with clean settings.
timeline_uncertain Stopwatch sync was lost or boundaries are off by more than 1 s. Exclude from onset-delay metrics; mark the boundary zone ignore.
unknown_source An unidentified distant boat or motor was audible. Never assume negative or invent a source_instance_id; mark that span ignore.
short_recording Recording ended too short for stable analysis windows. Keep visible in the log.

Unknown values rule: never guess or fabricate a missing number. Leave the cell empty in CSV files; in tab 2 leave blank after the colon or write - (both become null in JSON). For example, put an eye-estimated distance as a bullet in NOTES while leaving DISTANCE (m) blank, and write an uncalibrated gain knob position into gain_setting and EQUIPMENT while leaving GAIN (dB) blank.

Pilot (pilot) vs held-out final session (final_test)

Aspect Pilot / development session (pilot / dev) Held-out final session (final_test)
Purpose Check the recording chain, gain, noise floor and workflow; test frozen models zero-shot and iterate if needed. Honest independent final evaluation under the evaluation contract.
Separation First round of trials. A separate later session (new session_id, separate deployment or day) never used for training, threshold picking or rule tuning.
Freeze rule Changes are allowed and logged. Model, features, threshold and event rule must be frozen before running evaluation.

If any change is made to the model, features, threshold or event rule after seeing final_test results, that session immediately becomes a dev session (update session_role) and a new independent session is required for final testing.

See also

This page has not been saved yet.

The Hydrofon project · volli.page