# Original noise-gate listening examples

These Saturalabs audio assets are dedicated to the public domain under CC0 1.0:
https://creativecommons.org/publicdomain/zero/1.0/

They contain original synthesized tones, not speech, third-party recordings, AI
separation outputs, or a performance comparison between cleanup products.

## Reproduce

From the repository root with Node/tsx and FFmpeg/FFprobe available:

    node --import tsx scripts/generate-gate-examples.ts

Source: mono, 48 kHz, four seconds. A 3 kHz background sine has peak 0.025;
a 440 Hz wanted sine has peak 0.2 and plays in two 0.75-second bursts starting
at 0.5 and 2 seconds. Bursts have 20 ms linear fades; the whole recording has
20 ms outer fades. Samples are exported as 16-bit PCM WAV with the existing
writer. No clipping occurs.

The processed WAV is generated from that integer source using this FFmpeg filter:

    agate=threshold=0.06:ratio=10:attack=5:release=80:detection=rms:range=0.001

The threshold is a linear amplitude setting. Attack/release are milliseconds.
This is an actual level-based gate, not an envelope drawn from the known burst
schedule. FFmpeg writes the result as 16-bit PCM, preserving the four-second timeline.
Its WAV can include a larger header than the basic original WAV.

Primary filter documentation:
https://ffmpeg.org/ffmpeg-filters.html#agate

## Verify the teaching point

The generator probes actual output format/frame count and decodes both WAVs.
It measures each known tone by a sinusoidal projection in fixed windows:

- 0.1–0.3 seconds: background alone; gated level must fall by more than 20 dB.
- 0.75–1 seconds: steady overlap; background and wanted-tone changes must each
 stay within 1 dB of the original at the same player gain.

Actual measurements and byte sizes are in measurements.json. The numbers apply
to these controlled fixtures and settings, not arbitrary recordings. They show
why a gate can quiet pauses while leaving a competing sound during louder audio.
They do not establish speech intelligibility, a source-separation score, or
which cleanup product is best. Audition real recordings separately.
