@audio/denoise 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +377 -157
  2. package/index.d.ts +2 -0
  3. package/index.js +1 -0
  4. package/package.json +14 -13
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Try it in the browser: [Noise remover](https://audiojs.dev/util/denoise/). Runs on this package, nothing is uploaded.
4
4
 
5
- Single-pass noise reduction. 13 specialised methods + an auto-classifier.
5
+ Single-pass noise reduction. 17 specialised methods + an auto-classifier.
6
6
 
7
7
  | | Domain | Targets | Quality | CPU | Best for |
8
8
  |---|---|---|---|---|---|
@@ -14,15 +14,16 @@ Single-pass noise reduction. 13 specialised methods + an auto-classifier.
14
14
  | [omlsa](#omlsa) | freq | broadband non-stationary | ★★★★ | high | speech in changing noise |
15
15
  | [declick](#declick) | time | impulses | ★★★★ | medium | vinyl ticks, edit clicks, mouth clicks |
16
16
  | [decrackle](#decrackle) | time | dense impulses | ★★★ | medium | shellac crackle |
17
- | [declip](#declip) | time + freq | hard clipping | ★★★★ | high | clipped speech and music, rails found by itself |
17
+ | [declip](#declip) | time + freq | hard clipping, soft saturation | ★★★★ | high | clipped speech and music, rails found by itself, also through MP3/AAC; saturation's curve fitted blind |
18
18
  | [dewind](#dewind) | freq | wind, LF rumble | ★★★ | medium | wind under a voice, its harmonics kept |
19
- | [deplosive](#deplosive) | time | LF bursts | ★★★ | low | mic plosives (p, b) |
19
+ | [deplosive](#deplosive) | time | LF bursts | ★★★★ | low | mic plosives (p, b) |
20
20
  | [deesser](#deesser) | time | sibilance | ★★★★ | low | voice (s, sh) |
21
- | [debreath](#debreath) | time | inter-word noise | ★★★ | low | breath / hiss in pauses |
21
+ | [debreath](#debreath) | time | breaths | ★★★★ | low | breaths between phrases |
22
22
  | [desilence](#desilence) | time | pauses | ★★★ | low | remove / shorten / trim silence, split by pause |
23
23
  | [dereverb](#dereverb) | freq | late reverb | ★★★ | high | speech in a room |
24
24
  | [debleed](#debleed) | freq | bleed of a source with its own track | ★★★ | high | click track, amp or co-host in a mic |
25
25
  | [dewow](#dewow) | time + freq | pitch drift | ★★★ | medium | disc wow (33⅓ / 45 / 78 rpm) in music; tape by its pilot tone |
26
+ | [desqueak](#desqueak) | time + freq | guitar squeaks, picks, amp noise | ★★★ | medium | finger squeaks on wound strings, harsh picks, amp hiss |
26
27
 
27
28
  For broader DSP needs use [stretch](https://github.com/audiojs/stretch), [shift](https://github.com/audiojs/shift), [pitch](https://github.com/audiojs/pitch), [beat](https://github.com/audiojs/beat).
28
29
 
@@ -139,6 +140,8 @@ Per noise, the noisy speech routed to a reducer (VoiceBank+DEMAND's training and
139
140
 
140
141
  Material with nothing to remove (tune 586, test 900): 565 and 854 come back untouched (0.4.1: 566, 855). Most of the rest goes to `declick` on VoiceBank's lip smacks (14 and 37 takes, 32–124× out of the error); to `omlsa` (5 and 6): three VoiceBank takes and one narration in each set whose floor reads 8–25 dB under the voice (audio-lena's: 22 dB), a GuitarSet mic take and a VocalSet one 19–25 dB over theirs, two MUSDB18 mixes (`wiener`'s in 0.4.1). Missed: a bed further under the program than `BED_SNR`, where VoiceBank's own clean takes sit (their room 28–41 dB under): DEMAND's bus and office noise holds its power under 63 Hz, so the test set's bus and office takes at 12.5 and 17.5 dB read 26–33 dB in the pauses, as do the training set's car at 15 dB, and the washing machine's drum at 16 Hz leaves almost nothing above; babble and cafeteria that wander more than 3 dB pause to pause; a bed under a dense mix, masked where its power lies. ~10–18 ms per second of sound.
141
142
 
143
+ Most of the test set's misses are those: bus and office at 12.5 and 17.5 dB go to a reducer in 0–52 % of takes, the rest in 75–100 %. Their noise holds 88 % (bus) and 95 % (office) of its power under 40 Hz (every 3rd test take, noisy less clean); above 63 Hz it lies 26–33 dB under the voice, where VoiceBank's clean takes keep their own room (10th–90th percentile 30–40 dB). On the training material a bar low enough to take them does not pay: over 351 tuning takes (VoiceBank+DEMAND's training set, every 6th utterance clean and noisy, and the speech of `audio`'s `bench/rx/assistant.mjs` tuning split, whose brown and rumble beds sit as low), routing every bed read under T dB to `omlsa` changes PESQ by +40.4 summed at 25 dB, +41.7 at 28, +34.8 at 31, +19.0 at 34 (STOI +0.24, +0.22, +0.03, −0.29): `omlsa` takes a clean take's room 15 dB down and 0.40 of its PESQ. Taking a bed only to 40 dB under the program (ACX's noise floor under its loudness; `threshold` 4) slows the fall, +33.4 at 31 and +27.0 at 34, but never reaches 25 dB's; the pauses' power at 20–63 Hz, 15–20 dB under the voice in the test set's bus and office takes against 28 in its clean ones, is 18 dB or less in 5 % of the training speakers' clean takes. Under the chain's 40 Hz highpass (`@audio/chain`) the bulk of those beds goes anyway.
144
+
142
145
  dereverb has no reliable single-pass signature, so auto-mode never selects it — reach it explicitly via `denoise(data, { force: 'dereverb' })` or `dereverb()`.
143
146
 
144
147
 
@@ -146,58 +149,79 @@ dereverb has no reliable single-pass signature, so auto-mode never selects it
146
149
 
147
150
  ### `dehum`
148
151
 
149
- Measures the hum, then subtracts it: each harmonic of the mains frequency is estimated as a slowly varying sinusoid and taken out, so what goes with the hum is the program within a fraction of a hertz of each line, and less of it where the program is loud there. Without hum the audio comes back untouched. Notches (0.2.0) took whatever their band held, a band that grows with the harmonic (Q 30: 1.7 Hz at 50 Hz, 33 Hz at 1 kHz), an orchestra's G2 two hertz under the 100 Hz line among it; and as the mains frequency wanders (±0.02–0.05 Hz, h times that at harmonic h) narrow ones miss the upper harmonics.
152
+ Follows the mains phase, then subtracts the hum along it: each harmonic of the mains frequency, to 8 kHz where buzz carries it, is estimated as a slowly varying sinusoid and taken out, so what goes with the hum is the program within a fraction of a hertz of each line, and less of it where the program is loud there. Without hum the audio comes back untouched. Notches (0.2.0) took whatever their band held, a band that grows with the harmonic (Q 30: 1.7 Hz at 50 Hz, 33 Hz at 1 kHz), an orchestra's G2 two hertz under the 100 Hz line among it; and as the mains frequency wanders (±0.02–0.2 Hz, h times that at harmonic h) narrow ones miss the upper harmonics.
150
153
 
151
154
  ```js
152
- dehum(data, { fs }) // 50 or 60 Hz, measured; nothing without hum
153
- dehum(data, { fs, freq: 60 }) // the 60 Hz series, its exact frequency measured
155
+ dehum(data, { fs }) // 50 or 60 Hz, found; nothing without hum
156
+ dehum(data, { fs, freq: 60 }) // the 60 Hz series, its exact frequency tracked
154
157
  dehum(data, { fs, freq: 60, harmonics: 4 }) // remove 60–240 Hz as told
158
+ dehum(data, { fs, steady: true }) // a buzz held through the take, an amp's under a guitar
155
159
  measure(data, fs) // → { f0, harmonics } or null (import from @audio/denoise-dehum)
156
160
  ```
157
161
 
158
162
  | Param | Default | |
159
163
  |---|---|---|
160
- | `freq` | measured | Fundamental, Hz. Omitted: the 50 or 60 Hz series, whichever stands out. Given: its exact frequency within ±0.4 % (±`drift` Hz with `adaptive`) |
161
- | `harmonics` | to 1 kHz | Remove h = 1…`harmonics`. Omitted: every harmonic up to 1 kHz |
164
+ | `freq` | found | Fundamental, Hz. Omitted: the 50 or 60 Hz series, whichever is found. Given: that series, its frequency tracked from there (within ±0.4 %, ±`drift` Hz with `adaptive`) |
165
+ | `harmonics` | to 8 kHz | Remove h = 1…`harmonics` as told. Omitted: every harmonic to 1 kHz and each line above it that stands out, to 8 kHz |
166
+ | `steady` | `false` | The hum held through the take: a buzz under an instrument, no edit in it. Each line one phasor through the take, the mains phase refined against them (below) |
167
+
168
+ Hum is found by `measure()`, one Fourier transform over the signal (its first 80–90 s, taken down to 3 kHz), where a hum line, steady for minutes, gathers into a peak 1/T wide while speech spreads: the fundamental 20 dB over the median of the ±8 Hz around it, or two of the first six harmonics 15 dB, each 6 dB over any other peak within 3 Hz, all harmonics of one fundamental. Under music a line 20 dB under the program is too faint for that, so the band to 1 kHz is also tracked along each series (below) and its lines weighed where the program is quiet around them: hum is there when two or more of the first 20 harmonics stand out by 18 dB, are no more than 60 dB under the signal and stand alone, 6 dB over any other peak within 3 Hz, a third at least of those that stand out (a bar of music repeated exactly is a comb of lines 1/bar apart, lines at 50 and 60 Hz among them, few alone). A faster pattern spaces its teeth past 3 Hz, and where its instrument rings a tooth stands over the next: a kick at 200 bpm repeats every 15 periods of 50 Hz and 18 of 60, a comb every 3.33 Hz with teeth on both series, and in the MUSDB18 preview of Dark Ride's "Burning Bridges" its 50 Hz tooth stands 7 dB over the next one; the take has no pause to hear the line persist in, and 0.5.1 took it for hum (the mix out at 6.0 dB SDR). Neither the line's level nor its neighbours tell such a tooth from hum; the program's comb does, by all its teeth: for each pattern of 1/8 s to 2 s that spans a whole number of mains periods (its comb runs through the series), the share of the positions of its other lines, 40 Hz to 1 kHz, that hold a peak, less the share midway between them, where chance puts as many. The kick scores 0.30 (synthetic kicks 0.44–0.50, two BabySlakh mixes rendered from MIDI at an exact tempo 0.33 and 0.53); the 143 other MUSDB18 previews 0.16 at most, the other 18 BabySlakh mixes 0.20, 200 VocalSet takes, 120 GuitarSet takes, ten readings and five DEMAND noises 0.06. Over a quarter, in a take with no pause, the series is the program's and is left. Through 468 clean takes (MUSDB18's 94 training and 50 test previews, Brahms, Vibe Ace, the Nutcracker and the trumpet whole, 200 VocalSet takes, 120 GuitarSet takes, 30 s each: `node bench/rx/dehum.mjs clean` in `audio`) 0.5.2 changes none; 0.5.1 changed that one. Hum under such a pattern is left too where the take has no pause; with one, its lines and the pattern's within a fraction of a hertz of them go together (59.95 Hz hum 20 dB under the 200 bpm kick after 2 s of room tone: the mix out at 2.0 dB SDR, 0.5.1 alike). A tone held right on a mains line through a take with no pause is taken for hum.
169
+
170
+ The mains phase is tracked first from the harmonics to 1 kHz (each harmonic's phasor per Hann frame four mains cycles long, fitted over 2 s, their turn combined by h²·SNR over 8 s: Hajj-Ahmad, Garg & Wu 2013), then the signal is resampled so that the tracked mains period spans 2^k samples (computed order tracking: Fyfe & Munck 1997). There every harmonic sits on one bin of a 2^k-point transform of each frame however the mains wander, and the phase is refined from the turn between frames of the harmonics, to 16, 64, … 8 kHz, whose lines stand out alone (a partial beside a line turns it with the program), each weighted by its line's power over the program's there and smoothed by Rauch–Tung–Striebel at the likeliest rate of wander and noise scale; a refinement is kept only if it draws the lines tighter (their coherent power grows). Each harmonic's phasors are fitted over 2 s by weighted local-linear least squares (normalized convolution, Knutsson & Westin 1993), each frame weighted by the inverse of the program's power around the line there, so a passing voice or note is bridged from the frames around it rather than averaged in. Under a dense mix there is no frame to bridge from, and a fit over 2 s takes the music near every line, more of it than a faint hum (0.5.0: buzz 30 dB under music came out 7 dB worse than it went in); so the fit is kept within 30 % of the hum bridged through the program: the line's phasors, with any steady tone beside it taken out, followed as a slow random walk by Rauch–Tung–Striebel with the program's power in each frame as its noise, which carries the hum across a loud passage from where it stands alone instead of taking the music in. A line counts only if it persists where the program falls silent, at a tenth of its power elsewhere at least (a note held on a line goes quiet with the music; a held synth note at exactly 50 Hz was taken for hum). The sinusoids are resynthesized period by period, brought back to the original samples (Kaiser-windowed sinc) and subtracted (harmonic subtraction, as power-line interference is taken out of ECG: Levkov et al. 2005).
162
171
 
163
- The measurement is one Fourier transform over the signal (its first 80–90 s, taken down to 3 kHz), where a hum line, steady for minutes, gathers into a peak 1/T wide while speech spreads. Hum is there when the fundamental stands out by 20 dB over the median of the ±8 Hz around it, or two of the first six harmonics by 15 dB (searched within ±0.4 %, the mains tolerance), each 6 dB over any other peak within 3 Hz, all of them harmonics of one fundamental (p<sub>h</sub>/h within 0.01 Hz). A bar of music repeated exactly is a comb of lines 1/bar apart (every 2 Hz at 120 bpm), lines at 50 and 60 Hz among them: none stands alone. On 164 music clips (MUSDB18 excerpts, BabySlakh) this finds hum in one, which has it (0.2.0: in 19); on 504 clean and 504 noisy VoiceBank training utterances, in one, a steady 49.86 Hz tone at the speech's level; with hum 20 dB under the speech, in 95 % (50 Hz) and 92 % (60 Hz) of them, as before.
172
+ Where the hum itself jumps (an edit's splice turns its phase, a level step, hum switched on or off), every line's phasors before and after a frame differ beyond their spread at once, a note beside one line moving that line alone: the tracking does not integrate across the jump, each stretch is fitted on its own frames, and the hum switches from one stretch's to the next at the sample that best splits the signal between them. A note within ~0.5 Hz of a line for seconds is taken for hum. Whole clip (`streaming: false`), a second at least to find hum; shorter, it removes the harmonics of a given `freq` as told and passes the audio through without one. About a tenth of real time (0.4.0: a hundredth), most of it in the 2 s fits.
164
173
 
165
- Then the signal is cut into Hann frames four mains cycles long, two apart, and each harmonic's phasor taken per frame; the window's zeros fall on the other harmonics. Each harmonic's phasors are fitted over 2 s by weighted local-linear least squares (normalized convolution, Knutsson & Westin 1993), each frame weighted by the inverse of the program's power around the line there, so a passing voice or note is bridged from the frames around it rather than averaged in. The mains phase is tracked from the fitted phasors' turn, harmonics combined by h²·SNR (Hajj-Ahmad, Garg & Wu 2013) over 8 s, and the sinusoids are subtracted along it (harmonic subtraction, as power-line interference is taken out of ECG: Levkov et al. 2005). A cut in the recording jumps the hum's phase: within a second of it the fit blends the two phases and takes the hum ~10 dB down, not ~40. Cuts also spread the hum's line in the measurement, which can then read the frequency a tenth of a hertz off (h times that at harmonic h, enough to turn the upper harmonics against their frames); where the tracked phase turns on average by more than 0.01 Hz, the frequency is moved by that turn and the hum estimated again, up to four times, so away from the cuts an edited take loses its hum as an unedited one does. A note within ~0.5 Hz of a line for seconds is taken for hum. Whole clip (`streaming: false`), a second at least to measure; shorter, it removes the harmonics of a given `freq` as told and passes the audio through without one.
174
+ `steady` (0.6.0) is for a hum that holds still through the take: an amp's ground loop under a guitar. A fit over 2 s takes in what the program puts near a line for seconds, and a chord's attack, moving many lines at once, reads as the hum's jump: on GuitarSet takes under a buzz 35 dB down (audio's `bench/rx/guitar.mjs`, players 00–02), 0.5.2 took the buzz 4.3 dB down and the guitar to 39.3 dB SDR. Steady, each line is one phasor through the take, its mean weighted to where the program around the line is quiet; the program's power there is read from the line's magnitude, not its phase, so a phase still off does not pass for program. Held, the lines show the mains phase's error frame by frame against them, all at once (Newton's steps on the held comb's correlation, smoothed by Rauch–Tung–Striebel at the likeliest rate of wander): from the trace, the phase is refined against the comb to harmonics 2, 4, … 64, then to 8 kHz twice, each step holding the higher lines tighter (on one of those takes, from 0.5 rad off the true phase at its start to under 0.001 rad throughout). A line goes when its held phasor stands 10 dB over its own spread and holds no more than twice the power the line has where the program falls silent (a note on the line, which the take's quiet does not hold), each frame's by its expected coherence, e^(−h²σ²/2) with σ² the phase's variance there: where the program masked the hum and the phase was bridged, the upper lines go less. The dense mix of the test suite under that buzz, wandering ±0.02 Hz: 48.0 dB of it down, the music at 78.4 dB SDR (by default 3.7 and 32.6).
166
175
 
167
- Measured by `node scripts/dehum.js`: the hum (12 harmonics at −6 dB per octave, levels drifting ±10 %, f0 0.05 Hz off nominal and wandering) and the program told apart by phase inversion (Hagerman & Olofsson 2004). 50 Hz hum 20 dB under the program, wandering ±0.02 Hz; program SDR per band where the band holds 1 % of the program:
176
+ Measured by `node scripts/dehum.js`, 0.4.0 → 0.5.1 (0.5.2 alike, every cell): the hum (mains: 12 harmonics at −6 dB per octave; buzz: odd-heavy to 8 kHz, odd h at h^−½, even at 0.3·h^−½, rolling off over 3 kHz; levels drifting ±10 %, f0 0.05 Hz off nominal and wandering) and the program told apart by phase inversion (Hagerman & Olofsson 2004). 50 Hz hum 20 dB under the program, wandering ±0.02 Hz; program SDR per band where the band holds 1 % of the program:
168
177
 
169
178
  | material | hum down, dB | program SDR, dB | <100 Hz | 100–300 | 300–1k | 1–4k | >4k |
170
179
  |---|---:|---:|---:|---:|---:|---:|---:|
171
- | speech | 45.5 | 38.5 | 28.9 | 39.2 | 39.2 | 83.0 | – |
172
- | narration | 43.5 | 42.7 | – | 38.8 | 42.9 | 64.5 | 73.9 |
173
- | vibeace | no hum found | | | | | | |
174
- | brahms | 42.2 | 25.7 | 30.2 | 17.9 | 27.0 | 57.8 | 50.2 |
175
- | nutcracker | 41.6 | 27.6 | 23.5 | 30.7 | 26.8 | 63.6 | – |
176
- | trumpet | 51.0 | 47.9 | – | – | 42.2 | 82.3 | – |
180
+ | speech | 45.5 → 41.7 | 38.5 → 41.7 | 28.9 → 28.9 | 39.2 → 42.3 | 39.2 → 45.1 | 83.0 → 83.8 | – → – |
181
+ | narration | 43.5 → 38.6 | 42.7 → 46.8 | – → – | 38.8 → 40.0 | 42.9 → 48.1 | 64.5 → 85.9 | 73.9 → 89.0 |
182
+ | vibeace | no hum found → 33.3 | no hum found → 32.6 | no hum found → 32.3 | no hum found → 32.8 | no hum found → 32.4 | no hum found → 74.8 | no hum found → – |
183
+ | brahms | 42.2 → 24.4 | 25.7 → 31.4 | 30.2 → 34.0 | 17.9 → 22.3 | 27.0 → 36.9 | 57.8 → 84.5 | 50.2 → 77.5 |
184
+ | nutcracker | 41.6 → 26.4 | 27.6 → 33.2 | 23.5 → 27.9 | 30.7 → 35.2 | 26.8 → 32.9 | 63.6 → 77.4 | – → – |
185
+ | trumpet | 51.0 → 47.3 | 47.9 → 49.4 | – → – | – → – | 42.2 → 43.6 | 82.3 → 94.8 | – → – |
177
186
 
178
187
  Hum down / program SDR, dB:
179
188
 
180
- | material | 60 Hz | 50 Hz, ±0.05 Hz | 50 Hz, 30 dB under |
181
- |---|---|---|---|
182
- | speech | 46.3 / 42.1 | 36.4 / 38.5 | 38.7 / 38.6 |
183
- | narration | 43.6 / 44.0 | 33.8 / 42.8 | 42.3 / 42.9 |
184
- | vibeace | no hum found | no hum found | no hum found |
185
- | brahms | 41.7 / 29.0 | 27.8 / 25.7 | 33.9 / 25.7 |
186
- | nutcracker | 40.7 / 24.3 | 33.2 / 27.9 | no hum found |
187
- | trumpet | 51.9 / 47.8 | 46.0 / 47.7 | 48.4 / 48.0 |
189
+ | material | 60 Hz | 50 Hz, ±0.05 Hz | 50 Hz, 30 dB under | 60 Hz buzz to 8 kHz | 50 Hz buzz, ±0.2 Hz |
190
+ |---|---|---|---|---|---|
191
+ | speech | 46.3 / 42.1 → 45.4 / 44.5 | 36.4 / 38.5 → 35.5 / 41.5 | 38.7 / 38.6 → 35.1 / 43.9 | 6.7 / 42.1 → 28.9 / 36.2 | 5.2 / 37.3 → 7.8 / 36.4 |
192
+ | narration | 43.6 / 44.0 → 39.9 / 45.8 | 33.8 / 42.8 → 36.8 / 46.8 | 42.3 / 42.9 → 31.8 / 50.4 | 6.7 / 43.9 → 26.4 / 40.2 | no hum found → no hum found |
193
+ | vibeace | no hum found → 33.7 / 32.3 | no hum found → 29.0 / 32.5 | no hum found → no hum found | no hum found → 22.1 / 33.8 | no hum found → 3.6 / 26.8 |
194
+ | brahms | 41.7 / 29.0 → 25.1 / 34.0 | 27.8 / 25.7 → 16.1 / 31.5 | 33.9 / 25.7 → 13.2 / 32.9 | 6.5 / 29.0 → 11.8 / 31.9 | 5.0 / 25.7 → 4.3 / 32.9 |
195
+ | nutcracker | 40.7 / 24.3 → 20.4 / 35.0 | 33.2 / 27.9 → 23.1 / 32.9 | no hum found → no hum found | 2.9 / 26.1 → 13.6 / 31.4 | 5.2 / 28.3 → 6.2 / 33.3 |
196
+ | trumpet | 51.9 / 47.8 → 50.5 / 50.2 | 46.0 / 47.7 → 42.0 / 48.9 | 48.4 / 48.0 → 39.9 / 49.0 | 6.1 / 48.0 → 39.0 / 43.9 | 6.2 / 45.8 → 20.6 / 38.2 |
188
197
 
189
- An edited take: eight stretches cut out of the same mixtures, from a pause to a pause in the speech (the quietest 50 ms near each spot), anywhere in the music, the hum's phase jumping at each cut; hum down within a second of a cut / elsewhere, and the program SDR, dB, 0.3.0 → now:
198
+ An edited take (eight stretches cut out, from a pause to a pause in the speech, anywhere in the music, the hum's phase jumping at each cut), then the hum's level stepping four times among off, −10, −5, 0 and +5 dB; hum down within a second of a cut or step / elsewhere, and the program SDR, dB:
190
199
 
191
200
  | material | within 1 s | elsewhere | program SDR |
192
201
  |---|---:|---:|---:|
193
- | speech | 6.4 → 6.5 | 35.0 → 41.1 | 38.4 → 38.3 |
194
- | narration | no hum found | | |
195
- | brahms | 9.4 → 9.5 | 32.7 → 37.0 | 25.1 → 25.0 |
196
- | nutcracker | 9.7 → 9.7 | 34.8 → 36.0 | 28.4 → 28.0 |
202
+ | speech | 6.5 → 7.7 | 41.1 → 41.2 | 38.3 → 38.7 |
203
+ | narration | no hum found → 24.6 | no hum found → 35.3 | no hum found → 41.9 |
204
+ | brahms | 9.5 → 7.9 | 37.0 → 15.1 | 25.0 → 30.7 |
205
+ | nutcracker | 9.7 → 9.1 | 36.0 → 13.9 | 28.0 → 34.8 |
197
206
 
198
- In the narration the eight cuts spread the hum's lines under what the measurement takes for hum, so it is left as it is.
207
+ | material | within 1 s | elsewhere | program SDR |
208
+ |---|---:|---:|---:|
209
+ | speech | 14.7 → 18.9 | 40.9 → 28.8 | 38.4 → 39.8 |
210
+ | narration | 15.0 → 23.6 | 41.0 → 34.7 | 42.5 → 43.7 |
211
+ | brahms | 13.9 → 14.1 | 40.5 → 26.7 | 25.8 → 32.0 |
212
+ | nutcracker | 15.0 → 17.7 | 40.7 → 24.0 | 27.7 → 34.5 |
213
+
214
+ Hum alone, 30 s, ±0.02 Hz: 56 → 61 dB down; buzz to 8 kHz alone: 6.4 → 62.2. Clean speech, narration and music: no sample changed. Under music 0.5.1 takes less hum than 0.4.0 and far less of the music: Brahms loses 24 dB of its hum, not 42, and keeps 31.4 dB of program SDR, not 25.7, its 100–300 Hz band 22.3, not 17.9; what is left of the hum is 44 dB under the orchestra. Vibe Ace's hum, among the track's own steady lines, is found now (0.4.0 left it): 33 dB down. A generator's ±0.2 Hz wander under a voice is followed by 8 dB only.
215
+
216
+ Against iZotope RX 12 De-hum (2026-10, `node bench/rx/dehum.mjs` in `audio`; RX hosted through Pedalboard, a new instance per render, its Learn on 3 s of the hum alone before each take as its manual has it): 21 test clips (6 VoiceBank speech clips of eight utterances, 4 Spoken Wikipedia readings, Brahms, Vibe Ace, the Nutcracker, the trumpet, 7 MUSDB18 test previews), six conditions (50 Hz mains, 60 Hz buzz to 8 kHz, 50 Hz buzz wandering ±0.2 Hz, level steps, six splices, 60 Hz buzz 30 dB under), RX's knobs chosen on a separate split (VoiceBank training speakers, other readings, MUSDB18 training previews): its best, Dynamic at sensitivity 1 and Q 10000, beat its defaults (sensitivity 5: 18.6 dB mean SDR on the tuning split) and every Static setting (7–12 dB: its notches, 16 harmonics at Q 300–3000, leave an error 3–10 dB under a white program's 40–1000 Hz band). Mean over conditions and materials, hum down / SDR against the clean program / PESQ (speech and readings):
217
+
218
+ | | RX defaults | RX tuned | 0.4.0 | 0.5.2 |
219
+ |---|---:|---:|---:|---:|
220
+ | hum down, dB | 7.7 | 3.2 | 11.8 | 17.7 |
221
+ | SDR, dB | 18.9 | 25.4 | 29.4 | 34.9 |
222
+ | PESQ | 3.06 | 2.80 | 3.27 | 4.01 |
199
223
 
200
- The same mixtures through 0.2.0 (its Q 30 notches at the lines it found, run on hum and program apart): hum 5–15 dB down (26 in Vibe Ace at 60 Hz), program SDR 10–38 dB (speech 22.3, Brahms 13.6, its 100–300 Hz band 5.7). Hum alone, 30 s, ±0.02 Hz: 56 dB down (0.2.0: 26). Clean speech, narration and music: no sample changed. In Vibe Ace the hum's lines stand among the track's own steady ones, none alone, so none is taken for hum (0.2.0 found hum in the clean track); `freq` and `harmonics` remove them as told.
224
+ RX's learned Dynamic profile acts as a gate: it takes the hum in the room tone 54–60 dB down and leaves it under the speech, where it takes as much of the voice (18.9 dB mean SDR, the input's 22.6). Tuned, it barely touches the take (3 dB of hum), the best SDR it reaches. 0.5.2 (every score as 0.5.1's) is over RX tuned in SDR in all 18 condition × material cells (buzz 30 dB under music: 35.9 against 32.2, input 31.3), and every clip comes out within 0.2 dB of its input SDR or better. Hum as recorded (MIR-1K singing, DEMAND's washing machine and hallway, five readings, a VoiceBank take): RX's select-all Learn takes its lines up to 18 dB down and the program with them (the rest of the spectrum 1.5–20 dB SDR); dehum takes them 0–14 dB down and leaves the rest 21–60 dB. VocalSet's 60 Hz lines, more than 60 dB under the singing and barely over its room tone, are left as they are (0.4.0 took them 0–7 dB down; RX up to 23, the rest of the spectrum 0.2–12.5 dB).
201
225
 
202
226
  **Use when:** mains buzz, ground-loop hum, fixed tonal interference.<br>
203
227
  **Not for:** broadband noise (use `wiener`/`omlsa`); shifting tones (use spectral methods).
@@ -281,68 +305,76 @@ The wind goes under the words too, between and under the harmonics; what a voice
281
305
 
282
306
  ### `deplosive`
283
307
 
284
- Ducks the band under `crossover` for a close-mic `p` or `b`: a pressure pulse that rises out of nothing, outweighs the band above it and has no period, where a voice's or a bass note's low end repeats at its pitch. A duck begins when the low band's 3 ms envelope jumps over 3× its 30 ms average while standing over `triggerRatio`× the high band, and holds while that lasts and the low band stays aperiodic: its normalized autocorrelation's peak at a 2.5–25 ms lag (Talkin 1995) under ½, where a harmonic part would lead (Boersma 1993). The high band is floored 20 dB under its peak over the last seconds, so a room's own rumble in a pause is no pop. The duck crossfades toward the high-passed sound, x − (1 − g)·(x − HP(x)), so it never lifts a band; with no pop the output equals the input sample for sample.
308
+ Takes a close-mic `p` or `b` out: a pressure pulse that rises out of nothing under 80 Hz and has no period, where a voice's or a bass note's low end repeats at its pitch. A pop begins when the 3 ms envelope of the band under 80 Hz jumps over 3× its 30 ms average while standing over `triggerRatio`× the band over 120 Hz (a voice's fundamental and up), and holds while that lasts and the low band stays aperiodic: its normalized autocorrelation's peak at a 2.5–25 ms lag (Talkin 1995) under ½, where a harmonic part would lead (Boersma 1993). The voice band is floored 6 dB under its peak over the last seconds: a room's rumble in a pause is no pop, and a pop reaches the voice's level. Removal takes the sound's own part under `crossover` away, x − w·LP(x), LP linear-phase: a pulse through a causal filter leaves the filter's response to its edges behind (with the pops' spans known, a duck to a causal 2nd-order high-pass at 100 Hz takes a median 12 dB of their error, the linear-phase band at 120 Hz 21). LP runs at ~2 kHz (three box sums decimate, a Kaiser-windowed sinc low-passes, linear interpolation returns), and its half-length is the look-ahead: the output is `latency(fs)` samples late (~14 ms, declared to the host), the duck starts 4 ms before where the pop's low band rose and is held to its end. With no pop the output is the input, sample for sample, that late.
285
309
 
286
310
  ```js
287
- deplosive(data, { triggerRatio: 4, attack: 0.002, release: 0.03 })
311
+ deplosive(data, { fs: 48000 }) // in place, aligned
312
+ let write = deplosive({ fs: 48000 }) // stream: each block back whole, latency(48000) samples late; write() flushes
288
313
  ```
289
314
 
290
315
  | Param | Default | |
291
316
  |---|---|---|
292
- | `triggerRatio` | `4` | LF/high envelope ratio a pop must exceed |
293
- | `attenuation` | `-18` | dB cut on the LF band when triggered |
294
- | `crossover` | `200` | Hz — LF/high split point |
295
- | `attack` | `0.002` | s |
317
+ | `triggerRatio` | `1` | the band under 80 Hz over the band over 120 Hz that a pop must exceed |
318
+ | `attenuation` | `-40` | dB, how far the band under `crossover` goes in a pop |
319
+ | `crossover` | `120` | Hz, the band a pop is taken from |
320
+ | `attack` | `0.0005` | s |
296
321
  | `release` | `0.03` | s |
297
322
 
298
- At full duck the response is −24 dB at 60 Hz, −17 at 100, −2.1 at 250 and −0.5 at 400 Hz; 0.1.10's g·LP + (x − LP), x − LP being no high-pass, gave −7.5, −3.1, +1.8 and +1.3 dB, and it ducked any low end over 4× the high band: a voice's, a jazz track's, a bass line's. `node scripts/lowend.js deplosive` puts clean speech and music through it, then speech with pops added (synthetic: half-sine pressure pulses of 20–60 ms under 150 Hz before each word that follows a pause; no recordings of real pops over their clean speech exist here). VoiceBank+DEMAND test utterances, Spoken Wikipedia narrations, the music `repair` uses, 0.1.10 → now; voiced frames thinned: the voiced 10 ms frames whose level under 250 Hz fell by more than 3 dB:
323
+ Against iZotope RX 12 De-plosive, `node bench/rx/deplosive.mjs` in [audio](https://github.com/audiojs/audio) (2026-10): VoiceBank clean speech (2 test speakers, 11.4 min), pops added at stop bursts found on it (Liu 1996's +b landmark), six in ten: a one-sided pressure pulse of 20–80 ms rising in 1–4 ms (as the narrations' own pops do), under 200 Hz, 0.3–2× the speech peak. Every setting chosen on 28 training speakers; RX tuned: sensitivity 1, strength 5, frequency limit 125 Hz (defaults 5, 5, 200). The error to the clean speech taken away over each pop and the 100 ms after it; SNR to the clean speech over the reels with pops; on the speech alone, its voiced frames:
324
+
325
+ | | pops: error taken away, median · 10th pct | with pops: SNR to clean | clean, voiced frames: SNR to input | voiced frames thinned > 3 dB under 250 Hz |
326
+ |---|---:|---:|---:|---:|
327
+ | RX 12 defaults | 21.8 · 11.1 dB | 19.1 dB | 22.8 dB | 4.9 % |
328
+ | RX 12 tuned | 21.9 · 13.4 dB | 22.0 dB | 46.8 dB | 0.0 % |
329
+ | 0.2.0 | 5.8 · 0.8 dB | 9.1 dB | 39.9 dB | 0.1 % |
330
+ | **0.3.0** | **22.5 · 16.3 dB** | **24.6 dB** | **53.4 dB** | **0.0 %** |
331
+
332
+ 0.2.0 missed one pop in ten (a pop under a word's level never stood 4× over the band above 200 Hz) and took 6 dB of the rest. `node scripts/lowend.js deplosive` puts clean speech and music through it, then speech with pops (half-sine pressure pulses of 20–60 ms under 150 Hz before each word that follows a pause): VoiceBank+DEMAND test utterances, Spoken Wikipedia narrations, the music `repair` uses, 0.2.0 → 0.3.0; voiced frames thinned: the voiced 10 ms frames whose level under 250 Hz fell by more than 3 dB:
299
333
 
300
334
  | | voiced frames thinned | 20–63 Hz | 63–125 Hz | 125–250 Hz |
301
335
  |---|---:|---:|---:|---:|
302
- | speech, male | 8.9% → 0.7% | −1.2 → −0.1 | −0.5 → 0.0 | −0.1 → 0.0 |
303
- | speech, female | 16.3% → 2.2% | −3.4 → −0.2 | −0.3 → 0.0 | 0.2 → 0.0 |
304
- | narrations | 2.4% → 0.0% | −0.7 → −0.2 | −0.2 → 0.0 | 0.0 → 0.0 |
336
+ | speech, male | 0.7% → 0.2% | −0.1 → 0.0 | 0.0 → 0.0 | 0.0 → 0.0 |
337
+ | speech, female | 2.2% → 0.7% | −0.2 → −0.1 | 0.0 → 0.0 | 0.0 → 0.0 |
338
+ | narrations | 0.0% → 0.1% | −0.2 → −0.2 | 0.0 → 0.0 | 0.0 → 0.0 |
305
339
  | audio-lena | 0.0% → 0.0% | 0.0 → 0.0 | 0.0 → 0.0 | 0.0 → 0.0 |
306
- | Vibe Ace (jazz) | 41.3% → 0.4% | −4.3 → 0.0 | −2.9 → 0.0 | −0.6 → 0.0 |
307
- | Brahms (strings) | 0.4% → 0.1% | 0.0 → 0.0 | 0.0 → 0.0 | 0.0 → 0.0 |
308
- | Nutcracker | 3.6% → 0.1% | 0.0 → 0.0 | −0.1 → 0.0 | 0.0 → 0.0 |
340
+ | Vibe Ace (jazz) | 0.4% → 1.6% | 0.0 → −0.1 | 0.0 → −0.2 | 0.0 → −0.1 |
341
+ | Brahms (strings) | 0.1% → 0.0% | 0.0 → 0.0 | 0.0 → 0.0 | 0.0 → 0.0 |
342
+ | Nutcracker | 0.1% → 0.1% | 0.0 → 0.0 | 0.0 → 0.0 | 0.0 → 0.0 |
309
343
  | trumpet | 0.0% → 0.0% | 0.0 → 0.0 | 0.0 → 0.0 | 0.0 → 0.0 |
310
- | bass line | 53.1% → 0.0% | −8.3 → −0.1 | −4.6 → 0.0 | 0.2 → 0.0 |
344
+ | bass line | 0.0% → 0.0% | −0.1 → 0.0 | 0.0 → 0.0 | 0.0 → 0.0 |
311
345
 
312
346
  Pops peaking at 0.5, 1 and 2× the utterance's peak, the error to the clean speech taken away over each pop and the 150 ms after it (dB):
313
347
 
314
348
  | | 0.5× | 1× | 2× |
315
349
  |---|---:|---:|---:|
316
- | speech, male | 11.5 → 11.0 | 13.6 → 13.2 | 14.4 → 14.5 |
317
- | speech, female | 13.9 → 12.6 | 14.7 → 14.2 | 14.9 → 15.0 |
318
-
319
- 0.1.10 often met a pop with its duck already down on the pause's rumble before the word; it now waits for the pop, and takes the first few ms of it a little less.
350
+ | speech, male | 11.0 → 23.3 | 13.2 → 28.1 | 14.5 → 31.3 |
351
+ | speech, female | 12.6 → 25.8 | 14.2 → 30.6 | 15.0 → 33.6 |
320
352
 
321
353
  **Use when:** mic plosives (`p`, `b`, `t`) producing low-frequency thuds.<br>
322
- **Not for:** a kick drum or a bass note struck hard: so sudden a low end is ducked for its first few ms, before its period shows.
354
+ **Not for:** a kick drum: it is a pop to this (a jazz mix loses 3 dB under 250 Hz on 1.6 % of its frames, 0.2.0: 0.4 %); a live path that cannot wait 14 ms.
323
355
 
324
356
 
325
357
  ### `deesser`
326
358
 
327
- Sibilance reduction, [`@audio/dynamics-deesser`](https://github.com/audiojs/dynamics) `mode: 'band'` behind this family's seconds-based options (2026-07 near-dupe merge). An 's' is told by its shape, not its level: the sibilance band at `fc` is measured against the voice body under `fc / 2`, in dB, and how far it rises over `threshold` sets a peaking cut at `fc`, held within `range`.
359
+ Sibilance reduction, [`@audio/dynamics-deesser`](https://github.com/audiojs/dynamics) 0.4 behind this family's seconds-based options (2026-07 near-dupe merge), every setting the kernel's unless given. An 's' is told by its shape, not its level: the band over `split` (3.5 kHz) against the voice body under it, in dB, read 5 ms ahead so the cut is in place as the 's' begins; how far it rises over `threshold` sets the cut, held within `range`. By default (`split`) only that band moves, through a linear-phase split, so nothing under it changes; `mode: 'band'` cuts a bell at `fc`, `'broadband'` the whole sound. Measured against iZotope RX 12 De-ess in the kernel's README: harsh sibilants 12.5 dB of the error gone (RX tuned 12.1).
328
360
 
329
361
  ```js
330
- deesser(data, { fs }) // the kernel's threshold (0 dB) and range (−6 dB)
331
- deesser(data, { fs, fc: 7500, threshold: -3, range: -8 }) // softer esses too, deeper
362
+ deesser(data, { fs }) // the band over 3.5 kHz, the kernel's threshold (0 dB) and range (−8 dB)
363
+ deesser(data, { fs, mode: 'band', fc: 7500, Q: 1 }) // a bell at 7.5 kHz alone
332
364
  ```
333
365
 
334
366
  | Param | Default | |
335
367
  |---|---|---|
336
- | `fc` | `6000` | Sibilance centre (Hz; `freq` still accepted) |
337
- | `threshold` | kernel's (`0`) | dB of the sibilance band over the voice body where the cut starts; not a level |
338
- | `range` | kernel's (`-6`) | dB, the deepest cut |
368
+ | `mode` | `'split'` | `'split' \| 'band' \| 'broadband'` |
369
+ | `split` | `3500` | Hz, where split mode's band starts |
370
+ | `fc` | `6500` | Hz, band mode's centre (`freq` still accepted) |
371
+ | `Q` | `1.4` | band mode's width |
372
+ | `threshold` | `0` | dB of the sibilance band over the voice body where the cut starts; not a level |
373
+ | `range` | `-8` | dB, the deepest cut |
339
374
  | `ratio` | `4` | Compression ratio above threshold |
340
- | `attack` | `0.001` | s — how fast the cut engages |
341
- | `release` | `0.05` | s — how slowly it recovers |
342
- | `Q` | `1.4` | Peaking EQ Q |
343
- | `block` | `64` | Coefficient update interval (samples) |
344
-
345
- `threshold` was a level, −30 dBFS here; under the kernel's 0.3 it is the band over the body, and −30 cut a ride cymbal 12 dB under a mix by a median 2.7 dB.
375
+ | `attack` | `0.001` | s, how fast the cut engages |
376
+ | `release` | `0.015` | s, how slowly it recovers |
377
+ | `lookahead` | `5` | ms read ahead (the output stays aligned) |
346
378
 
347
379
  **Use when:** voice post-production with hot s/sh; vocal bus de-essing.
348
380
 
@@ -407,7 +439,7 @@ The a priori SNR the speech absence is read from is smoothed in the cepstrum (Br
407
439
 
408
440
  A held note, a sustained vowel or a chord is not learned as the noise. IMCRA, as minimum statistics, takes whatever holds a bin for about a second as noise: clean music through `omlsa` lost 9.9 % of its time-frequency energy by more than 3 dB, a sung long tone 8.8 %, a synthesized band 22.6 %. @audio/noise-estimate's `partials` reads, each frame, where a partial stands, a peak over the spectrum's morphological floor (the inverse harmonic mask of Nelke, Naylor & Vary, ICASSP 2015) held 0.3 s within ±1 bin and 10 dB over what its bin held while free, and there holds the noise at that memory; elsewhere, and on noise alone, the tracker's estimate is as it was, to the bit. A line steady from the take's start (hum, a fan, an engine) has no free frame and stays noise; one that starts mid-take is held up to 60 s, then learned, as is a note held longer; a note sounding from the first frame is learned until its bin is once free of it. Music cut 9.9 → 3.0 %, sung long tones 8.8 → 0.0 %, Slakh mixes 22.6 → 2.3 %; on the training speech PESQ 1.825 → 1.823, OVRL 2.543 → 2.542, musical noise 0.80 → 0.81 ([Speech](#speech) has the test set). `estimator: { partials: false }` turns it off.
409
441
 
410
- A noise that holds still can be learned instead: `profile`, the noise's PSD (`noiseProfile` of a stretch where it plays alone), or, in the batch form, `noiseFrames`/`profileFrom`/`profileTo` naming that stretch. The noise is then held (`known` of @audio/noise-estimate), and p reads the observation: γ averaged over 105.5 Hz and over 543 Hz of the frame, at fixed priors (Gerkmann, Breithaupt & Martin 2008: the averaged γ is χ² with r degrees of freedom from the Hann window's correlation across bins, ξ<sub>fix</sub> the a priori SNR that minimizes false alarms plus misses, eq. 13; at 48 kHz r 5.7 and 24, ξ<sub>fix</sub> 9.4 and 5.1 dB), and 0 where the estimated q reaches 0.9, as before. Until 0.4 it read γ in each bin alone, at ξ<sub>H1</sub> = 15 dB (Gerkmann & Hendriks 2012), and speech 0–5 dB over the noise lost 7.8 dB on the training speech, where the MMSE Wiener gain keeps 3.9. The paper averages over 64 ms of frames as well; presence then outlasted a sound by those frames, and in the half second after music stopped the noise came through in tones (log kurtosis ratio 0.45 at G<sub>min</sub> −12 dB, 1.77 at −20): over the frame alone. On the training speech, G<sub>min</sub> −12 dB: PESQ 1.861 → 1.867, OVRL 2.564 → 2.572, BAK 3.05 → 3.08, musical noise 0.53 → 0.46, speech 0–5 dB over the noise −7.8 → −5.1 dB, the noise taken in pauses 9.7 → 10.1 dB. Steady noise under speech and music goes exactly G<sub>min</sub> down, with no musical noise from −12 to −20 dB (log kurtosis ratio 0.00); in the half second after music stops, 0.05 at −12 dB and 0.61 at −20 (0.3: 0.11 and 1.00; `scripts/broadband.mjs`). Tracking the noise from the print (Gerkmann & Hendriks 2012's MMSE tracker started on it, RX's "adaptive") lost OVRL 0.04 and left musical noise (0.40 on pink): the print is held. `processor(opts)` is the gain as an @audio/stft frame process, for a host running its own frames: audio's `denoise` op learns a print from a range and runs it so.
442
+ A noise that holds still can be learned instead: `profile`, the noise's PSD (`noiseProfile` of a stretch where it plays alone), or, in the batch form, `noiseFrames`/`profileFrom`/`profileTo` naming that stretch. The noise is then held (`known` of @audio/noise-estimate), and p reads the observation: γ averaged over 105.5 Hz and over 543 Hz of the frame, at fixed priors (Gerkmann, Breithaupt & Martin 2008: the averaged γ is χ² with r degrees of freedom from the Hann window's correlation across bins, ξ<sub>fix</sub> the a priori SNR that minimizes false alarms plus misses, eq. 13; at 48 kHz r 5.7 and 24, ξ<sub>fix</sub> 9.4 and 5.1 dB), and 0 where the estimated q reaches 0.9, as before. Until 0.4 it read γ in each bin alone, at ξ<sub>H1</sub> = 15 dB (Gerkmann & Hendriks 2012), and speech 0–5 dB over the noise lost 7.8 dB on the training speech, where the MMSE Wiener gain keeps 3.9. The paper averages over 64 ms of frames as well; presence then outlasted a sound by those frames, and in the half second after music stopped the noise came through in tones (log kurtosis ratio 0.45 at G<sub>min</sub> −12 dB, 1.77 at −20): over the frame alone. On the training speech, G<sub>min</sub> −12 dB: PESQ 1.861 → 1.867, OVRL 2.564 → 2.572, BAK 3.05 → 3.08, musical noise 0.53 → 0.46, speech 0–5 dB over the noise −7.8 → −5.1 dB, the noise taken in pauses 9.7 → 10.1 dB. Steady noise under speech and music goes exactly G<sub>min</sub> down, with no musical noise from −12 to −20 dB (log kurtosis ratio 0.00); in the half second after music stops, 0.04 at −12 dB and 0.40 at −20 (0.5: 0.05 and 0.61, 0.3: 0.11 and 1.00; `scripts/broadband.mjs`). Held, the frame is the power of two at or above 32 ms (`frame(fs, true)`; a `profile` without a `frameSize` brings its own, 2(K − 1) for K bins): 2048 at 44.1 kHz as at 48, where the nearest power of two, the tracked frame, left 1024 and 43 Hz bins, half the resolution 48 kHz gets. Nothing is tracked on a held noise, so the frame's length goes to frequency, and a partial under the noise is parted from it. 0.5 → 0.6, music under steady noise at 44.1 kHz (audio's `bench/rx/denoise.mjs`: ten MUSDB18 test mixtures, strings and jazz, under white, pink and two DEMAND noises 10 and 25 dB down, 96 takes): SDR 20.16 → 20.94 dB, noise-to-mask ratio −9.6 → −10.0 dB, music cut by more than 3 dB 2.2 → 1.3 %, above 8 kHz −2.8 → −2.6 dB, musical noise under the music 0.44 → 0.38; VoiceBank training speech at 44.1 kHz, its lead-in learned: PESQ 1.875 → 1.872, STOI 0.830 → 0.835, OVRL 2.549 → 2.574. Tracking, the shorter frame stays: 2048 at 44.1 kHz cost that speech PESQ 0.053 and BAK 0.08. Tracking the noise from the print (Gerkmann & Hendriks 2012's MMSE tracker started on it, RX's "adaptive") lost OVRL 0.04 and left musical noise (0.40 on pink): the print is held. `processor(opts)` is the gain as an @audio/stft frame process, for a host running its own frames: audio's `denoise` op learns a print from a range and runs it so.
411
443
 
412
444
  ```js
413
445
  omlsa(data, { fs })
@@ -422,12 +454,15 @@ omlsa(data, { fs, profileFrom: 0, profileTo: fs / 2, gMin: -12 }) // the noise
422
454
  | `xiMin` | `10^−2.5` | A priori SNR floor (−25 dB) |
423
455
  | `qPrior` | estimated | A fixed a priori speech absence instead of the estimate |
424
456
  | `qFrom` | `'cts'` | The a priori SNR the speech absence is read from: smoothed in the cepstrum, or `'dd'`, decision-directed (Cohen's `omlsa.m`) |
425
- | `frameSize` | power of two nearest 32 ms | STFT frame: 512 at 16 and 22.05 kHz, 1024 at 44.1, 2048 at 48 (`frame(fs)`) |
457
+ | `frameSize` | by the rate | Tracking, the power of two nearest 32 ms: 512 at 16 and 22.05 kHz, 1024 at 44.1, 2048 at 48 (`frame(fs)`); on a held noise, at or above 32 ms: 512 at 16 kHz, 1024 at 22.05, 2048 at 44.1 and 48 (`frame(fs, true)`) |
426
458
  | `hopSize` | `frameSize/4` | |
427
459
  | `profile` | tracked | A known noise PSD (`frameSize/2+1` bins), held |
460
+ | `threshold` | `0` | dB: the noise read that much louder (RX's Threshold), a held profile raised, the tracked estimate's β multiplied: more of what is quiet counts as noise |
428
461
  | `estimator` | | IMCRA options (@audio/noise-estimate `imcra`); `{ partials: false }`: held notes learned as noise, as before 0.5 |
429
462
  | `noiseFrames` / `profileFrom` / `profileTo` | | A noise-only stretch to learn the profile from (batch) |
430
463
 
464
+ Against iZotope RX 12's Voice De-noise and Spectral De-noise on the same speech, narrations and music: [Speech](#speech).
465
+
431
466
  **Use when:** speech in non-stationary noise (street, café, car); generally the highest-quality choice for noisy speech. A steady noise with a stretch of it alone (hiss, hum, a fan, room tone): learn it, `profile`.
432
467
 
433
468
 
@@ -435,7 +470,7 @@ omlsa(data, { fs, profileFrom: 0, profileTo: fs / 2, gMin: -12 }) // the noise
435
470
 
436
471
  ### `declick`
437
472
 
438
- Finds each click as an outlier of the AR prediction error, decides what it is, and rebuilds the sound under it. The error is judged against its own median level over ±12 ms, so a click can't raise the bar it must clear; the model is fitted again with the outliers left out, since a loud click otherwise teaches it its own ringing. A click spans where the error stays over 3× that level after its onset; one with a like half its size 2.5–15 ms away is a glottal pulse or a plucked string, and is left alone. Each click is then judged under a finer model, AR(256) of the 46 ms either side, three ways: a gap over all of it; a gap over its onset alone; that gap and a damped resonance struck at the onset, which is what a stylus's tick and a scratch's pop are (Godsill & Rayner 1998, ch. 7). Where the resonance shares a voice's or an instrument's frequencies, its tail barely shows in the prediction error, so a gap found by the error stops short of it; fitted from the onset (frequency, decay, amplitude, phase), the resonance is taken off whole. Of the three, the one of least BIC is kept: the error each leaves after its gap is rebuilt, against the number of values it is free to choose. The gap is rebuilt by least-squares AR(512) interpolation over 46 ms either side ([`lpc`](https://github.com/audiojs/denoise/tree/main/packages/lpc)'s `arBridge`, Janssen 1986), then pulled toward each recorded sample as far as the click there is small: the posterior mean under the click as Gaussian noise whose variance is half of what least squares took off (Godsill & Rayner §5.3). Samples no click reaches come back bit-exact.
473
+ Finds each click as an outlier of the AR prediction error, finds how far it reaches and whether it rings on, and rebuilds the sound under it. The error is judged against its own median level over ±12 ms, so a click can't raise the bar it must clear; the model is fitted again with the outliers left out, since a loud click otherwise teaches it its own ringing. A click spans where the error stays over 3× that level after its onset; one with a like half its size 2.5–15 ms away is a glottal pulse or a plucked string, and is left alone. Each click is then judged under a finer model, AR(256) of the 46 ms either side: as a gap from its start over every length up to its end, or up to the end of another click within 6 ms (a dropout's two edges), every length's error from one Levinson-Durbin pass since the gaps nest; and as a damped resonance struck at its onset, which is what a stylus's tick and a scratch's pop are (Godsill & Rayner 1998, ch. 7), with a gap over the onset or over its first sample alone. Kept: the one that explains the sound at least cost, each gap sample at its marginal likelihood's cost under a Gaussian click of the onset's size (ch. 9), so a loud click's gap is dear and a resonance that explains its ring wins; no resonance that would take off more than the recording holds; and nothing at all where the sound's own excitation explains it better, an innovation outlier rather than an added one (Chang, Tiao & Chen 1988): a plosive's burst, a note's attack. The gap is rebuilt by least-squares AR(512) interpolation over 46 ms either side ([`lpc`](https://github.com/audiojs/denoise/tree/main/packages/lpc)'s `arBridge`, Janssen 1986), then as the sound's posterior mean under the click as Gaussian noise of its own envelope and spectrum (AR(4) of what least squares took off, refined by EM, Godsill & Rayner §5.3 with the click coloured): under a mouth click the voice is kept where the click is weak, in time and in frequency. Samples no click reaches come back bit-exact.
439
474
 
440
475
  ```js
441
476
  declick(data, { fs: 44100 }) // everywhere
@@ -450,16 +485,32 @@ declick(data, { fs: 44100, regions: [{ at: 12.31, duration: 0.02 }] }) // the cl
450
485
  | `regions` | — | `[{ at, duration }]`, s: look only there, and take nothing there for a pulse or too long |
451
486
  | `fs` | `44100` | sample rate, Hz |
452
487
 
453
- `node scripts/declick.js` adds clicks to speech (audio-lena) and music (librosa/data, as `repair`), one every 0.25–0.45 s at 2, 5 and 15× the sound's RMS around it, and measures how much of each click's error is gone (median dB, over the click and 1 ms either side), the share gone by 10 dB or more, and FFmpeg `adeclick` at its defaults after ·:
488
+ `node scripts/declick.js` adds clicks to speech (audio-lena) and music ("Vibe Ace", Brahms, the trumpet, as `repair`), one every 0.25–0.45 s at 2, 5 and 15× the sound's RMS around it, and measures how much of each click's error is gone (median dB, from 1 ms before the click to 20 ms after it, so a repair's own ringing counts), the share gone by 10 dB or more, and FFmpeg `adeclick` at its defaults after ·:
454
489
 
455
490
  | click | 2× | 5× | 15× |
456
491
  |---|---:|---:|---:|
457
- | tick (rings at 2–8 kHz, 0.05–0.3 ms) | 23.9 dB · 89% · 8.0 | 31.0 dB · 99% · 8.2 | 39.5 dB · 100% · 9.8 |
458
- | pop (300–1500 Hz, 0.3–1 ms) | 18.5 dB · 72% · 0.4 | 27.1 dB · 98% · 0.6 | 34.5 dB · 100% · 0.3 |
459
- | glitch (1–8 samples off) | 29.2 dB · 80% · 21.5 | 37.9 dB · 92% · 24.8 | 48.7 dB · 99% · 29.5 |
460
- | mouth (1–3 ms of noise) | 20.4 dB · 99% · 5.1 | 24.5 dB · 100% · 11.0 | 31.4 dB · 100% · 15.7 |
492
+ | tick (rings at 2–8 kHz, 0.05–0.3 ms) | 26.9 dB · 93% · 8.0 | 33.8 dB · 100% · 8.0 | 41.0 dB · 100% · 9.8 |
493
+ | pop (300–1500 Hz, 0.3–1 ms) | 19.2 dB · 71% · 0.4 | 28.6 dB · 99% · 0.6 | 34.5 dB · 100% · 0.3 |
494
+ | glitch (1–8 samples off) | 41.6 dB · 100% · 19.8 | 45.5 dB · 100% · 24.8 | 56.7 dB · 100% · 29.2 |
495
+ | spike (a jump decaying over 1–3 samples, cut off after 4–8) | 28.3 dB · 96% · 22.3 | 37.9 dB · 100% · 24.4 | 50.6 dB · 99% · 33.1 |
496
+ | mouth (1–3 ms of noise) | 23.2 dB · 99% · 4.4 | 27.8 dB · 100% · 11.0 | 32.8 dB · 100% · 15.7 |
497
+ | dropout (0.02–1 ms gone to zero) | 13.8 dB · 56% · 0.2 | | |
498
+
499
+ 0.3.0 (a gap over the onset ±0.1 ms or over all of the error's span, nothing between; the click under it white), measured the same way: ticks 23.9, 31.0 and 39.5 dB; pops 18.5, 27.1, 34.5; glitches 29.2, 37.9, 48.7; spikes 21.3, 24.2, 41.3; mouth clicks 20.4, 24.5, 31.4; dropouts 7.1. 0.2.0 (a gap as far as the AR(32) error showed the click, least squares; over the click and 1 ms either side): ticks 13.4, 17.5 and 25.4 dB; pops 5.7, 12.9, 18.2; glitches 15.5, 20.5, 29.4; mouth clicks 9.3, 17.8, 25.6. The clean material through it: untouched (0.3.0 changed 112 samples of "Vibe Ace", to −62 dB; 0.1.7 2295, 123 and 2283 of the speech, Brahms and the trumpet); `adeclick` changes 7 116–22 978 samples of each, to −27 to −49 dB. Each click's surroundings (3–20 ms either side) given as `regions`: the same within 1.3 dB; regions over the clean material change nothing. Tuned on other material (VoiceBank+DEMAND training takes, two other narrations, other parts of "Vibe Ace" and Brahms, the Nutcracker). Clicked sound takes 1.25× 0.3.0's time, run side by side (10 s with three clicks a second), clean sound as long.
500
+
501
+ Against iZotope RX 12 Advanced, De-click and Mouth De-click (VST3 hosted by Pedalboard; [`audio`](https://github.com/audiojs/audio)'s `bench/rx/declick.mjs`, October 2026), through `audio`'s `declick()`, on other takes: 12 s of VoiceBank+DEMAND's clean test utterances, two Spoken Wikipedia narrations, "Vibe Ace" and Brahms (5–15 s) and the trumpet. RX at its defaults, and at its best per kind on separate takes (VoiceBank+DEMAND training utterances, two other narrations, other passages, the Nutcracker) from algorithm × sensitivity × click widening, Mouth De-click from sensitivity, then frequency skew. Median dB gone as above, speech at 2 / 5 / 15× · music:
502
+
503
+ | click | RX, defaults | RX, best on other takes | `declick` 0.3.0 | `declick` |
504
+ |---|---|---|---|---|
505
+ | tick | 7.2 / 14.6 / 20.2 · 10.3 / 13.3 / 19.2 | 11.7 / 14.8 / 18.6 · 13.9 / 16.2 / 19.1 (Multi-band random, 3) | 20.5 / 28.8 / 34.7 · 26.0 / 30.0 / 40.3 | 23.1 / 31.4 / 37.6 · 28.1 / 32.7 / 41.2 |
506
+ | pop | 0.0 / 1.0 / 3.8 · 0.0 / 2.4 / 5.5 | 5.0 / 8.9 / 15.5 · 6.8 / 12.9 / 19.0 (Multi-band random, 7) | 12.9 / 25.5 / 35.5 · 16.8 / 24.6 / 34.3 | 13.8 / 26.6 / 37.4 · 18.4 / 26.4 / 35.5 |
507
+ | glitch | 10.9 / 15.7 / 30.0 · 10.9 / 20.2 / 27.2 | 11.1 / 17.1 / 30.1 · 9.9 / 20.4 / 28.3 (Single-band, 1.5) | 21.8 / 33.3 / 44.4 · 30.3 / 40.1 / 49.1 | 30.8 / 40.5 / 51.9 · 37.8 / 45.8 / 56.6 |
508
+ | spike | 10.0 / 13.3 / 25.7 · 7.7 / 17.2 / 27.1 | 11.3 / 15.1 / 26.1 · 9.7 / 17.8 / 27.1 (Single-band, 1.5) | 17.0 / 21.2 / 28.4 · 21.6 / 31.9 / 38.9 | 22.8 / 30.1 / 42.7 · 27.0 / 39.0 / 46.5 |
509
+ | dropout | 0.0 · 0.0 | 1.3 · 4.2 (Multi-band random, 7) | 3.0 · 7.9 | 6.3 · 15.4 |
510
+ | mouth, speech at 1 / 2 / 5× | Mouth De-click 9.6 / 16.0 / 20.5 | 11.0 / 16.7 / 21.2 (sensitivity 4, skew 5) | 13.5 / 16.4 / 21.8 | 13.4 / 18.1 / 23.6 |
511
+
512
+ The share of mouth clicks gone by 10 dB or more: 65, 83 and 92%, Mouth De-click's 45, 78 and 83% at its defaults, 53, 82 and 87% at its best. Do no harm: on the clicked takes, the error left outside the clicks' spans is 35–43 dB under the sound, RX's 22–29 dB at its defaults and 21–37 at its best. The clean takes through each (samples moved over 2⁻¹⁵ · error under the sound): `declick` VoiceBank 0.5% · −38 dB, the narrations 0.03% · −43 and 0.3% · −43, the music untouched (0.3.0: 0.7% · −36, 0.2% · −36, 1.1% · −27, "Vibe Ace" −62); RX De-click at its defaults 1.1% · −28, 0.1% · −40, 0.3% · −29, the music 0.009–1.9%, the trumpet to −13; Mouth De-click 5.1% · −34, 0.4% · −44, 5.1% · −26 (at its best 5.0% · −35, 0.4% · −45, 5.0% · −27); Single-band at sensitivity 1.5, RX's least, 0.3% · −38, 0.03% · −45, 0.06% · −42, the trumpet to −28. On four real narrations (30 s each, with their own mouth clicks), `declick` changes 27.5 places a minute (0.3.0: 49.5), Mouth De-click 75 and De-click 81; RX De-click changes 65% of `declick`'s places too. Each click selected, 3–20 ms either side (`declick({ at, duration })` a click): ticks 22.5 / 30.1 / 37.4 · 28.1 / 32.7 / 41.2 dB, glitches 30.0 / 36.8 / 50.2 · 37.0 / 45.8 / 55.9, mouth clicks 13.3 / 17.7 / 23.6, within 3.7 dB of the whole take and over RX's on the whole take in every condition.
461
513
 
462
- 0.2.0 (a gap as far as the AR(32) error showed the click, least squares): ticks 13.4, 17.5 and 25.4 dB; pops 5.7, 12.9, 18.2; glitches 15.5, 20.5, 29.4; mouth clicks 9.3, 17.8, 25.6. Pops rebuilt at their true span by least squares under AR(512) reach 9.5, 18.0 and 27.8: the resonance taken off beats the best gap by 7–9 dB. 0.1.7 (AR(60) on its own window, σ including the click, 2 samples either side): ticks 5–6 dB, pops 0, mouth clicks 4–6 dB. The clean material through it: speech, Brahms and the trumpet untouched (0.1.7 changed 2295, 123 and 2283 samples, the trumpet to −19 dB), "Vibe Ace" 112 samples at −62 dB (0.2.0: −42 dB); `adeclick` changes 7 116–22 978 samples of each, to −27 to −49 dB. Each click's surroundings (3–20 ms either side) given as `regions`: the same within 0.4 dB; regions over the clean material change nothing. Tuned on other material (two narrations, VoiceBank+DEMAND training takes, other parts of "Vibe Ace" and Brahms, the Nutcracker, two other VocalSet singers). Clicked sound takes 1–2× 0.2.0's time (10 s with three clicks a second in 0.3–0.7 s), clean sound as long.
463
514
 
464
515
  **Use when:** vinyl ticks, edit clicks, digital glitches, mouth clicks on a voice; a click seen on a spectrogram, given as a region.<br>
465
516
  **Not for:** dense crackle (use `decrackle`); long dropouts (use `repair`).
@@ -467,7 +518,7 @@ declick(data, { fs: 44100, regions: [{ at: 12.31, duration: 0.02 }] }) // the cl
467
518
 
468
519
  ### `decrackle`
469
520
 
470
- Finds crackle, a worn record's dense small impulses, where the sound departs both from its AR prediction and from its least-squares interpolation from either side, and rebuilds all of it in a 46 ms window at once. The prediction error alone also stands out at the sound's own excitation, a voice's glottal pulses, a reed's or a bow's; the two-sided error (the prediction error through its matched filter, Vaseghi & Rayner 1990) holds those back by √Σa² against its spread and lifts an impulse added to the sound by as much, so crackle is where both stand over `threshold` × their local level: per 1.5 ms block the median |error|, the median of those over ±12 ms, which crackle can't raise until it fills half the samples of half the blocks. All flagged samples of a window are solved together by exact least-squares AR interpolation ([`lpc`](https://github.com/audiojs/denoise/tree/main/packages/lpc)'s `arFill`, Janssen 1986 / Godsill-Rayner 1998), so a neighbouring impulse is never taken for sound. Then it looks again on the rebuilt sound, the models fitted to it, until no new impulse stands out (Vaseghi & Rayner's iteration): with the largest gone, the smaller ones show; a new one must stand out of the input too, so a rebuild's own departures are never taken for crackle. A ringing tick's tail and a small impulse beside a large one stay under the threshold, and a rebuild bends to fit them as if they were sound; so last, every sample from 0.1 ms before a crackle sample to 0.5 ms after it is made soft: the sound there is the posterior mean under the window's AR(64) model with a click of its own variance at each sample, the variances found by EM (impulsive noise as a scale mixture of Gaussians, Godsill & Rayner, IEEE TSAP 1998): where the sound fits the model the samples stay near as recorded, where it doesn't the model takes over. Samples farther than that from any crackle come back bit-exact.
521
+ Finds crackle, a worn record's dense small impulses, where the sound departs both from its AR prediction and from its least-squares interpolation from either side, and rebuilds all of it in a 46 ms window at once. The prediction error alone also stands out at the sound's own excitation, a voice's glottal pulses, a reed's or a bow's; the two-sided error (the prediction error through its matched filter, Vaseghi & Rayner 1990) holds those back by √Σa² against its spread and lifts an impulse added to the sound by as much, so crackle is where both stand over `threshold` × their local level: per 1.5 ms block the median |error|, the median of those over ±12 ms, which crackle can't raise until it fills half the samples of half the blocks. All flagged samples of a window are solved together by exact least-squares AR interpolation ([`lpc`](https://github.com/audiojs/denoise/tree/main/packages/lpc)'s `arFill`, Janssen 1986 / Godsill-Rayner 1998), so a neighbouring impulse is never taken for sound. Then it looks again on the rebuilt sound, the models fitted to it, until no new impulse stands out (Vaseghi & Rayner's iteration): with the largest gone, the smaller ones show; a new one must stand out of the input too, so a rebuild's own departures are never taken for crackle. Each event is then judged as `declick` judges a click: an impulse added to the recording against the sound's own excitation (an additive outlier against an innovational one, Chang, Tiao & Chen 1988), under AR fitted to the rebuilt sound, each explanation by its fewest freed samples at ln T of the excitation's variance each (Schwarz 1978). A voice's glottal pulse, a bow's or a reed's catch, a drum's attack is one outlier of the excitation, the recording after it its smooth response; an impulse added stands in `order` + 1 errors, and its own sample frees them all. What the excitation explains as well is left as recorded (and crackle within 0.7 ms of such a pulse with it). A ringing tick's tail and a small impulse beside a large one stay under the threshold, and a rebuild bends to fit them as if they were sound; so last, every sample from 0.1 ms before a crackle sample to 0.5 ms after it is made soft: the sound there is the posterior mean under the window's AR(64) model with a click of its own variance at each sample, the variances found by EM (impulsive noise as a scale mixture of Gaussians, Godsill & Rayner, IEEE TSAP 1998): where the sound fits the model the samples stay near as recorded, where it doesn't the model takes over. Samples farther than that from any crackle come back bit-exact.
471
522
 
472
523
  ```js
473
524
  decrackle(data, { fs: 44100 })
@@ -483,11 +534,21 @@ decrackle(data, { fs: 44100 })
483
534
 
484
535
  | crackle, peaks × RMS | 50/s | 200/s | 1000/s |
485
536
  |---|---:|---:|---:|
486
- | small (0.1–0.5×) | 38.7 → 44.7 · 32.1 | 32.7 → 39.3 · 31.1 | 25.8 → 32.0 · 27.5 |
487
- | medium (0.4–2×) | 26.7 → 39.4 · 30.7 | 20.8 → 32.9 · 28.0 | 13.8 → 23.9 · 20.3 |
488
- | loud (1.6–8×) | 14.8 → 32.5 · 26.1 | 8.6 → 25.1 · 19.7 | 1.7 → 15.8 · 8.7 |
537
+ | small (0.1–0.5×) | 38.7 → 45.5 · 32.1 | 32.7 → 39.4 · 31.1 | 25.8 → 31.8 · 27.5 |
538
+ | medium (0.4–2×) | 26.7 → 39.5 · 30.7 | 20.8 → 32.7 · 28.0 | 13.8 → 23.8 · 20.3 |
539
+ | loud (1.6–8×) | 14.8 → 32.7 · 26.1 | 8.6 → 25.1 · 19.7 | 1.7 → 15.7 · 8.7 |
540
+
541
+ `decrackle` does better than `adeclick` in 53 of the 54 cases, by up to 23.5 dB, and ties in one (the sung vibrato under small crackle at 1000/s, 30.9 each; 0.3.1 led in all 54); the sung vibrato, where 0.2.0 trailed in 8 (loud crackle at 50/s: 24.2 · 29.1), leads in the other 8 (30.7 · 29.1). 0.3.1, before each event was judged: 44.7, 39.3 and 32.0 dB small; 39.4, 32.9, 23.9 medium; 32.5, 25.1, 15.8 loud. 0.2.0 (the rebuild alone, no soft samples): 44.2, 38.3 and 30.2 dB small; 36.4, 29.6, 20.8 medium; 29.2, 21.8, 12.0 loud; the soft samples gain up to 6.5 dB (0.2–6.5 in 51 of the 54 cases, none in one) and lose 3.3 and 1.3 dB on the trumpet with small crackle at 50 and 200/s. The clean sound through it: audio-lena and Brahms not a sample changed; VoiceBank 1.4% of the samples, to −41 dB; "Vibe Ace" and the trumpet 0.07% and 0.05%, −52 and −69 dB; the song 0.17%, −64 dB (`adeclick`: 1.9–8.5%, −26 to −47 dB). 0.3.1 took the sound's own excitation for crackle too, a voice's glottal pulses, a bow's catch, and softened 0.6 ms around each: audio-lena 0.05%, −73 dB; VoiceBank 2.2%, −41; the music 0.07–1.1%, −49 to −70; the song 0.3%, −60. 0.2.0 changed 0.01–0.22%, to −41 to −74 dB. Tuned on other material (two narrations, VoiceBank+DEMAND training takes, other parts of "Vibe Ace" and Brahms, the Nutcracker, two other VocalSet singers): there 0.2.0 trailed `adeclick` in 23 of 72 cases, now in none. 0.1.7 (2.5 × its window's MAD, 30 Gauss-Seidel sweeps of the fill) made small crackle worse than it found it (38.7 → 21.9 dB at 50/s, the trumpet to 5.6) and changed 3.7–10% of the clean samples (the trumpet to −5.5 dB, speech to −21 dB). 1–1.6× 0.2.0's time, run side by side (the most at 1000/s).
542
+
543
+ Against iZotope RX 12 Advanced De-crackle (VST3 hosted by Pedalboard; [`audio`](https://github.com/audiojs/audio)'s `bench/rx/decrackle.mjs`, October 2026), through `audio`'s `decrackle()` on other takes (12 s of VoiceBank+DEMAND's clean test utterances, two Spoken Wikipedia narrations, "Vibe Ace" and Brahms 5–15 s, the trumpet), the same crackle: RX at its defaults (quality Low, strength 5) and at its best for each size on separate takes (quality × strength, then amplitude skew): small Medium, 3; medium High, 9.5; loud Medium, 9.5, skew 5. SDR out, dB, speech at 50 / 200 / 1000 a second · music:
489
544
 
490
- `decrackle` does better than `adeclick` in all 54 cases, by 0.3–18.6 dB; the sung vibrato, where 0.2.0 trailed in 8 (loud crackle at 50/s: 24.2 · 29.1), now leads in all 9 (30.7 · 29.1). 0.2.0 (the rebuild alone, no soft samples): 44.2, 38.3 and 30.2 dB small; 36.4, 29.6, 20.8 medium; 29.2, 21.8, 12.0 loud; the soft samples gain up to 6.5 dB (0.2–6.5 in 51 of the 54 cases, none in one) and lose 3.3 and 1.3 dB on the trumpet with small crackle at 50 and 200/s. The clean sound through it: audio-lena 0.05% of the samples changed, to −73 dB; VoiceBank 2.2%, −41 dB; the music 0.07–1.1%, −49 to −70 dB; the song 0.3%, −60 dB (`adeclick`: 1.9–8.5%, −26 to −47 dB). The soft samples move more of them, each by less: 0.2.0 changed 0.01–0.22%, to −41 to −74 dB ("Vibe Ace" −64, now −49). Tuned on other material (two narrations, VoiceBank+DEMAND training takes, other parts of "Vibe Ace" and Brahms, the Nutcracker, two other VocalSet singers): there 0.2.0 trailed `adeclick` in 23 of 72 cases, now in none. 0.1.7 (2.5 × its window's MAD, 30 Gauss-Seidel sweeps of the fill) made small crackle worse than it found it (38.7 → 21.9 dB at 50/s, the trumpet to 5.6) and changed 3.7–10% of the clean samples (the trumpet to −5.5 dB, speech to −21 dB). 1–1.6× 0.2.0's time, run side by side (the most at 1000/s).
545
+ | crackle | in | RX, defaults | RX, best for the size | `decrackle` |
546
+ |---|---|---|---|---|
547
+ | small | 38.7 / 32.9 / 26.0 · 38.9 / 32.8 / 25.7 | 30.7 / 29.5 / 25.6 · 40.5 / 35.0 / 27.1 | 38.1 / 33.2 / 26.2 · 40.7 / 34.1 / 26.2 | 43.4 / 38.7 / 31.5 · 46.5 / 40.0 / 31.9 |
548
+ | medium | 27.1 / 20.9 / 14.0 · 26.7 / 20.8 / 13.7 | 28.1 / 24.0 / 16.2 · 31.2 / 25.1 / 15.9 | 22.6 / 21.0 / 17.7 · 31.3 / 26.1 / 18.9 | 38.5 / 32.8 / 23.8 · 39.5 / 33.4 / 24.0 |
549
+ | loud | 14.8 / 8.9 / 1.9 · 14.8 / 8.6 / 1.7 | 22.1 / 15.9 / 5.4 · 22.4 / 15.0 / 4.8 | 19.4 / 15.5 / 10.1 · 22.7 / 17.2 / 11.4 | 31.6 / 25.3 / 16.7 · 32.7 / 25.5 / 16.2 |
550
+
551
+ `decrackle` is 4.8–15.9 dB over RX at its best for each size, in every rate and size (0.3.1, before each event was judged: 4.2–15.8; cell by cell 0.5 dB over these to 1.2 under). RX at its defaults makes small crackle on speech worse (38.7 → 30.7 dB at 50 a second). The clean takes through each (samples moved over 2⁻¹⁵ · error under the sound): `decrackle` 0–1.4% · −44 dB to none (Brahms comes back bit-exact); RX at its defaults 3.7–48% · −25 to −52; at its best for medium and loud crackle 4–75% · −15 to −59; at its best for small crackle, its gentlest, 0.3–10.3% · −36 to −67: more samples than `decrackle` on all six takes (6 to 110 times as many where `decrackle` moves any), more error on four (the narrations −51 and −36 against −70 and −47, Brahms −61 against none, the trumpet −67 against −69), less on two (VoiceBank −46 against −44, "Vibe Ace" −58 against −55). 0.3.1 moved 0.07–2.3% · −37 to −66 dB, less error than RX's gentlest on two takes: it took the sound's own excitation for crackle and softened 0.6 ms around each. What is left on VoiceBank is mostly its speakers' own mouth clicks (a 9-sample step at 9.58 s, a burst near 20 kHz at 0.90 s), which nothing in a recording tells from crackle; on "Vibe Ace", a percussive attack. The judging was chosen on the tuning takes (other utterances, narrations and passages, the Nutcracker): there the 54 crackle cases average 31.9 dB as with 0.3.1, and the clean takes' error falls from −38 to −69 dB to −39 dB to none (two untouched).
491
552
 
492
553
  **Use when:** shellac / 78 RPM crackle; a worn LP's surface noise; dense small ticks under music or speech.<br>
493
554
  **Not for:** loud isolated clicks and pops (use `declick`); long dropouts (use `repair`).
@@ -495,18 +556,22 @@ decrackle(data, { fs: 44100 })
495
556
 
496
557
  ### `declip`
497
558
 
498
- Finds where a sound was cut flat and rebuilds what the cut took off. A hard clip piles every sample it cuts onto one level, its rail. Each side's rail is the sound's extreme there, taken when the samples within 0.1 % of it outnumber those in the next 0.1 % below tenfold and most of them sit in runs: the top-bin test of FFmpeg's `adeclip` (1000 bins, ratio 10), made relative to the rail so it holds at any level (and never finer than one step of a 16- or 24-bit grid), and per side, so one rail or two different ones are found. A loud peak is one sample; a limiter's ceiling is touched by single samples or by arches, and a sine's top is an arch, which fill the band below about as densely: sound with no rail comes back bit-exact.
559
+ Finds where a sound was cut and rebuilds what the cut took off. A hard clip piles every sample it cuts onto one level, its rail. Each side's rail is the sound's extreme there, taken when the samples within 0.1 % of it outnumber those in the next 0.1 % below tenfold and most of them sit in runs: the top-bin test of FFmpeg's `adeclip` (1000 bins, ratio 10), made relative to the rail so it holds at any level (and never finer than one step of a 16- or 24-bit grid), and per side, so one rail or two different ones are found. A loud peak is one sample; a limiter's ceiling is touched by single samples or by arches, and a sine's top is an arch, which fill the band below about as densely.
560
+
561
+ Lossy coding (MP3, AAC, Opus) leaves no flat top: it spreads the rail into a band, the coder's noise around the level the runs were cut at, a mode of the amplitude density with mass on both sides of it. A waveform's own peaks, a sine's top, a limiter's ceiling, only approach a level from below. So, where no side has a flat rail, each side's band is its highest mode standing 4 times over the density 2–6 % of the extreme below it (at 1, 2 and 4 times that scale, for coarser coders), with samples over it reaching 3 of its spreads σ (the RMS of the samples over the mode) and beyond; the sound is cut again 6σ under the mode and rebuilt as a clip there (κ = 6 chosen on VoiceBank and MUSDB18 training material through LAME at 128 kbit/s: 0.6 dB over 4 on average, speech +0.9, music −0.1; 5 and 8 within 0.2 on speech).
499
562
 
500
- Every sample at a rail is then rebuilt twice, each rebuild held at least as far out as the sample was recorded (a clip only ever lowers a sample). Sparse: A-SPADE (Kitić, Bertin & Gribonval 2015) as the declipping survey's code runs it (Záviška, Rajmic, Ozerov & Rencker 2021), per block of 93 ms the fewest DFT lines that agree with what was recorded. AR: per window of 186 ms, AR(256) fitted under its taper, every unknown solved at once by exact least squares ([`lpc`](https://github.com/audiojs/denoise/tree/main/packages/lpc)'s `arFill`), refitted and solved again, 8 times (Janssen, Veldhuis & Vries 1986). The sparse one wins on tonal music and on heavy clipping, the AR one on speech and on mild clipping, and neither everywhere, so the two are blended, region by region, by a weight chosen by cross-validation: the clipped sound is clipped once more, at the level that takes as large a share of what the first clip left as the first took of the whole; both rebuild that; the weight is the one whose blend lies nearest what is known there (the samples the second clip hid, and the bounds of those the first took), read per 93 ms over ±1 s. A blend of two consistent rebuilds is consistent; each rebuild runs only where its weight is not 0. Samples off the rails come back bit-exact; a sound over 30 s is rebuilt in pieces crossfaded over 2 s.
563
+ Soft saturation, a valve, transistor or tape stage driven hot, leaves no rail and no band: a memoryless curve bends the peaks over toward a ceiling. Where neither is found, the curve is fitted blind, by maximum likelihood, the sound before it taken for locally AR Gaussian: for a curve f, z = f⁻¹(x) is the sound it bent, and the likelihood is AR(24)'s of z per window of 46 ms, the variance profiled out, times the Jacobian of f⁻¹ (a Wiener system, a linear sound then a memoryless curve, inverted blindly; Taleb, Solé-Casals & Jutten 2001 invert one by its output's independence). Two shapes, each of unit slope at 0, with a ceiling per side and a knee k: c·tanh((|x|/c)^k)^(1/k), tanh at k = 1, an exponential approach to the ceiling; and x/(1 + (|x|/c)^k)^(1/k), an algebraic one, as arctan's. It reads the 48 windows of the highest peaks, a quarter of them first to screen, and takes a curve that gains over 0.02 nats a sample against the sound as it is and bends the loudest peak to half its slope or less. A band the recording left empty (a lowpass, a codec's) would make a curve's new harmonics there cost more than they should, so each window's fit keeps a white floor 70 dB under its power. The sound is then inverted, z = f⁻¹(x), where the curve keeps over 1/40 of its slope (its noise and the fit's error raised at most 32 dB); above, z is unknown and held at least at f⁻¹ there: a clip, rebuilt as one. A limiter is no curve: its gain moves over milliseconds and keeps each wave's shape, and undoing it is an expander's work, not a repair's. Sound with no rail, no band and no curve comes back bit-exact: none of 1736 clean recordings, as they are, peak-normalized, or driven 12 dB into a lookahead limiter, shows one (VoiceBank+DEMAND's 1328 utterances, MUSDB18's 144 mixtures whole, the survey's ten SQAM excerpts, the four pieces whole, ten Spoken Wikipedia narrations, 100 VocalSet takes, 120 GuitarSet takes, 20 Slakh mixes), nor do sines from 50 Hz to 5 kHz. The most any gains is 0.01 nats a sample, VocalSet's sung long tones, whose curve leaves the loudest peak 0.6–0.9 of its slope; MUSDB18's mixtures, as they are and limited, 10⁻⁴. On the tuning material of the comparison below, saturation to 10 dB SDR gains 0.07–0.23 nats a sample on speech and 0.5–1.1 on music, its peaks bent to 1/17 of their slope or less; the slope's limit, 40, was chosen there: against 10 and 20, up to 9 dB more on its tanh-saturated mixtures, the same on its speech and under curves outside the two (arctan, a side's ceiling apart, hiss after the curve). The screen costs about a tenth of a second on clean sound; a fit, a few seconds.
564
+
565
+ Every sample at a rail is then rebuilt three times, each rebuild held at least as far out as the sample was recorded (a clip only ever lowers a sample). AR: per window of 186 ms, AR(256) fitted under its taper, every unknown solved at once by exact least squares ([`lpc`](https://github.com/audiojs/denoise/tree/main/packages/lpc)'s `arFill`), refitted and solved again until the fill moves by under 1 %, at most 8 times (Janssen, Veldhuis & Vries 1986). Sparse: A-SPADE (Kitić, Bertin & Gribonval 2015) as the declipping survey's code runs it (Záviška, Rajmic, Ozerov & Rencker 2021), the fewest DFT lines that agree with what was recorded, per block of 93 ms and per block of 186 ms: the long block resolves a held note's partials (a held chord clipped to 1 dB, half a second: 11.6 → 14.2 dB), the short one follows speech and attacks. No one of the three wins everywhere, so they are blended, region by region, by weights chosen by cross-validation (Stone 1974; stacked regressions, Breiman 1996): the clipped sound is clipped once more, at the level that takes as large a share of what the first clip left as the first took of the whole; each method rebuilds that; the weights, on a grid of tenths over the three, are those whose blend lies nearest what is known there (the samples the second clip hid, and the bounds of those the first took), read per 93 ms over ±1 s. A blend of consistent rebuilds is consistent; each rebuild runs only where its weight is not 0. Samples off the rails come back bit-exact; a sound over 30 s is rebuilt in pieces crossfaded over 2 s.
501
566
 
502
567
  ```js
503
- declip(data, { fs: 44100 }) // each side's rail found; none: untouched
568
+ declip(data, { fs: 44100 }) // each side's rail (or band, or curve) found; none: untouched
504
569
  declip(data, { fs: 44100, clipLevel: 0.95 }) // a known rail, ±0.95
505
570
  ```
506
571
 
507
572
  | Param | Default | |
508
573
  |---|---|---|
509
- | `clipLevel` | auto | the rail, ± this; omitted or 0: found per side |
574
+ | `clipLevel` | auto | the rail, ± this; omitted or 0: found per side (a rail, a band, or a curve) |
510
575
  | `order` | `256` | AR order of the AR rebuild; `512` takes it on dense music up to 2 dB closer, in about 3× the time |
511
576
  | `fs` | `44100` | sample rate, Hz |
512
577
 
@@ -514,76 +579,110 @@ declip(data, { fs: 44100, clipLevel: 0.95 }) // a known rail,
514
579
 
515
580
  | input SDR | 1 dB | 3 dB | 7 dB | 10 dB | 15 dB | 20 dB |
516
581
  |---|---:|---:|---:|---:|---:|---:|
517
- | speech | 8.4 · 1.1 | 10.9 · 5.0 | 24.2 · 12.1 | 31.9 · 16.9 | 38.3 · 24.0 | 42.6 · 30.5 |
518
- | "Vibe Ace" | 6.9 · 1.6 | 13.1 · 5.0 | 19.1 · 10.3 | 22.7 · 14.0 | 31.4 · 19.9 | 36.2 · 24.6 |
519
- | Brahms | 6.9 · 0.6 | 12.7 · 3.9 | 18.9 · 10.2 | 22.8 · 14.4 | 29.2 · 19.8 | 35.8 · 23.8 |
520
- | trumpet | 6.1 · 1.3 | 16.8 · 4.1 | 31.4 · 10.4 | 44.7 · 14.8 | 46.5 · 21.4 | 60.3 · 25.0 |
521
-
522
- 0.2.0 (the AR rebuild alone), 1–20 dB: speech 2.3 / 11.6 / 24.2 / 31.2 / 37.7 / 42.4, "Vibe Ace" 3.8 / 9.3 / 15.6 / 19.7 / 26.5 / 32.9, Brahms 1.5 / 8.5 / 16.1 / 20.0 / 26.4 / 34.0, the trumpet 2.9 / 15.1 / 31.4 / 45.6 / 46.1 / 58.8: the blend gains 3–6 dB at 1 dB, up to 4.9 above it on the music, and loses 0.7 on speech at 3 dB and 0.9 on the trumpet at 10. On the survey's own test, its ten SQAM excerpts (solo instruments and an ensemble, 44.1 kHz) clipped by its `clip_sdr.m`, mean ΔSDR over the clipped samples, dB, beside the means it publishes for its leading methods (code and results: [declipping2020_codes](https://github.com/rajmic/declipping2020_codes)):
582
+ | speech | 8.5 · 1.1 | 10.9 · 5.0 | 24.1 · 12.1 | 31.7 · 16.9 | 38.2 · 24.0 | 42.8 · 30.5 |
583
+ | "Vibe Ace" | 8.4 · 1.6 | 13.8 · 5.0 | 19.7 · 10.3 | 24.4 · 14.0 | 31.4 · 19.9 | 36.3 · 24.6 |
584
+ | Brahms | 7.2 · 0.6 | 13.4 · 3.9 | 19.3 · 10.2 | 23.1 · 14.4 | 29.2 · 19.8 | 35.9 · 23.8 |
585
+ | trumpet | 6.6 · 1.3 | 16.7 · 4.1 | 31.4 · 10.4 | 42.8 · 14.8 | 46.2 · 21.4 | 59.7 · 25.0 |
586
+
587
+ 0.3.0 (the AR rebuild and the 93 ms sparse one), 1–20 dB: speech 8.4 / 10.9 / 24.2 / 31.9 / 38.3 / 42.6, "Vibe Ace" 6.9 / 13.1 / 19.1 / 22.7 / 31.4 / 36.2, Brahms 6.9 / 12.7 / 18.9 / 22.8 / 29.2 / 35.8, the trumpet 6.1 / 16.8 / 31.4 / 44.7 / 46.5 / 60.3: the long blocks gain up to 1.7 dB on the music, the trumpet at 10 dB loses 1.9. On the survey's own test, its ten SQAM excerpts (solo instruments and an ensemble, 44.1 kHz) clipped by its `clip_sdr.m`, mean ΔSDR over the clipped samples, dB, and PEAQ's ODG (Kabal's implementation as the survey ran it, ported in [audio](https://github.com/audiojs/audio)'s `bench/rx/peaq.py`: the survey's grades of its clipped inputs to within 0.0015), beside the means it publishes for its leading methods (code and results: [declipping2020_codes](https://github.com/rajmic/declipping2020_codes); PEAQ with the reliable samples replaced, as declip keeps them):
588
+
589
+ | input SDR | 1 dB | 3 dB | 5 dB | 7 dB | 10 dB | 15 dB | 20 dB | mean ΔSDR | mean ODG |
590
+ |---|---:|---:|---:|---:|---:|---:|---:|---:|---:|
591
+ | declip | 9.7 | 14.0 | 15.6 | 16.7 | 18.5 | 20.5 | 22.1 | 16.7 | −1.84 |
592
+ | declip 0.3.0 | 8.3 | 13.2 | 14.8 | 15.8 | 17.6 | 19.7 | 21.9 | 15.9 | −1.95 |
593
+ | social sparsity, PEW (Siedenburg, Kowalski & Dörfler 2014) | 12.2 | 15.0 | 16.6 | 17.7 | 19.0 | 21.2 | 22.2 | 17.7 | −1.60 |
594
+ | A-SPADE | 11.9 | 13.9 | 15.1 | 16.0 | 17.3 | 19.4 | 20.3 | 16.3 | −2.40 |
595
+ | S-SPADE | 11.4 | 13.7 | 15.0 | 15.6 | 17.1 | 19.3 | 19.9 | 16.0 | −2.59 |
596
+ | ℓ1, parabola-weighted | 9.9 | 13.0 | 14.8 | 16.0 | 17.4 | 19.6 | 21.0 | 16.0 | −1.66 |
597
+ | NMF (Bilen, Ozerov & Pérez 2018) | 5.1 | 12.2 | 14.3 | 16.2 | 18.0 | 20.6 | 22.0 | 15.5 | −1.46 |
598
+ | Janssen (AR) | −0.9 | −1.3 | 0.6 | 3.5 | 7.9 | 17.0 | 19.6 | 6.6 | −2.28 |
599
+ | iZotope RX 12 De-clip, tuned (below) | 0.8 | 5.4 | 8.2 | 9.7 | 11.5 | 14.0 | 15.8 | 9.4 | −2.26 |
600
+
601
+ On the mean ΔSDR 2nd of the 7 (0.3.0: 5th), 1.0 dB behind social sparsity; from 3 dB up ahead of both SPADEs and ℓ1 at every level, of NMF but at 15 dB (0.1), behind social sparsity by 0.15–1.05 dB; at 1 dB behind A-SPADE by 2.2 and social sparsity by 2.5. On ODG 4th, behind NMF, social sparsity and ℓ1 by 0.18–0.38, at 3–7 dB by up to 0.7. The blend misjudges some held tones: the clarinet clipped to 15 dB comes back 17.1 dB, its 186 ms sparse rebuild alone 22.1 (the second clip scores a fill's overshoot inside the first clip's runs as nothing, only its bound being known there). On VoiceBank speech (below) it is 0.3.0 within 0.1 dB at every level.
602
+
603
+ Against iZotope RX 12 Advanced De-clip (VST3 hosted by Pedalboard, output aligned to the input; [audio](https://github.com/audiojs/audio)'s `bench/rx/declip.mjs`, 2026-10), through `audio`'s `declip()`. Test: the ten SQAM excerpts; "other music", four MUSDB18 test mixtures and "Vibe Ace", Brahms, the trumpet and the Sugar Plum Fairy (6 s each); speech, 16 VoiceBank clean test utterances. Each clipped at the level leaving it 1–20 dB from the original and scaled so its rails sit at 0 dBFS; asym: the positive rail at the 15 dB level, the negative at the 7 dB level; down: the 7 dB clip turned down 6 dB; MP3: the 7 dB clip through LAME at 128 kbit/s; soft: tanh(g·x), g giving 10 dB (analog saturation, no rail); atan: (2/π)·arctan(π/2·g·x) likewise, a softer knee outside both of declip's curves. RX at its defaults (threshold −1.02 dBFS, quality Low, post-limiter on), and tuned per condition and kind on other material (four MUSDB18 training mixtures, ten VoiceBank training utterances): asymmetric thresholds at each side's peak plus an offset (−0.07 to −6 dB) × quality, post-limiter off; its best: −0.07 dB on flat rails (High; Low or Medium on some speech conditions), High at −2 dB on MP3, −2 (music) and −4 (speech) on soft, −2 and −6 on atan. Mean ΔSDR, dB, RX default · RX tuned · declip:
604
+
605
+ | condition | SQAM | other music | speech |
606
+ |---|---:|---:|---:|
607
+ | 1 dB | −0.8 · 0.8 · 9.7 | −0.8 · −0.6 · 6.2 | −0.8 · −0.4 · 5.8 |
608
+ | 3 dB | −1.4 · 5.4 · 14.0 | −1.6 · 1.5 · 10.4 | −1.5 · 2.3 · 8.7 |
609
+ | 5 dB | −1.9 · 8.2 · 15.6 | −2.2 · 3.5 · 12.0 | −2.1 · 4.7 · 10.0 |
610
+ | 7 dB | −2.4 · 9.7 · 16.7 | −2.6 · 4.8 · 12.8 | −2.6 · 7.0 · 10.5 |
611
+ | 10 dB | −3.2 · 11.5 · 18.5 | −3.2 · 6.3 · 14.5 | −3.5 · 8.2 · 10.1 |
612
+ | 15 dB | −4.3 · 14.0 · 20.5 | −3.9 · 8.3 · 14.5 | −4.8 · 10.7 · 12.2 |
613
+ | 20 dB | −5.1 · 15.8 · 22.1 | −4.4 · 9.4 · 15.6 | −5.9 · 11.4 · 13.0 |
614
+ | asym | −1.4 · 12.0 · 18.4 | −0.9 · 6.4 · 14.2 | −2.1 · 10.5 · 12.0 |
615
+ | down | 0.0 · 9.7 · 16.7 | 0.0 · 4.8 · 12.8 | 0.0 · 6.8 · 10.5 |
616
+ | MP3 | −2.0 · 7.1 · 11.7 | −2.2 · 3.5 · 9.2 | −2.2 · 5.2 · 9.5 |
617
+ | soft | −0.8 · 0.6 · 40.0 (0.4.0: 0.0; its level given: 1.6) | −0.7 · 0.2 · 39.9 (0.0; 2.0) | −1.0 · 2.2 · 20.0 (0.0; 5.1) |
618
+ | atan | −0.0 · 0.2 · 16.7 | −0.0 · 0.0 · 17.0 | −0.0 · 1.1 · 17.3 |
523
619
 
524
- | input SDR | 1 dB | 3 dB | 5 dB | 7 dB | 10 dB | 15 dB | 20 dB | mean |
525
- |---|---:|---:|---:|---:|---:|---:|---:|---:|
526
- | declip | 8.3 | 13.2 | 14.8 | 15.8 | 17.6 | 19.7 | 21.9 | 15.9 |
527
- | social sparsity, PEW (Siedenburg, Kowalski & Dörfler 2014) | 12.2 | 15.0 | 16.6 | 17.7 | 19.0 | 21.2 | 22.2 | 17.7 |
528
- | A-SPADE | 11.9 | 13.9 | 15.1 | 16.0 | 17.3 | 19.4 | 20.3 | 16.3 |
529
- | S-SPADE | 11.4 | 13.7 | 15.0 | 15.6 | 17.1 | 19.3 | 19.9 | 16.0 |
530
- | ℓ1, parabola-weighted | 9.9 | 13.0 | 14.8 | 16.0 | 17.4 | 19.6 | 21.0 | 16.0 |
531
- | NMF (Bilen, Ozerov & Pérez 2018) | 5.1 | 12.2 | 14.3 | 16.2 | 18.0 | 20.6 | 22.0 | 15.5 |
532
- | Janssen (AR) | −0.9 | −1.3 | 0.6 | 3.5 | 7.9 | 17.0 | 19.6 | 6.6 |
620
+ Perceptually the same order: PEAQ ODG on the music, PESQ (wideband, 16 kHz) on speech, input · RX tuned · declip: 7 dB, SQAM −3.75 · −2.44 · −1.74, other music −3.65 · −2.72 · −1.85, speech 2.10 · 3.42 · 3.85; 20 dB −2.35 · −0.39 · −0.18, −1.29 · −0.23 · −0.12, 3.69 · 4.50 · 4.56; MP3 −3.49 · −3.27 · −2.78, −3.60 · −3.21 · −2.77, 2.10 · 3.05 · 3.74; soft −2.86 · −2.84 · 0.11, −2.51 · −2.40 · 0.16, 3.12 · 3.41 · 4.60 (0.4.0, its level given: −2.75, −2.21, 3.85); atan −2.87 · −2.86 · −0.88, −2.50 · −2.46 · −0.32, 3.20 · 3.22 · 4.49. RX at its defaults takes SDR off everywhere: its post-limiter holds the restored peaks to 0 dBFS, and its threshold finds nothing on rails under −1 dBFS (down). On the unclipped recordings peak-normalized to 0 dBFS, and through a lookahead limiter 12 dB over a −0.2 dBFS ceiling, declip changes no sample; RX changes them (SDR to its input, median: defaults 59–68 dB, 43–49 limited; tuned 77–94, 58–74). On soft saturation 0.4.0 found no rail and returned it untouched; given the level RX's tuned threshold sits at, `declip({ clipLevel })` gained 1.6–5.1 dB. 0.5.0 fits the curve itself (on all 34 takes of each: 0.07–2.2 nats a sample under tanh, 0.05–1.3 under arctan, the peaks bent to 1/24 and 1/9 of their slope or less): under tanh, one of its curves, 20–40 dB; under arctan, outside both, 16.7–17.3; RX tuned 0.0–2.2 on either. The other conditions' 340 clipped takes each have a rail or a band, found as 0.4.0 finds them, so 0.5.0 takes 0.4.0's path there and its numbers are 0.4.0's (asym, rendered again: the same to the sample).
533
621
 
534
- At 10–20 dB ahead of both SPADEs and ℓ1, behind social sparsity by 0.3–1.5 dB and NMF by 0.1–0.9; at 3–7 dB behind A-SPADE by 0.2–0.7, at 1 dB by 3.6, where the blend leans on its sparse rebuild, which grows its sparsity faster than the survey's (8× fewer iterations) in blocks half as long; on the mean, 5th of the 7, within 0.1 dB of S-SPADE and ℓ1. 0.2.0 averaged 13.2 there (1 dB: 4.9, 20 dB: 19.8). VoiceBank+DEMAND's clean test set, every 20th utterance clipped to 3, 10 and 20 dB: declip 11.5, 20.4 and 33.1 dB (0.2.0 at 10 and 20: 19.8 and 32.4), `adeclip` 5.1, 16.0 and 28.2.
622
+ Under curves outside its two and the noise a real chain adds after the curve, `declip` alone (`node bench/rx/declip.mjs curves`, the same test material), SDR in → out, dB, SQAM · other music · speech: x/√(1 + x²) to 10 dB, 29.7 · 28.7 · 28.3; tanh with the negative ceiling at 0.7, 22.8 · 23.0 · 23.1; a biased tanh, tanh(x + 0.3) − tanh(0.3) (even harmonics, a valve's), 13.0 · 12.6 · 14.8; tanh to 20 dB, 50.4 · 63.4 · 26.1; to 30 dB, 35.6 · 34.7 · 30.0 (speech bent so little is left as it is); tanh to 10 dB, then hiss 60 dB under full scale, 22.4 · 22.1 · 23.0. Hiss draws the fitted ceiling outward, a biased curve is fitted by an unbiased one: still well over the input, short of the curves it fits exactly.
535
623
 
536
- Rails are found at the 20 dB level clipped asymmetrically (with the 10 dB level below), on one side only, then turned down to 0.4, quantized to 16 bits plain or dithered, and on a 16-bit converter driven 2.5 dB over (rails at 32767 and −32768): 13 dB or more of SDR gained in each. The unclipped material through it, as it is, peak-normalized, at 16 bits and through a lookahead limiter 12 dB over its ceiling: not a sample changed; nor in any of VoiceBank+DEMAND's 824 clean test utterances. It takes about 7 s per second of sound averaged over the six levels, most of it at 1–3 dB (0.2.0: 3; `adeclip`: 11–15; on the trumpet, its runs short: 2, 0.7 and 2).
624
+ Rails are found at the 20 dB level clipped asymmetrically (with the 10 dB level below), on one side only, then turned down to 0.4, quantized to 16 bits plain or dithered, and on a 16-bit converter driven 2.5 dB over (rails at 32767 and −32768): 13 dB or more of SDR gained in each; through MP3 and AAC at 128 kbit/s, bands: speech 18.0 → 25.2 and 19.9 → 31.6, "Vibe Ace" 18.3 → 25.1 and 19.8 → 28.7, Brahms 18.2 → 24.8 and 19.6 → 28.0, the trumpet 18.1 → 24.9 and 19.3 → 26.9 dB (0.3.0: untouched). The unclipped material through it, as it is, peak-normalized, at 16 bits and through a lookahead limiter 12 dB over its ceiling: not a sample changed; nor in any of VoiceBank+DEMAND's 824 clean test utterances. The third rebuild costs time: 1.2–2.1× 0.3.0's side by side (0.3.0: about 7 s per second of sound averaged over the six levels, most of it at 1–3 dB), the AR rebuild's early stop giving some back (speech clipped to 3 dB: 0.8×).
537
625
 
538
- **Use when:** digital clipping: a converter overdriven, a mix bounced too hot, a plug-in's hard clip; at any level, on either side or both.<br>
539
- **Not for:** clipping that has since been through lossy coding or resampling (the plateau is no longer flat, and no rail is found); soft saturation, tape or tube, which has no rail.
626
+ **Use when:** digital clipping: a converter overdriven, a mix bounced too hot, a plug-in's hard clip; at any level, on either side or both; also after it went through MP3, AAC or Opus; soft saturation, a valve, transistor or tape stage driven hot, found by itself.<br>
627
+ **Not for:** a limiter's or a compressor's work (a gain that moves, no curve: left as it is); saturation with memory (tape's hysteresis, a stage whose bias shifts with the level), where a curve fitted to the whole take is only near; clipping that has since been resampled or heavily filtered.
540
628
 
541
629
 
542
630
  ## Reverb
543
631
 
544
632
  ### `dereverb`
545
633
 
546
- Late reverberation off a voice, one microphone, the whole take at once. First weighted prediction error, WPE (Nakatani et al. 2010): in each STFT bin, what the frames from 43 to 150 ms back predict of the current one (at 48 kHz: from the first frame that shares no sample with it) is the room's tail, and is subtracted; the prediction is fitted over the whole take, each frame weighted by its inverse power, three times. The room is one for the take and the voice is not, so the fit learns the room. One microphone cannot invert a room, and the prediction cancels a dB or two of the tail. The rest is taken in power, as Lebart et al. (2001) and Habets (2010) model the late reverberation: from the power of the frames before, here weighed by the shape of WPE's taps, the room's decay in that bin. Its scale is read off the take itself: where only the tail sounds, the power over its expectation is exponential, and a tenth of such cells fall under 0.105 of it, while the voice's cells lie above; so the 10th percentile of the power over the weighed past, per octave band, divided by 0.105, is the late reverberation's share. It reads a 3 s clip and a minute-long take alike (0.3 scaled the taps' own power, which on 3 s predicted about all the late power and on 30 s a quarter). A log-spectral-amplitude gain (Ephraim & Malah 1985) takes that power off what WPE left, floored at −14 dB, and no bin leaves louder than it came. Two checks on the whole take come first, and either returns it bit for bit: dry, when its fastest falls are faster than a room's tail lets a sound fall (90 % of dry VoiceBank takes); no pauses, when under half of its frames are under half its mean power (Scheirer & Slaney 1997): there a held note's sustain reads as a room's. A bin cut to digital silence (an edit, a gate) is left out of the fit. About 0.1 s per second of 48 kHz sound (a 41 s take: 4.7 s, 0.3 4.0 s).
634
+ Late reverberation off a voice, one microphone, the whole take at once. First weighted prediction error, WPE (Nakatani et al. 2010): in each STFT bin, what the frames from 43 to 150 ms back predict of the current one (at 48 kHz: from the first frame that shares no sample with it) is the room's tail, and is subtracted; the prediction is fitted over the whole take, each frame weighted by its inverse power, three times. The room is one for the take and the voice is not, so the fit learns the room. One microphone cannot invert a room, and the prediction cancels a dB or two of the tail. The rest is taken in power, as Lebart et al. (2001) and Habets (2010) model the late reverberation: from the power of the frames before, here weighed by the shape of WPE's taps, the room's decay in that bin. Its scale is read off the take itself: where only the tail sounds, the power over its expectation is exponential, and a tenth of such cells fall under 0.105 of it, while the voice's cells lie above; so the 10th percentile of the power over the weighed past, per octave band, divided by 0.105, is the late reverberation's share. It reads a 3 s clip and a minute-long take alike (0.3 scaled the taps' own power, which on 3 s predicted about all the late power and on 30 s a quarter). A log-spectral-amplitude gain (Ephraim & Malah 1985) takes that power off what WPE left, floored at −14 dB, and no bin leaves louder than it came. Three checks on the whole take come first, and any returns it bit for bit: dry, when its fastest falls are faster than a room's tail lets a sound fall (90 % of dry VoiceBank takes); no diffuse tail, when its lowest cells do not fall as a room's tail does: a diffuse tail's power is exponential, its 2nd percentile 7.2 dB under its 10th (ln 0.98 / ln 0.9), while a dry sound's own decays, a voice's closures, a muted string, part them further (the training rooms 7.0–8.1 dB apart, dry VoiceBank 8.6–17.7, GuitarSet 8.3–12.6; over 9, the take passes); no pauses, when under half of its frames are under half its mean power (Scheirer & Slaney 1997): there a held note's sustain reads as a room's. Before them, from 0.6, music passes: a take that holds a partial (a spectral peak at one frequency, 200 Hz–4 kHz, its power within 3 dB for 0.3 s: a sung, bowed or blown note) or keeps a beat (its onsets recurring at one period, 40–200 bpm, past what chance gives a voice for the take's length), two marks Scheirer & Slaney tell music by; recorded in a room, music passes the three checks, and the late power the past carries over-reads a held note (below). A bin cut to digital silence (an edit, a gate) is left out of the fit, and the frames that reach into such a cut, or past the take's end, out of the checks and the scale: their fall is the cut's. About 0.1 s per second of 48 kHz sound (a 41 s take: 4.7 s, 0.3 4.0 s; the music check adds about a tenth).
547
635
 
548
636
  ```js
549
637
  dereverb(data, { fs: 48000 })
550
638
  dereverb(data, { fs: 48000, strength: 0.5 }) // a lighter hand
639
+ dereverb(data, { fs: 48000, music: 'enhance' }) // music in a room taken as a room too
551
640
  ```
552
641
 
553
642
  | Param | Default | |
554
643
  |---|---|---|
555
644
  | `strength` | `1` | Scale of the late-reverberation estimate (1: as the take's own decays read it): 0 is the linear prediction alone, 2 takes more of the tail and more of the voice |
645
+ | `music` | `'pass'` | `'pass'`: a take holding a partial or keeping a beat comes back as it went; `'enhance'`: taken as a room too, a held note losing with the tail |
556
646
 
557
- Measured (`python scripts/dereverb.py`, test set): 42 VoiceBank test utterances (1.6–5.9 s), and four 41–60 s takes of ten utterances by one speaker, in 19 MIT IR Survey rooms the tuning never heard (T60 0.38–1.85 s). Each room's response is split at direct + 50 ms: under it, the voice as the room colours it; over it, the tail to take. Voice lost: the output's power where the voice is 10 dB over the tail; tail taken: where the tail is 10 dB over the voice. PESQ and STOI against the dry take; SRMR (Falk et al. 2010) higher is drier; DNSMOS at the input's loudness; the dry takes through it: the share returned untouched, PESQ. 0.3 → 0.4, and DeepFilterNet3 (`@audio/neural-denoise`, a denoiser that also learned to take reverberation) on the same takes:
647
+ Measured against iZotope RX 12 Advanced De-reverb (VST3 hosted by Pedalboard; [`audio`](https://github.com/audiojs/audio)'s `bench/rx/dereverb.mjs`, October 2026), through `audio`'s `dereverb()`, on the takes of `scripts/dereverb.py` (test set): 42 VoiceBank test utterances (1.6–5.9 s) and four 41–60 s takes of ten utterances by one speaker, in 19 MIT IR Survey rooms the tuning never heard (T60 0.38–1.85 s), each room's response split at direct + 50 ms: under it, the voice as the room colours it; over it, the tail to take. Voice lost: the output's power where the voice is 10 dB over the tail; tail taken: where the tail is 10 dB over the voice. PESQ against the dry take, DNSMOS OVRL at the input's loudness; noisy: the same takes with DEMAND noise 10 dB under them; dry: their dry takes, the share returned bit for bit and PESQ. RX at its defaults (reduction 10 dB, tail length 1 s, artifact smoothing 9, band strengths 6); after its Learn on each take (it learns a tail length and four band strengths); and at its best on reverberant VoiceBank training utterances by PESQ, searched over reduction, tail length, smoothing, the band strengths, enhance dry signal and Learn (tail length 0.5 s, band strengths 8, 4, 6, 4, the rest at defaults). RX Dialogue Isolate, a trained separator, with its reverb gain at −∞ and its noise kept, for reference:
558
648
 
559
- | | voice lost dB | tail taken dB | PESQ | STOI | SRMR | OVRL | dry: untouched, PESQ |
560
- |---|---|---|---|---|---|---|---|
561
- | short takes in | | | 1.39 | 0.774 | 3.98 | 2.19 | 4.64 |
562
- | short, `dereverb` | −0.81 → −0.79 | −6.2 → −6.3 | 1.50 → **1.53** | 0.768 → **0.783** | 6.90 → 6.84 | 2.47 → 2.48 | 0 → **95 %**, 4.25 → **4.63** |
563
- | short, DeepFilterNet3 | −2.71 | −3.7 | 1.52 | 0.787 | 5.48 | 2.46 | 4.54 |
564
- | long takes in | | | 1.37 | 0.739 | 3.43 | 1.98 | 4.64 |
565
- | long, `dereverb` | −0.25 → −0.61 | −3.3 → **−6.6** | 1.49 → **1.54** | 0.749 → 0.753 | 4.99 → **6.13** | 2.43 → **2.52** | 0 → **100 %**, 4.58 → **4.64** |
566
- | long, DeepFilterNet3 | −2.42 | −0.8 | 1.51 | 0.757 | 4.10 | 2.22 | 4.52 |
649
+ | | short: voice lost, tail taken dB | PESQ | OVRL | long: voice lost, tail taken dB | PESQ | OVRL | noisy: PESQ | OVRL | dry: untouched, PESQ |
650
+ |---|---|---|---|---|---|---|---|---|---|
651
+ | takes in | | 1.39 | 2.19 | | 1.37 | 2.01 | 1.26 | 1.66 | 4.64 |
652
+ | RX De-reverb, defaults | −0.01, −1.1 | 1.45 | 2.36 | −0.02, −0.8 | 1.43 | 2.16 | 1.28 | 1.80 | 0, 4.07 |
653
+ | RX De-reverb, learned | −0.77, −3.1 | 1.47 | 2.35 | −1.07, −4.6 | 1.51 | 2.28 | 1.29 | 1.89 | 0, 4.30 |
654
+ | RX De-reverb, tuned | −0.18, −2.3 | 1.45 | 2.32 | −0.16, −1.5 | 1.43 | 2.09 | 1.27 | 1.75 | 0, 4.17 |
655
+ | RX Dialogue Isolate, reverb off | −3.18, −8.3 | **1.79** | **2.70** | −4.29, −6.2 | **1.77** | **2.57** | 1.34 | **2.18** | 0, 4.64 |
656
+ | `dereverb` 0.4 → 0.5 | −0.79, −6.3 | 1.53 | 2.49 | −0.61, −6.6 | 1.54 | 2.52 | **1.35** | 2.08 | 96 → **100 %**, 4.63 → **4.64** |
657
+ | `dereverb` 0.6 | −0.79, −6.3 | 1.53 | 2.49 | −0.61, −6.6 | 1.54 | 2.52 | **1.35** | 2.08 | **100 %**, **4.64** |
567
658
 
568
- `strength` 0, 1, 2, 4: on the short takes the tail −1.5, −6.3, −8.3, −10.3 dB for the voice −0.20, −0.79, −1.17, −1.67; on the long ones the tail −1.1, −6.6, −8.8, −10.6 for the voice −0.07, −0.61, −0.95, −1.39. The voice lost is mostly under 250 Hz (−1.5 to −2.3 dB there, −0.4 to −0.6 over 1 kHz), where a voice's low harmonics hold their pitch as a room's tail does.
659
+ Take by take, `dereverb` over RX De-reverb tuned: PESQ +0.08 ± 0.02 (short), +0.10 ± 0.05 (long), +0.08 ± 0.02 (noisy), OVRL +0.17 ± 0.09, +0.43 ± 0.43, +0.33 ± 0.12 (95 % intervals); over its Learn, PESQ +0.06 ± 0.03, +0.02 ± 0.06, +0.06 ± 0.02. At the voice its Learn loses (−0.8 dB on the short takes) it takes 3.2 dB more of the tail; tuned, RX keeps more of the voice (−0.2 dB) and takes a third of the tail. On reverberant VoiceBank in 130 rooms (`vbreverb`, 206 test utterances; `audio`'s `bench/speech.mjs`): PESQ 2.33 in, RX defaults 2.42, tuned 2.46, `dereverb` 0.4 2.62, 0.5 and 0.6 2.61 (over RX tuned +0.14 ± 0.02; 0.6 passes one utterance more, its speaker holding a vowel's pitch: 2.606 → 2.604), OVRL 2.82, 2.86, 2.87, 2.94, 2.94; the dry takes through it: RX 4.09 and 4.17, `dereverb` 4.63 → 4.64, untouched 94 → 100 %. On the training utterances RX's best setting gained PESQ 0.07 (2.42 → 2.49; on the half searched 2.37 → 2.44), its Learn 0.04 (2.37 → 2.41).
569
660
 
570
- Through it as it is (0.3 → 0.4; untouched: the share returned bit for bit; level change per octave, the worst of 63 Hz–8 kHz):
571
-
572
- | | untouched | level change |
573
- |---|---|---|
574
- | VocalSet spoken, 20 | 0 → 85 % | −0.64 → −0.21 dB |
575
- | VocalSet sung straight tones, 20 | 0 → 70 % | −1.38 → −0.92 dB |
576
- | MUSDB18 previews, 25 | 0 → 76 % | −3.73 → −0.24 dB |
577
- | GuitarSet, 20 | 0 → 75 % | −2.37 → −0.77 dB |
578
- | Brahms, the Nutcracker, a trumpet | 0 → 100 % | −5.53 → 0 dB |
579
- | Vibe Ace | 0 → 0 % | −4.26 → −3.68 dB |
661
+ Where the rest lies: on the training rooms the take with its late part gone exactly scores PESQ 2.03 (short) and 2.12 (long), the ideal ratio mask (each cell's true voice and tail power) 1.98 and 2.11, `dereverb` 1.72 and 1.81. Its gain fed each cell's true late power, in place of the estimate, reaches 1.73 and 1.80 (1.75 and 1.83 at a −20 dB floor): the late power is estimated as well as it can be used. The floor (−10, −14, −20 dB), a Wiener gain for the LSA, the decision-directed memory (0.7–0.95) and the strength (0.7–1.5) all moved PESQ by under 0.02. What is missing is the voice's own power in each cell, which no model of the room gives and a trained model learns: RX Dialogue Isolate scores 0.26 over `dereverb` on the short takes, taking 3.2–4.3 dB of the voice's first 50 ms with the tail.
580
662
 
581
- On reverberant VoiceBank in 130 rooms (`vbreverb`, below) PESQ 2.55 → 2.62, STOI 0.897 → 0.908 (the input 0.904), dry takes 4.24 → 4.63, 94 % of them untouched. The constants were chosen on `scripts/dereverb.py train` (training speakers in the even-numbered rooms: tail −7.4 and −7.9 dB, PESQ 1.48 → 1.72 and 1.51 → 1.81), the music checks on the even-numbered MUSDB18 previews and other GuitarSet takes.
663
+ Through it as it is, music at 44.1 kHz (untouched: the share returned bit for bit; level change per octave, the worst of 63 Hz–8 kHz; with pauses: the same music cut into 2–4 s phrases, 0.5–1.5 s apart, over a noise floor 50 dB under it; in a room: through the test rooms, music lost and tail taken as for the voice):
582
664
 
583
- 0.2 fitted the prediction recursively, over its last second, and learned some of the voice as room. 0.3 scaled the taps' power by a constant, so its estimate grew as the take shortened: on 3 s it took 2–3 dB more than on a minute, and a dry voice came out at PESQ 4.25. Late-reverb subtraction at each room's measured T60 (Lebart; Habets's κ, the T60 an oracle's) scored under the taps' shape scaled by the percentile (short training takes: PESQ 1.64 against 1.71), and an exponential decay at the measured T60 in place of the taps' shape scored the same. Refitting WPE on the gain's output (its weights from the voice estimate, as DNN-WPE takes them) changed nothing. Sparing a spectral peak that holds over 43 ms (a held partial) cost 1.5–2 dB of the tail. No feature tried told speech in the longest rooms from music: the share of low-energy frames, over a second or over the take, and how long the spectrum's fine structure holds (0.3 at 110 ms in a room, 0.34–0.53 for the music pieces) overlap. DeepFilterNet3 takes the first 50 ms with the tail (−2.4 to −2.7 dB of the voice) and here less of the tail; iZotope RX was not available to measure.
665
+ | | RX defaults | RX learned | RX tuned | `dereverb` 0.4 → 0.5 | 0.6 |
666
+ |---|---|---|---|---|---|
667
+ | MUSDB18 previews (25) | −0.32 dB | −5.66 | −1.27 | 80 → 92 %, −0.47 → −0.15 | **96 %**, **−0.12** |
668
+ | … with pauses | −0.58 | −1.44 | −1.91 | 76 → **100 %**, −0.35 → **0** | **100 %**, **0** |
669
+ | GuitarSet (20) | −0.81 | −0.24 | −1.03 | 75 → **100 %**, −0.77 → **0** | **100 %**, **0** |
670
+ | … with pauses | −1.67 | −0.27 | −2.50 | 95 → **100 %**, 0 | **100 %**, **0** |
671
+ | VocalSet sung straight tones (10) | −0.34 | −2.29 | −0.14 | 70 → **100 %**, −0.65 → **0** | **100 %**, **0** |
672
+ | … with pauses | −0.59 | −0.25 | −2.68 | 100 %, 0 | **100 %**, **0** |
673
+ | Brahms, the Nutcracker, a trumpet, Vibe Ace | −0.53 | −5.58 | −1.74 | 50 %, −3.07 | **100 %**, **0** |
674
+ | … with pauses | −0.84 | −0.74 | −2.02 | 50 → **100 %**, −2.16 → **0** | **100 %**, **0** |
675
+ | in a room, music lost, tail taken dB: MUSDB18 | **0.0**, −0.6 | −3.5, −8.6 | −0.3, −3.0 | −0.5, −0.1 | −0.1, −0.1 |
676
+ | GuitarSet | −0.2, 0.0 | −0.4, −2.8 | −0.4, −0.7 | −1.6, −1.5 | **−0.1**, +0.3 |
677
+ | the four pieces | −0.2, −0.4 | −3.0, −7.1 | −0.3, −2.5 | −1.1, −10.1 | **0.0**, 0.0 |
678
+ | VocalSet sung | **+0.1**, −0.2 | −1.3, −3.0 | **+0.1**, −0.1 | −2.9, −7.8 | **+0.1**, +0.1 |
679
+
680
+ In a room the music's lowest cells are the room's tail, so 0.5 processed it, and the late power the past carries over-reads a held note: in steady state the estimate is the scale times the note itself, while a room with a strong direct sound adds less (Lebart's model over-estimates as the direct-to-reverberant ratio grows; Habets, IEEE SPL 16(9), 2009); a take it processed lost 1 to 5.6 dB of its music where the music stood 10 dB over the tail. 0.6 reads music's marks before fitting the room: of the 40 music takes in the training rooms and halls that the three checks let through, 31 hold a partial or keep a beat and pass (all 15 of GuitarSet's, 9 of 10 sung, 3 of 5 of the pieces, 4 of 10 MUSDB18 songs), on the test takes 36 of 41, the four pieces as recorded all of them. A voice's pitch moves: of 152 voices in the training rooms (50 short and long takes, the same with noise, 42 reverberant VoiceBank utterances, ten narrations) none held a partial for over 2.2·10⁻⁵ of its energy, against the 3·10⁻⁴ that passes a take (test: a narration 1.5·10⁻⁴; of 50 dry utterances one held a vowel's pitch, 3.7·10⁻⁴), and none came nearer the beat's 1.5 than 1.09 (test 0.88); of the 206 reverberant VoiceBank test utterances one, whose speaker holds a vowel's pitch, now passes. What still goes through as a voice: a song whose drums and voice keep its spectrum moving and whose beat 7 s cannot show (3 of 25 MUSDB18 previews in a room, −0.1 dB). The constants were chosen on `scripts/dereverb.py train` (training speakers in the even-numbered rooms), the 9 dB on those takes, the dry training takes and the even-numbered MUSDB18 previews, other GuitarSet takes and VocalSet singers; it passes 13 % of the reverberant VoiceBank training utterances that 0.4 processed (rooms with little tail, where the voice's own falls outnumber the tail's), which cost PESQ 0.03 there and 0.01 on the test set; the music check's two on `audio`'s `bench/rx/dereverb.mjs` train split, an order of magnitude over the voices' held share and 0.4 over their beat.
681
+
682
+ 0.2 fitted the prediction recursively, over its last second, and learned some of the voice as room. 0.3 scaled the taps' power by a constant, so its estimate grew as the take shortened: on 3 s it took 2–3 dB more than on a minute, and a dry voice came out at PESQ 4.25. Late-reverb subtraction at each room's measured T60 (Lebart; Habets's κ, the T60 an oracle's) scored under the taps' shape scaled by the percentile (short training takes: PESQ 1.64 against 1.71), and an exponential decay at the measured T60 in place of the taps' shape scored the same. Refitting WPE on the gain's output (its weights from the voice estimate, as DNN-WPE takes them) changed nothing. Sparing a spectral peak that holds over 43 ms (a held partial) cost 1.5–2 dB of the tail; peaks held 0.3 s (as noise-estimate's partials guard holds them) hold in a long room's reverberant speech as in music (up to 95 % of the energy). Pitch steadiness, power steadiness over three frames and 4 Hz modulation overlapped between speech in a room and music; so did spectral flux, the 1/3-octave spectrum's change of shape from frame to frame, whose border moved with the speaker (training voices 5.2 dB at least, a test speaker 4.7). 0.4 judged a take dry on its fastest fall alone, and passed music only when it had no pauses: GuitarSet, sung tones and music with pauses were processed.
584
683
 
585
684
  **Use when:** a voice in a room, one microphone, one room per take.<br>
586
- **Not for:** music with pauses in it is taken for a voice in a room (Vibe Ace −3.7 dB under 500 Hz). Noise: denoise first.
685
+ **Not for:** music, which passes untouched when it holds a partial or keeps a beat (a song with neither in a short take is processed: 3 of 25 MUSDB18 previews in a room, −0.1 dB; `music: 'enhance'` takes any music as a room, a held note losing 0.5–3 dB with the tail); a voice holding a sung pitch passes too. Noise: denoise first.
587
686
 
588
687
 
589
688
  ## Bleed
@@ -696,6 +795,88 @@ Clean, every clip comes back bit-exact: 25 tuning and 19 held-out clips, the 504
696
795
  **Not for:** random tape wow read from the music alone (left as it is); a solo voice or instrument without a tone to read; dropouts; azimuth/time-skew.
697
796
 
698
797
 
798
+ ## Guitar
799
+
800
+ ### `desqueak`
801
+
802
+ Guitar de-noise: string squeaks taken down where a finger slides on a wound string, the notes left as they ring; a pick's harsh attack softened, the amp's hiss and buzz taken down, on request.
803
+
804
+ ```js
805
+ import { desqueak } from '@audio/denoise'
806
+ ```
807
+
808
+ Three parts, as iZotope RX's Guitar De-noise has; squeak on by default, pick and amp when given a level. Where a part finds nothing, the take comes back sample for sample (the amp part, once on, reworks the whole take).
809
+
810
+ **Squeak.** A fingertip sliding along a wound string strikes each winding it crosses: a pulse train at v/d, the slide's speed over the winding's pitch, so a comb of harmonics that rises and falls with the hand's move, an RMS that grows with the speed, and static lines at the string's longitudinal modes (Pakarinen, Penttinen & Bank, JASA 122(6), EL197–EL202, 2007). It is told from the guitar by what a note is not. A note's partials hold their bins: harmonic in Driedger, Müller & Disch's split (ISMIR 2014), a cell's median over ±100 ms 6 dB over its median over ±350 Hz, read on frames four times as long as the squeak's (93 ms at 44.1 kHz, 10.8 Hz bins), where a bass note's partials 82 Hz apart stand apart and a sweeping comb smears; on the short frames they merged into what read as noise, and the cut took a bass note's upper partials. A squeak lifts the part of 1–10 kHz that is not harmonic and none of the harmonic part, so their ratio, which a note keeps as it decays, rises: a squeak's frames have it 14 dB or more over the least it reaches in the 200 ms before and in the 200 ms after, 70 % or more of the band not harmonic, 10 dB or more over the band's quiet. A note's start is not a squeak: three or more third-octave bands from 80 to 560 Hz staying 6 dB up for 30 ms, to within 15 dB of their loud frames (a pluck's click and low partials; a squeak's comb passes through a band and stays far under a note), or partials arriving that hold 50 ms (a chord struck again raises its own ringing partials 4.5 dB; a squeak's comb moves on, and its longitudinal lines are a few, where a chord brings 16 bins or more over 1 kHz). A region with a note starting in its first half is that note's attack. A squeak is a contact held while the hand moves, so a region stands 45 ms or more, its 1–10 kHz energy spread over 15 ms or more and never jumping 16 dB within a millisecond (a click rises at once, a squeak with the hand's speed): on the tuning takes real squeaks ran 46–134 ms, and the pick's touch before a pluck, which the other cues let through, 12–35 ms. A slow slide holds its comb still for tens of ms at a time, steps that read as partials even on short frames (a held note's partial and a still step are the same to any test of a cell; what differs is that the step is there only inside the squeak): a shorter run is widened over the band's rise, up to 30 ms either way, and kept if it is a comb, its 1–8 kHz spectrum peaky (spectral flatness 0.1 or under: real squeaks 0.063 on the tuning takes, the plucks, strums and touches 0.179). In a region every bin over 300 Hz goes down to what it holds just outside the region (the lesser side's mean over 4 frames), `squeak` dB at most; a harmonic cell is left, but in a comb's region cut to 6 dB over the greater side, which a note ringing through, starting or stopping keeps and a slide's still step does not; on 23 ms frames (1024 at 44.1 and 48 kHz); the edit is confined to the region with 2 ms edges, as the take is rebuilt as x − m·ISTFT((1 − G)·X), so everything else stays sample for sample.
811
+
812
+ **Pick.** A pluck's click: a 2–10 kHz millisecond 9 dB or more over the quietest 4 ms of the 40 ms before it (a strum's strings click one after another, each over the last), the loudest within 20 ms. Its attack, from 2 ms before to `attack` after (10 ms), is taken down on 5.8 ms frames, each bin over 1.5 kHz to the level the note holds 15–35 ms on, `pick` dB at most: the click goes, the partials that ring on stay.
813
+
814
+ **Amp.** The buzz first: its lines are locked to the mains, so they are subtracted, each held through the take ([`dehum`](#dehum) with `steady`: one phasor per line, the mains phase refined against them; no hum found, nothing changed), where a gain cannot part a buzz line from a partial in its bin. Then OM-LSA (`@audio/denoise-omlsa`, the held-noise form: Gerkmann, Breithaupt & Martin 2008) on a print read from the take's quietest frames: those within 1 dB of its 1st-percentile frame (the amp alone before the playing, where the take has that, else the gaps), split in time into four groups, per bin their mean, or where the groups' means spread over 6 dB (a note rang into some), the least group's ×1.5. A spectral peak 10 dB or more over the print keeps its level, with its main lobe: a note ringing on is peaks well over the noise, where hiss peaks so high in one bin in 22 000 and a buzz's line sits at the print. OM-LSA alone took the last chord of a take, 22 dB over the hiss, 6 dB down.
815
+
816
+ ```js
817
+ desqueak(data, { fs: 44100 }) // squeaks, up to 30 dB down
818
+ desqueak(data, { fs: 44100, pick: -9, amp: -20 }) // and harsh picks, and the amp's hiss and buzz
819
+ desqueak(data, { fs: 44100, squeak: 0, amp: -20 }) // the amp's noise alone
820
+ ```
821
+
822
+ | Param | Default | |
823
+ |---|---|---|
824
+ | `squeak` | `-30` | dB, the most a squeak goes down; `0` leaves squeaks |
825
+ | `pick` | `0` | dB, the most a pick's attack goes down; `0` off; `-9` restores attacks made 6–12 dB harsher |
826
+ | `attack` | `0.01` | s, the pick's attack taken, from 2 ms before its click |
827
+ | `amp` | `0` | dB, how far the amp's hiss goes down, and what the subtraction leaves of its hum and buzz; `0` off; `-20` typical |
828
+
829
+ The whole take is read at once (streaming: false); about 20× real time at 44.1 kHz on one core.
830
+
831
+ Measured against iZotope RX 12 Guitar De-noise (`node bench/rx/guitar.mjs test` in [audio](https://github.com/audiojs/audio), 2026-10): GuitarSet's mic takes (Xi et al., ISMIR 2018, CC BY 4.0), a solo acoustic guitar; every setting, ours and RX's, chosen on players 00–02 (30 takes), test on players 03–05 (30 takes, 12.1 min). RX through its plugin, at its defaults (Squeak on, sensitivity 3, reduction 4) and each part tuned by SNR on the tuning takes, the others bypassed. The takes hold squeaks of their own, so harm is read on the notes: per annotated note, its partials up to 10 kHz where they stand 10 dB clear, in its first 40 ms (attack) and after (sustain), the share changed by over 1 dB.
832
+
833
+ Squeaks synthesized from their physics and added to the takes (290 on test): a pulse per winding crossed (0.16–0.44 mm, the wrap wire of a light phosphor-bronze set), the hand's speed rising and falling as a minimum-jerk move (Flash & Hogan 1985) to 0.15–1.5 m/s over 40–300 ms, a resonator on the firing rate and the string's longitudinal modes (1.4–2.0 kHz) as Pakarinen, Välimäki & Puputti's slide guitar model has it (NIME 2008), ending 5–40 ms before a position shift's note or anywhere, peaking 10–30 dB under the take's loud frames. The error to the clean take gone over each squeak, pooled and median; its own time-frequency cells; SNR to the take (the input's 25.2 dB); on the clean takes, the samples moved and the notes' partials moved:
834
+
835
+ | | squeak gone, pooled · median (dB) | its cells (dB) | SNR (dB) | elsewhere (dB under) | clean: samples moved | attacks · sustains moved, over 1 kHz | under 1 kHz |
836
+ |---|---:|---:|---:|---:|---:|---:|---:|
837
+ | RX 12, defaults (= tuned) | 2.7 · 2.8 | 4.3 | 20.5 | 21.2 | 12.9 % | 1.4 % · 3.2 % | 0.1 % · 0.1 % |
838
+ | `desqueak()` | 3.3 · 2.6 | 4.9 | 23.2 | 24.4 | 2.4 % | 2.2 % · 2.8 % | 0.1 % · 0.0 % |
839
+
840
+ Squeaks as recorded: where RX's squeak detector and ours (0.1.0) both mark something on the takes, looked at on spectrograms; a squeak where a sweep shows (an arch, a stacked comb), not where a pluck, a strum or a click shows with partials after it. Per event, its 1–10 kHz energy taken, median and the share taken by 3 dB or more (squeaks) or by 1 dB or more (not squeaks):
841
+
842
+ | | tune: squeaks (14) | not (58) | test: squeaks (35) | not (47) |
843
+ |---|---:|---:|---:|---:|
844
+ | RX 12, defaults | 9.8 | 2.9 | 13.5 · 94 % | 3.7 · 96 % |
845
+ | `desqueak()` 0.1.0 | 10.9 | 0.0 | 9.0 · 74 % | 4.4 · 51 % |
846
+ | `desqueak()` | 11.1 | 0.0 | 12.8 · 86 % | 4.4 · 51 % |
847
+
848
+ 0.1.0 took nothing from six of the test's 35 and under 3 dB from three more: slow slides (70–150 ms) whose comb holds still for tens of ms at a time, so their non-harmonic run fell under 45 ms and their still steps, read as partials, were spared (03_SS1 solo at 0.94 s: 100 ms, RX 25.6 dB, 0.1.0 0.0). 0.2.0 widens such a run over the band's rise and keeps it if a comb, and cuts a still step that exists only inside the squeak; the plucks and touches keep their row. RX still takes 0.7 dB more at the median, and five of the 35 lose under 3 dB to ours (a 23 ms one stays under the minimum). Ours touches half the plucks and clicks RX touches nearly all of, a little deeper where it does (4.4 against 3.7 dB median). Partials tried as tracks instead (peaks held within ±1 bin for 120 ms on 46 ms frames, or within 6 dB) read a slow slide's still steps, and the noise around them, as partials too, and missed the squeaks they were for (test 0.1 dB taken).
849
+
850
+ Picks made harsh: each attack's 2–10 kHz raised 6–12 dB over its first 10 ms (2224 on test), the take as played the target; the boost's error gone, pooled and median; the band left over the take's own; SNR (the input's 17.1 dB); on the clean takes, the notes' partials moved:
851
+
852
+ | | harshness gone, pooled · median (dB) | 2–10 kHz left (dB) | SNR (dB) | elsewhere (dB under) | clean: attacks under 1 kHz · sustains over · under |
853
+ |---|---:|---:|---:|---:|---:|
854
+ | RX 12, Pick on at its defaults | 1.6 · 1.3 | 5.1 | 16.9 | 20.1 | 3.2 % · 6.2 % · 0.9 % |
855
+ | RX 12, Pick tuned (sensitivity 2, attack 0.1, reduction 5) | 3.3 · 0.7 | 6.3 | 19.3 | 24.6 | 0.8 % · 2.3 % · 0.1 % |
856
+ | `desqueak({ squeak: 0, pick: -9 })` | 8.9 · 10.5 | 1.2 | 24.1 | 27.3 | 0.0 % · 3.8 % · 0.0 % |
857
+
858
+ Amp noise under the takes, from a second before them: hiss (white through a cabinet's 80 Hz–5 kHz) 40 dB under the take, buzz (60 Hz, odd-heavy to 8 kHz: Whitlock's ground-loop and rectifier buzz, as audio's dehum bench has it) 35 dB under, and both 40 dB under. By phase inversion (Hagerman & Olofsson 2004): the noise taken where it is heard (10 ms frames where the guitar stands under 6 dB over it) and over the take, the guitar's SDR, SNR, the notes' partials over 1 kHz moved. RX's Amp section learns from its Learn button alone, no plugin parameter: hosted, it passes the take bit for bit at every setting. RX 12 Spectral De-noise learned on the second of noise stands in for it, at its defaults and tuned (Extreme, 20 dB):
859
+
860
+ | | hiss: heard · over · SDR · SNR (dB) | sustains moved | buzz | sustains moved | both | sustains moved |
861
+ |---|---:|---:|---:|---:|---:|---:|
862
+ | RX 12 Guitar De-noise, Amp on | 0.0 · 0.0 · ∞ · 40.0 | 0.0 % | 0.0 · 0.0 · ∞ · 35.0 | 0.0 % | 0.0 · 0.0 · ∞ · 37.0 | 0.0 % |
863
+ | RX 12 Spectral De-noise, learned | 7.4 · 1.2 · 48.8 · 40.5 | 2.0 % | 6.3 · 1.1 · 48.0 · 35.8 | 2.5 % | 5.5 · 0.9 · 48.5 · 37.5 | 2.5 % |
864
+ | same, tuned | 10.3 · 2.0 · 47.9 · 41.0 | 3.7 % | 9.5 · 2.3 · 44.5 · 36.6 | 4.2 % | 8.0 · 1.6 · 46.7 · 38.0 | 4.6 % |
865
+ | `desqueak({ squeak: 0, amp: -20 })` 0.2.0 | 11.8 · 2.5 · 49.2 · 41.7 | 1.6 % | 9.5 · 2.3 · 43.1 · 36.3 | 1.3 % | 8.6 · 1.9 · 42.6 · 37.3 | 1.9 % |
866
+ | `desqueak({ squeak: 0, amp: -20 })` | 11.8 · 2.5 · 49.2 · 41.7 | 1.6 % | 13.1 · 9.3 · 47.3 · 42.8 | 0.0 % | 9.8 · 3.4 · 44.8 · 39.0 | 1.7 % |
867
+
868
+ Under hiss ours is ahead on every count, as 0.2.0 was. Under buzz 0.2.0 trailed in the guitar's SDR (43.1 against 44.5 dB): in the takes' quiet passages, where the guitar plays 5–8 dB over the buzz, and on the lines, where a gain cannot part a buzz harmonic from a partial in its bin (about half the guitar's error lay within ±10 Hz of the 60 Hz lines, a third by chance). 0.3.0 subtracts the lines first, each held through the take (`dehum` 0.6.0, `steady`): under buzz the guitar's SDR 43.1 → 47.3 dB, the buzz taken where heard 9.5 → 13.1 dB and over the take 2.3 → 9.3, the SNR 36.3 → 42.8, no sustain moved; ahead of RX on every count. Under buzz and hiss together the SDR 42.6 → 44.8, the noise where heard 8.6 → 9.8 and the SNR 37.3 → 39.0: ahead in noise taken and SNR, 1.9 dB of SDR behind RX (46.7), the hiss and what the lines leave going by gain as before. On the tuning takes, under buzz the SDR 47.6 → 54.0 dB and the buzz taken where heard 10.0 → 23.8; under both 46.6 → 47.2 and 10.7 → 10.2. Subtracting the buzz with dehum as it is for edited material (0.5.1, 0.5.2) measured worse: on the tuning takes under buzz the guitar's SDR 47.6 → 39.3 dB, the buzz 4.3 dB down. Its fit over 2 s took in the guitar's partials near the lines, and a chord's attack, moving many lines at once, read as the hum's jump (12 of them in one 25 s take), so each stretch between was fitted alone.
869
+
870
+ **Use when:** a guitar take with fret squeaks (position shifts, slides on the wound strings), attacks too sharp, or a steady amp hiss and buzz under it.<br>
871
+ **Not for:** a slide you want heard (a squeak and a slide's own comb are the same sound); noise that moves (`omlsa`, `deepfilter`).
872
+
873
+ ---
874
+
875
+ Part of [@audio/denoise](https://github.com/audiojs/denoise), the denoise family umbrella.
876
+
877
+ MIT © [audiojs](https://github.com/audiojs)
878
+
879
+
699
880
  ## Gates & inter-word
700
881
 
701
882
  ### `gate`
@@ -712,41 +893,35 @@ gate(data, { threshold: -45, attack: 0.005, release: 0.1, hold: 0.05, lookahead:
712
893
 
713
894
  ### `debreath`
714
895
 
715
- VAD-driven inverse gate: what [`vad`](#lower-level-building-blocks) does not call speech (breaths, mouth noise, the room between phrases) goes down by `range`. Speech is voicing and the sound over the noise floor next to it, so a soft word in noise stays and a breath that a pause parts from the phrase goes. A gap under 0.15 s is no breath (a breath lasts 0.15–0.6 s, Ruinskiy & Lavner 2007) and stays; the gain holds 50 ms past speech. The whole clip is read at once (streaming: false), so the gain is zero-phase: it rises over `attack` before speech starts and falls over `release` after it ends.
896
+ Takes the breaths between phrases down by `range`; the room around them, and the speech, stay. A breath is told by what an inhalation is (Ruinskiy & Lavner 2007): unvoiced, longer than a consonant, well under the speech, between phrases, its noise shaped by the open tract. Per frame of [`vad`](#lower-level-building-blocks), on the 0.3–8 kHz band: 10 dB or more over the room (the band's 10th-percentile frame), 12 dB or more under the speech (its 95th), under half of it over 4 kHz (no sibilant), under 80 % of it under 1 kHz (a breath's noise lies over the open tract's formants; a phrase's decaying vowel, its murmur and creak lie under 1 kHz, and a breath they run into is no longer taken for part of them). Runs of such frames are a breath when they last 0.15–1 s, their median stands 14 dB over the room, under 60 % of their energy lies under 1 kHz, at most half their frames are voiced (periodic in the 50–1000 Hz band, where a voice's first harmonics lie: Talkin's normalized cross-correlation 0.6 or more, the band 6 dB over its room, whose hum is periodic too; @audio/vad's periodicity, read up to 4 kHz, took a breath through narrow resonances or a codec's bands for voiced), and a room-level frame lies within 0.1 s on either side: a pause, which a word's own consonants have not. The cut works on the band over 300 Hz (split at zero phase: a room's rumble under a breath is the room's), ramps in over `attack` and out over `release` inside the breath, and never takes it under the room's level in that band, where it would leave a hole. `room` turns down what is neither speech nor breath, as 0.2 did. The whole clip is read at once (streaming: false).
716
897
 
717
898
  ```js
718
- debreath(data, { range: -10 }) // -10 dB between phrases (default -12)
899
+ debreath(data, { fs: 48000 }) // breaths 12 dB down
900
+ debreath(data, { range: -20, room: -6 }) // deeper, and the room between phrases 6 dB down too
719
901
  ```
720
902
 
721
903
  | Param | Default | |
722
904
  |---|---|---|
723
- | `range` | `-12` | dB — how far everything between phrases goes down |
724
- | `attack` | `0.005` | s — the gain rises over this before speech starts |
725
- | `release` | `0.1` | s — and falls over this after speech ends |
905
+ | `range` | `-12` | dB, how far a breath goes down |
906
+ | `room` | `0` | dB, how far what is neither speech nor breath goes down |
907
+ | `attack` | `0.005` | s, the cut's ramp in (with `room`: the gain's rise before speech) |
908
+ | `release` | `0.01` | s, its ramp out (with `room`: the gain's fall after speech) |
726
909
 
727
- `snrTh` and `flatTh` (0.1) are gone: they tuned the old detector, whose floor was the 10th-percentile frame energy of the whole input. Under noise that percentile is the noise, and every word under 9 dB over it went down. Measured with `python scripts/vad.py` (VoiceBank+DEMAND test set, ten Spoken Wikipedia narrations; defaults chosen on the training subset and ten other narrations), 0.1.8 → 0.2.1, frames turned down by over 3 dB:
910
+ Against iZotope RX 12 Breath Control, `node bench/rx/debreath.mjs` in [audio](https://github.com/audiojs/audio) (2026-10): ten Spoken Wikipedia narrations, 3 minutes each, their 90 breaths labelled by the acoustics of an inhalation (most clear inhalations on spectrograms, the rest quiet noise in pauses), and VoiceBank test speech with 60 of those breaths put before its phrases (labels exact, the speech another). Every setting chosen on ten other narrations (55 breaths) and 28 other speakers (26), by Youden's J, breaths caught less speech frames harmed; RX at Gain −12 dB, `range`'s (its default 0 dB changes nothing), tuned: Offline, Gated, sensitivity 0 (defaults Real-time, Natural, 5). Per breath, its 0.3–8 kHz level change; per speech frame (voiced, or a word's edge within 0.1 s of voicing), turned down by over 3 dB or not:
728
911
 
729
- | | voiced | word edges |
730
- |---|---:|---:|
731
- | VoiceBank+DEMAND, 824 noisy | 5.87 → **0.06** % | 24.55 → **0.30** % |
732
- | the same, clean | 0.03 → 0.09 % | 1.22 → **0.60** % |
733
- | 10 narrations | 0.07 → 0.05 % | 0.23 → 0.03 % |
734
-
735
- Breaths (350 ms of noise through three wide resonances, 500/1500/2500 Hz) put into the narrations' pauses, ending G before the next phrase, 35 and 25 dB under the speech: median gain, share turned down by 6 dB or more.
736
-
737
- | G | −35 dB | −25 dB |
738
- |---|---|---|
739
- | 0.05 s | −6.6 dB, 53 % → **−11.1 dB, 55 %** | −0.2 dB, 45 % → 0.0 dB, 13 % |
740
- | 0.15 s | −2.9 dB, 44 % → **−11.7 dB, 81 %** | −0.1 dB, 44 % → **−11.4 dB, 74 %** |
741
- | 0.3 s | −4.0 dB, 50 % → **−11.8 dB, 75 %** | −3.2 dB, 50 % → **−11.8 dB, 69 %** |
742
- | 0.5 s | −11.5 dB, 55 % → **−12.0 dB, 91 %** | −11.5 dB, 55 % → **−11.6 dB, 73 %** |
743
-
744
- A breath within 0.3 s of a vowel, parted from it by less than 0.15 s, reads as the word's onset and stays: that is where consonants lie, parted from the vowel at most by a stop's closure. A loud breath that close to a phrase went down more often before (45 → 13 %), and so did a quarter of the word edges in noise.
912
+ | | narrations: breaths, median · down ≥ 6 dB | speech frames down > 3 dB | other frames, median | VoiceBank + breaths: median · down ≥ 6 dB | speech frames down > 3 dB |
913
+ |---|---:|---:|---:|---:|---:|
914
+ | RX 12 defaults (Gain 0 dB) | 0.0 dB · 0 % | 0.0 % | 0.0 dB | 0.0 dB · 0 % | 0.0 % |
915
+ | RX 12 defaults, Gain −12 dB | −9.7 dB · 81 % | 0.69 % | 0.0 dB | −6.6 dB · 52 % | 0.59 % |
916
+ | RX 12 tuned | −12.0 dB · 88 % | 1.96 % | −0.1 dB | −12.0 dB · 73 % | 0.99 % |
917
+ | 0.2.1 | 0.0 dB · 11 % | 0.11 % | 0.0 dB | 0.0 dB · 20 % | 0.19 % |
918
+ | 0.3.0 | −10.9 dB · 78 % | 0.49 % | 0.0 dB | −11.2 dB · 78 % | 0.58 % |
919
+ | **0.4.0** | −11.2 dB · **92 %** | 0.76 % | 0.0 dB | −11.5 dB · **88 %** | **0.49 %** |
745
920
 
746
- Noise after speech goes down: 1.5 s of noise after 1.5 s of a VoiceBank utterance, frames from 0.4 s on turned down by 6 dB or more, white, pink and brown 94 %, the office 99 %; noises with talkers in them (bus, cafe, public square) stay, as speech. 0.2.0 kept white and pink noise after speech whole (its VAD read voicing off the Wiener estimate, which peaks on any noise). Music, frames within 30 dB of the loudest turned down by over 3 dB: Vibe Ace 37.4 → 0.67 %, Nutcracker 22.1 → 0 %, trumpet 0 → 0 %, four sung excerpts (VocalSet) up to 21.6 → up to 0.39 %, but Brahms (strings) 4.29 → 9.35 %: an orchestra raises its own floor (0.2.0: 0.02 %).
921
+ 0.3.0 missed 20 of the 90 narration breaths. Eight ran into the phrase before or after them through its quiet frames (a vowel's decay, an onset's murmur), which passed for breath by level: bridged into one run, it had no pause on that side. Six, in one narration whose codec left a breath as a few narrow bands, were read as voiced by @audio/vad's periodicity, which looks up to 4 kHz. 0.4.0 catches the six and six of the eight; it asks a frame's shape too (under 80 % of its 0.3–8 kHz energy under 1 kHz) and reads voicing where a voice's first harmonics are, under 1 kHz; the median a run needs over the room went from 15 to 14 dB, chosen on the tuning narrations (one breath more there, no speech frame more). On the tuning sets, breaths caught 51 → 54 of 55 and 19 → 20 of 26, speech frames touched 0.23 → 0.15 % and 0.21 → 0.37 %. On the test narrations it touches more speech than 0.3.0 (0.76 % against 0.49 %, still under RX's 1.96 %): most of the new spans are noise between phrases, inhalations ending at the next phrase's onset or holding a few frames periodic under 1 kHz, which the measure's 0.1 s word edges count as speech; one is a phrase's creaky end. 0.2.1 turned down what the VAD did not call speech; its speech reaches 0.3 s from a vowel across gaps of 0.15 s, which holds most breaths. Music and singing (Vibe Ace, Brahms, the Nutcracker, a trumpet, four VocalSet arpeggios), frames within 30 dB of the loudest turned down by over 3 dB: none (0.3.0, counted the same way: 1.8 % of the trumpet's; 0.2.1, as counted then: Brahms 8.8 %, Vibe Ace 2.2 %). VoiceBank+DEMAND noisy test speech, every fourth utterance, frames within 30 dB of the clean utterance's loudest turned down by over 3 dB: 0.07 % (0.3.0: 0.05 %; 0.2.1, as counted then: 5.0 %).
747
922
 
748
- **Use when:** breath, mouth noise, hiss in pauses on a voiceover.<br>
749
- **Not for:** a breath that runs into a word; whispered speech (it holds no voicing: it goes down whole).
923
+ **Use when:** breaths between phrases on a voiceover, a podcast, a narration.<br>
924
+ **Not for:** a breath that runs into a word (no pause on either side); hiss or room tone in pauses: `room`, `gate`, `omlsa`.
750
925
 
751
926
 
752
927
  ### `desilence`
@@ -772,7 +947,7 @@ splitSilence(data, { fs }) // → one Floa
772
947
 
773
948
  Returns `{ data, segments, removed, map }`; `project(map, t)` re-times markers/subtitles (`@audio/subtitle` `project()` takes the same map).
774
949
 
775
- 0.1 read silence under 11 dB over the input's 10th-percentile frame energy: under noise that percentile is the noise, and whole words went. Measured with `python scripts/vad.py` (as `debreath` above), `shorten` at its defaults, 0.1.1 → 0.2.1, frames cut:
950
+ 0.1 read silence under 11 dB over the input's 10th-percentile frame energy: under noise that percentile is the noise, and whole words went. Measured with `python scripts/vad.py` (VoiceBank+DEMAND test set, ten Spoken Wikipedia narrations; defaults chosen on the training subset and ten other narrations), `shorten` at its defaults, 0.1.1 → 0.2.1, frames cut:
776
951
 
777
952
  | | voiced | word edges | removed |
778
953
  |---|---:|---:|---:|
@@ -833,7 +1008,7 @@ import { noiseProfile, minStats, imcra } from '@audio/denoise'
833
1008
  |---|---:|---|---:|---:|---:|
834
1009
  | 60 Hz hum + harmonics | -5.2 dB | `dehum` | 40.4 dB | 6.4 dB | 65 |
835
1010
  | white noise (~13 dB SNR) | 13.3 dB | `wiener` | 20.5 dB | 0.3 dB | 82 |
836
- | clicks (vinyl-style) | 24.1 dB | `declick` | 64.4 dB | — | 450 |
1011
+ | clicks (vinyl-style) | 24.1 dB | `declick` | 65.2 dB | — | 450 |
837
1012
  | 7 kHz sibilance | 2.0 dB | `deesser` | 9.2 dB | 1.9 dB | 5 |
838
1013
 
839
1014
  Higher = better.
@@ -861,7 +1036,52 @@ In the rows above, `omlsa` 0.3 and `wiener` 0.3 take the decision-directed α pe
861
1036
 
862
1037
  Tracking the noise, `omlsa` 0.5, `wiener` 0.4 and `specsub` 0.3 keep a program's held partials out of it (noise-estimate 2.3's `partials`, see [`omlsa`](#omlsa)). Chosen on the training subset (tracked `omlsa` PESQ 1.825 → 1.823, OVRL 2.543 → 2.542; `wiener` 1.819 → 1.820, 2.530 → 2.529; `specsub` 1.730 → 1.730, 2.459 → 2.462), music and VocalSet; on the test set, once, before → after: `omlsa` PESQ 2.364 → 2.361, STOI 0.920 → 0.920, SI-SDR 14.25 → 14.15 dB, SIG 3.384 → 3.383, BAK 3.467 → 3.466, OVRL 2.853 → 2.851, musical noise 0.48 → 0.49; `wiener` 2.355 → 2.359, 0.911 → 0.912, 14.29 → 14.29, 3.395 → 3.396, 3.431 → 3.430, 2.843 → 2.844, 0.49 → 0.50; `specsub` 2.264 → 2.270, 0.919 → 0.919, 12.80 → 12.76, 3.358 → 3.359, 3.363 → 3.362, 2.794 → 2.795, 0.35 → 0.36. The clean utterances in: PESQ 4.287 → 4.290, 4.03 → 4.07, 4.03 → 4.08; steady white and pink noise alone as before. Clean music, sung long tones and Slakh mixes cut by more than 3 dB: the table below. Tried and not taken: holding a partial from 54 ms on, not 0.3 s (more music kept, but the noise rising under a voice's harmonics was held down with them: PESQ −0.015 on the training speech); the spectral floor as the noise of a partial with no memory yet, at a take's start (the trumpet's first note kept, but DEMAND's low, peaked noises held as partials: PESQ −0.03); a 10 s window (a song's chords, repeated past it, were learned: Slakh mixes cut six times as much); the noise under a partial following the floor beside it (less music kept, more noise left under the voice). The trackers themselves: MCRA-2 (Rangachari & Loizou 2006; Loizou's `mcra2_estimation.m` constants per 10 ms) PESQ 1.72 against IMCRA's 1.83, music cut 1.7 times IMCRA's, steady noise alone 10–13 dB down with musical noise 1.0–1.1; Gerkmann & Hendriks's MMSE tracker (2012) with `partials` PESQ 1.849 (+0.024), but STOI −0.003, clean speech in 4.24 → 4.14, steady pink noise left with musical noise 0.33, and music hardly kept: it follows a held note within the 0.3 s before a partial is held. With the noise known exactly the learned form reaches PESQ 2.11 on the training subset: a tracker that gets there has to know the noise under the speech, which none of these do.
863
1038
 
864
- The open classical denoisers on the same 824, each given the noise as ours is: noisereduce 3.0.3 (stationary spectral gating, the lead-in as its noise clip) at 12 dB (`prop_decrease` 0.75): PESQ 2.409, STOI 0.921, SI-SDR 12.8, SIG 3.37, BAK 3.51, OVRL 2.861, musical noise 0.03; at full reduction 2.357, 0.910, 12.4, 3.22, 3.72, 2.825, 0.74; logmmse 1.5 (a port of Loizou's `logmmse.m`, noise from the lead-in, updated by its VAD) 2.350, 0.900, 14.7, 3.29, 3.52, 2.799, 0.73; FFmpeg 8.0.1's `afftdn` learning the lead-in, 12 dB: 2.048, 0.920, 8.6, 3.25, 3.14, 2.657, 0.20 (`anlmdn` at its defaults leaves the input as it is). Neural, for scale: DeepFilterNet3 limited to 12 dB 2.670, 0.939, 16.2, 3.49, 3.69, 3.026, 0.06; RNNoise 2.109, 0.890, 12.3, 3.28, 3.85, 2.935, 0.90. iZotope RX was not measured: no RX plug-in is installed where these ran.
1039
+ The open classical denoisers on the same 824, each given the noise as ours is: noisereduce 3.0.3 (stationary spectral gating, the lead-in as its noise clip) at 12 dB (`prop_decrease` 0.75): PESQ 2.409, STOI 0.921, SI-SDR 12.8, SIG 3.37, BAK 3.51, OVRL 2.861, musical noise 0.03; at full reduction 2.357, 0.910, 12.4, 3.22, 3.72, 2.825, 0.74; logmmse 1.5 (a port of Loizou's `logmmse.m`, noise from the lead-in, updated by its VAD) 2.350, 0.900, 14.7, 3.29, 3.52, 2.799, 0.73; FFmpeg 8.0.1's `afftdn` learning the lead-in, 12 dB: 2.048, 0.920, 8.6, 3.25, 3.14, 2.657, 0.20 (`anlmdn` at its defaults leaves the input as it is). Neural, for scale: DeepFilterNet3 limited to 12 dB 2.670, 0.939, 16.2, 3.49, 3.69, 3.026, 0.06; RNNoise 2.109, 0.890, 12.3, 3.28, 3.85, 2.935, 0.90. iZotope RX 12, below.
1040
+
1041
+ iZotope RX 12 Advanced on the same buffers (2026-10; audio's `bench/rx/denoise.mjs` hosts the VST3 plug-ins through Pedalboard, their output aligned to the input): Voice De-noise (adaptive, 12 dB) and Spectral De-noise (adaptive learning, 12 dB) at their defaults, and at their best PESQ on the training subset over their main knobs (Voice De-noise: reduction 12, 16 or 20 dB, filter Surgical or Gentle, master threshold −12 to +10 dB, Dialogue or Music; best 20 dB at +10. Spectral De-noise: quality Simple, Advanced or Extreme at 12, 20 or 30 dB; best Extreme at 20). On a learned noise each holds the print its adaptive mode learns over the lead-in (Learn is no plug-in parameter; Spectral De-noise hears the lead-in looped to 2 s at its shortest learning time, 0.5 s). VoiceBank+DEMAND test set, 824 utterances; "clean in": PESQ of every second clean utterance (412) through the same system; MN: musical noise:
1042
+
1043
+ | | PESQ | STOI | SI-SDR dB | SIG | BAK | OVRL | MN | clean in |
1044
+ |---|---|---|---|---|---|---|---|---|
1045
+ | noisy input | 1.967 | 0.921 | 8.45 | 3.322 | 3.116 | 2.685 | 0 | |
1046
+ | `omlsa` | 2.361 | 0.920 | 14.15 | 3.382 | 3.474 | 2.854 | 0.49 | 4.29 |
1047
+ | `omlsa`, `threshold` 4 dB | 2.472 | 0.914 | 15.45 | 3.366 | 3.627 | 2.905 | 0.36 | 4.26 |
1048
+ | `wiener` | 2.359 | 0.912 | 14.29 | 3.398 | 3.440 | 2.848 | 0.50 | 4.07 |
1049
+ | `specsub` | 2.270 | 0.919 | 12.76 | 3.359 | 3.367 | 2.797 | 0.36 | 4.09 |
1050
+ | RX Voice De-noise | 2.367 | 0.918 | 7.30 | 3.332 | 3.468 | 2.818 | 0.31 | 4.42 |
1051
+ | RX Voice De-noise, 20 dB, threshold +10 | 2.500 | 0.899 | 3.72 | 3.211 | 3.657 | 2.798 | 0.66 | 4.09 |
1052
+ | RX Spectral De-noise | 2.216 | 0.917 | 13.94 | 3.328 | 3.378 | 2.800 | −0.02 | 4.26 |
1053
+ | RX Spectral De-noise, Extreme, 20 dB | 2.381 | 0.919 | 13.91 | 3.279 | 3.455 | 2.786 | 0.36 | 4.06 |
1054
+ | learned: audio's `denoise`, 12 dB | 2.455 | 0.920 | 15.13 | 3.369 | 3.559 | 2.881 | 0.32 | 4.28 |
1055
+ | RX Spectral De-noise, learned | 2.191 | 0.923 | 15.64 | 3.354 | 3.336 | 2.798 | 0.09 | 4.30 |
1056
+ | RX Spectral De-noise, learned, Extreme, 20 dB | 2.349 | 0.925 | 16.37 | 3.364 | 3.449 | 2.846 | 0.27 | |
1057
+ | RX Voice De-noise, learned | 2.368 | 0.918 | 7.13 | 3.335 | 3.465 | 2.819 | 0.20 | |
1058
+ | RX Voice De-noise, learned, 20 dB, threshold +10 | 2.528 | 0.901 | 3.55 | 3.224 | 3.666 | 2.812 | 0.50 | 4.20 |
1059
+
1060
+ At their defaults RX ties or trails: Voice De-noise's PESQ ties `omlsa`'s (+0.006 ± 0.011, paired 95 % interval) at OVRL −0.036 and SI-SDR −6.9 dB (it reports no latency and keeps six band thresholds; its output moves the waveform), Spectral De-noise trails on every measure, learned or adaptive. Tuned for PESQ, Voice De-noise leads, +0.139 ± 0.016 tracking and +0.073 ± 0.015 on the learned print: at 20 dB with its threshold at +10 dB it takes all within 10 dB of its noise estimate for noise, emptying the pauses PESQ marks down (BAK +0.18) at the voice's cost (SIG −0.17, STOI −0.022, SI-SDR −10.4 dB; clean speech in 4.29 → 4.09). Spectral De-noise's best, Extreme, looks 203 ms ahead (9727 samples of latency at 48 kHz, against a frame here) for +0.019 ± 0.016, OVRL −0.068. The same knob on `omlsa`, the noise read louder (`threshold`, 0.6), at its best on the training subset (+4 dB of 2 to 10; PESQ 1.823 → 1.858 there): 2.472, within 0.028 of Voice De-noise's best and over it on all else but BAK (3.627 against 3.657): OVRL +0.107, SIG +0.155, STOI +0.015, SI-SDR +11.7 dB, musical noise 0.36 against 0.66. It stays off by default: tracking clean music it cut 60 % of the music's time-frequency energy by more than 3 dB, not 42 % (below), clean speech in fell 4.285 → 4.256, and the training speech lost STOI 0.012. Voice De-noise passes clean speech higher at its defaults (4.42, against 4.29), where it differs most by leaving the clean takes' own room tone, which `omlsa` takes 15 dB down and PESQ counts as a change; RX leaves less musical noise at its defaults (0.31 and −0.02, against 0.49), at 12 dB of reduction against 15.
1061
+
1062
+ Ten Spoken Wikipedia narrations (raw OVRL 3.176): the noise floor (the quietest 500 ms, median over the takes) and the speech level (the loudest half of 50 ms frames) against the raw take:
1063
+
1064
+ | | SIG | BAK | OVRL | floor down | speech |
1065
+ |---|---|---|---|---|---|
1066
+ | `omlsa` | 3.473 | 4.089 | 3.204 | 14.7 dB | −0.03 dB |
1067
+ | RX Voice De-noise | 3.452 | 4.098 | 3.191 | 6.3 dB | −0.31 dB |
1068
+ | RX Voice De-noise, 20 dB, threshold +10 | 3.443 | 4.119 | 3.190 | 14.8 dB | −0.72 dB |
1069
+ | RX Spectral De-noise | 3.461 | 4.091 | 3.198 | 11.2 dB | −0.21 dB |
1070
+ | RX Spectral De-noise, Extreme, 20 dB | 3.455 | 4.109 | 3.202 | 17.2 dB | −0.28 dB |
1071
+
1072
+ Music under steady noise, Spectral De-noise's own ground: ten MUSDB18 test mixtures (Rafii et al. 2017), the strings and the jazz of `scripts/repair.js`, at 44.1 kHz, under white and pink noise and two DEMAND recordings (a hallway's room tone, a washing machine) 10 and 25 dB under the music's active level, 1.5 s of the noise alone before it (the learned systems learn there) and 1 s after: 96 takes. What a system does to the music and to the noise is read apart by phase inversion (Hagerman & Olofsson 2004: it hears music + noise and music − noise). SDR: the output against the clean music; NMR: its error's noise-to-mask ratio after ITU-R BS.1387's FFT ear model (under 0 dB, masked); cut: the music's time-frequency energy cut by more than 3 dB; HF: what is left of the music above 8 kHz; MN: musical noise of what is left of the noise, under the music and in the second after it stops. RX's settings were chosen by SDR on three MUSDB18 training mixtures (24 takes):
1073
+
1074
+ | | SDR dB | NMR dB | cut % | HF dB | MN, music | MN, after |
1075
+ |---|---|---|---|---|---|---|
1076
+ | input | 17.63 | −3.9 | 0 | 0 | 0 | 0 |
1077
+ | audio's `denoise`, `omlsa` 0.5 (1024 frames) | 20.16 | −9.6 | 2.2 | −2.8 | 0.44 | 0.38 |
1078
+ | audio's `denoise`, `omlsa` 0.6 (2048 frames) | 20.94 | −10.0 | 1.3 | −2.6 | 0.38 | 0.36 |
1079
+ | RX Spectral De-noise, learned | 19.37 | −8.2 | 1.3 | −2.4 | 0.30 | 0.68 |
1080
+ | RX Spectral De-noise, learned, Extreme, 20 dB | 20.23 | −10.6 | 2.9 | −3.5 | 0.43 | 1.00 |
1081
+ | `omlsa`, tracking | 12.05 | −3.6 | 17.1 | −4.0 | 1.74 | 1.46 |
1082
+ | RX Spectral De-noise, adaptive | 4.35 | −1.2 | 79.4 | −5.3 | 1.47 | 0.06 |
1083
+
1084
+ The learned `denoise` leads RX's SDR in each of the eight noises and levels (by 0.5 to 3.6 dB against its defaults, 0.1 to 1.7 against its best). RX's best reaches a lower NMR, on hiss 10 dB down above all (3.8 against 7.6 dB), by taking 20 dB where `denoise` takes its 12, and cuts more of the music for it (2.9 %, its top 3.5 dB down); at its defaults RX touches the music less under noise 25 dB down (its masking leaves the noise the music covers: SNR gained under the music 0.0 and 0.2 dB on the room tone and the machine, `denoise` 1.1 and 4.9). Adaptive, RX takes music for the noise: 79 % of it cut, against 17 % for `omlsa` tracking. The same music clean, nothing to remove (24 takes: the twenty MUSDB18 mixtures and the four recordings), cut by more than 3 dB: `omlsa` 42 %, `wiener` 43 %, `specsub` 33 %, RX Spectral De-noise adaptive 65 %, Voice De-noise 67 %: a tracker of any make learns what holds still as noise; the learned print is the way for music.
865
1085
 
866
1086
  Tried on the training subset and not taken: the cepstral a priori SNR as the gain's ξ as well (tracked SIG −0.04, music cut 9.6 → 15.6 %); Gerkmann & Hendriks's MMSE noise tracker (2012) in place of IMCRA (tracked PESQ +0.04, OVRL +0.03, but STOI −0.008, clean speech in PESQ 4.24 → 4.08, music cut 9.6 → 28.5 %) or of minimum statistics in `wiener` (PESQ 1.82 → 1.87, steady-noise musical noise 0.53 → 0.79, music cut 14.5 → 28.5 %); that tracker started on a learned print (RX's "adaptive": OVRL −0.04, musical noise 0.40 on pink noise); the cepstral ξ in `wiener` (STOI +0.014, SIG −0.06); the averaged presence in the tracked gain (PESQ +0.015, a word's second frame after a pause 0.7 dB lower); the gain smoothed over frequency, in dB or linear, ±100 Hz (musical noise 0.46 → 0.22–0.29, speech cut by more than 3 dB 9.5 → 25–38 %). With the noise known exactly (the true noise's periodogram, recursively smoothed) the learned form scores PESQ 2.11 on the training subset (1.87 with the print) and leaves musical noise of 0.01 (0.46): what remains to be had is in the estimate of a noise that changes, not in the gain.
867
1087
 
@@ -896,16 +1116,16 @@ Frames follow the rate: the power of two nearest 32 ms, the papers' frame, where
896
1116
 
897
1117
  STOI holds or rises for `wiener` and `specsub` and falls 0.001–0.002 for `omlsa`; SI-SDR falls 0.3–0.7 dB for `omlsa` and `wiener` at 22.05 and 44.1 kHz, and 0.8–1.2 dB for `specsub`, which alone prefers the longer frame there (so it did on the training subset).
898
1118
 
899
- Reverberant speech (`vbreverb`): a quarter of the clean test utterances, 206, through 130 rooms of the MIT IR Survey (Traer & McDermott 2016), scored against the dry takes, DNSMOS at the input's loudness. `dereverb` 0.3 → 0.4; the rooms with a tail to hear are in [`dereverb`](#dereverb)'s own table:
1119
+ Reverberant speech (`vbreverb`): a quarter of the clean test utterances, 206, through 130 rooms of the MIT IR Survey (Traer & McDermott 2016), scored against the dry takes, DNSMOS at the input's loudness. `dereverb` 0.4 → 0.5 (0.6 the same but for one utterance, below); the rooms with a tail to hear, and iZotope RX 12, are in [`dereverb`](#dereverb)'s own section:
900
1120
 
901
1121
  | | PESQ | STOI | SI-SDR dB | SIG | BAK | OVRL |
902
1122
  |---|---|---|---|---|---|---|
903
1123
  | reverberant input | 2.33 | 0.904 | −5.7 | 3.19 | 3.71 | 2.82 |
904
- | `dereverb` | 2.55 → **2.62** | 0.897 → **0.908** | −5.3 → **−5.1** | 3.27 → **3.28** | 3.89 → 3.86 | 2.93 → 2.93 |
1124
+ | `dereverb` | 2.62 → 2.61 | 0.908 → 0.908 | −5.1 → −5.1 | 3.28 → 3.29 | 3.86 → 3.86 | 2.93 → **2.94** |
905
1125
  | dry takes in (`vbreverb-dry`) | 4.64 | 1.000 | ∞ | 3.51 | 4.04 | 3.22 |
906
- | dry, `dereverb` | 4.24 → **4.63** | 0.997 → **1.000** | 28.2 → **∞** (94 % untouched) | 3.49 → **3.51** | 4.05 → 4.04 | 3.21 → **3.22** |
1126
+ | dry, `dereverb` | 4.63 → **4.64** | 1.000 → 1.000 | ∞ (94 → **100 %** untouched) | 3.51 → 3.51 | 4.04 → 4.04 | 3.22 → 3.22 |
907
1127
 
908
- On the training utterances (`vbreverb-train`, 126): PESQ 2.36 → 2.57 → 2.64, OVRL 2.81 → 2.91 → 2.91 (input, 0.3, 0.4). The constants were chosen on `scripts/dereverb.py train`: VoiceBank training speakers in the even-numbered rooms, 1.8–4.5 s utterances and 25–41 s takes. Of the 206 reverberant test utterances 18 % come out untouched: rooms with little tail, which the dry check passes.
1128
+ On the training utterances (`vbreverb-train`, 126): PESQ 2.36 → 2.64 → 2.61 (input, 0.4, 0.5). The constants were chosen on `scripts/dereverb.py train`: VoiceBank training speakers in the even-numbered rooms, 1.8–4.5 s utterances and 25–41 s takes. Of the 206 reverberant test utterances 18 % (0.4) and 25 % (0.5) come out untouched: rooms with little tail, which the dry and diffuse checks pass; 0.6 passes one more, p257_291, whose speaker holds a vowel's pitch as a singer holds a note (the music check), PESQ 2.606 → 2.604, the other 205 bit for bit.
909
1129
 
910
1130
 
911
1131
  ## Demo
package/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export { default as denoise, classify, deesser } from '@audio/denoise-detect'
14
14
  export { default as repair } from '@audio/denoise-repair'
15
15
  export { default as desilence, segments as silenceSegments, split as splitSilence } from '@audio/denoise-desilence'
16
16
  export { default as dewow, analyze as wowFlutter } from '@audio/denoise-dewow'
17
+ export { default as desqueak } from '@audio/denoise-desqueak'
17
18
  export { snr, segSnr, lsd, nrr, speechAttenuation } from '@audio/quality'
18
19
  export { vad, spp, ddSnr } from '@audio/vad'
19
20
  export { noiseProfile, minStats, imcra, known } from '@audio/noise-estimate'
@@ -44,6 +45,7 @@ export type { DesilenceOptions, TimeSegment, MapPoint, DesilenceResult, Segments
44
45
  export type { DenoiseMethod, ClassifyScores, Plan, DenoiseOptions, DenoiseResult, DeesserOptions } from '@audio/denoise-detect'
45
46
  export type { DewindOptions } from '@audio/denoise-dewind'
46
47
  export type { DewowOptions, DewowTrack, DewowLine, DewowAnalysis } from '@audio/denoise-dewow'
48
+ export type { DesqueakOptions } from '@audio/denoise-desqueak'
47
49
  export type { OmlsaOptions } from '@audio/denoise-omlsa'
48
50
  export type { RepairRegion, RepairOptions, RepairMethod } from '@audio/denoise-repair'
49
51
  export type { SpecsubOptions } from '@audio/denoise-spectral'
package/index.js CHANGED
@@ -19,6 +19,7 @@ export { default as denoise, classify, deesser } from '@audio/denoise-detect'
19
19
  export { default as repair } from '@audio/denoise-repair'
20
20
  export { default as desilence, segments as silenceSegments, split as splitSilence } from '@audio/denoise-desilence'
21
21
  export { default as dewow, analyze as wowFlutter } from '@audio/denoise-dewow'
22
+ export { default as desqueak } from '@audio/denoise-desqueak'
22
23
 
23
24
  export { snr, segSnr, lsd, nrr, speechAttenuation } from '@audio/quality'
24
25
  export { vad, spp, ddSnr } from '@audio/vad'
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@audio/denoise",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
- "description": "Noise reduction — gate, spectral subtraction, Wiener, OM-LSA, dehum, declick, decrackle, declip, deesser, dereverb",
5
+ "description": "Noise reduction and restoration: gate, spectral subtraction, Wiener, OM-LSA, dehum, declick, decrackle, declip, dewind, deplosive, deesser, debreath, dereverb, debleed, dewow, desqueak",
6
6
  "sideEffects": false,
7
7
  "exports": {
8
8
  ".": {
@@ -54,23 +54,24 @@
54
54
  "@audio/noise-estimate": "^2.3.0",
55
55
  "@audio/denoise-spectral": "^0.3.0",
56
56
  "@audio/denoise-wiener": "^0.4.0",
57
- "@audio/denoise-omlsa": "^0.5.0",
58
- "@audio/denoise-dehum": "^0.4.0",
59
- "@audio/denoise-declick": "^0.3.0",
60
- "@audio/denoise-decrackle": "^0.3.0",
61
- "@audio/denoise-declip": "^0.3.0",
57
+ "@audio/denoise-omlsa": "^0.6.0",
58
+ "@audio/denoise-dehum": "^0.6.0",
59
+ "@audio/denoise-declick": "^0.4.0",
60
+ "@audio/denoise-decrackle": "^0.4.0",
61
+ "@audio/denoise-declip": "^0.5.0",
62
62
  "@audio/denoise-dewind": "^0.4.0",
63
- "@audio/denoise-deplosive": "^0.2.0",
64
- "@audio/denoise-debreath": "^0.2.1",
65
- "@audio/denoise-dereverb": "^0.4.0",
66
- "@audio/denoise-detect": "^0.5.0",
63
+ "@audio/denoise-deplosive": "^0.3.0",
64
+ "@audio/denoise-debreath": "^0.4.0",
65
+ "@audio/denoise-dereverb": "^0.6.0",
66
+ "@audio/denoise-detect": "^0.6.1",
67
67
  "@audio/dynamics-gate": "^0.1.4",
68
68
  "@audio/denoise-repair": "^0.4.0",
69
69
  "@audio/quality": "^1.0.0",
70
70
  "@audio/stft": "^2.0.0",
71
71
  "@audio/denoise-desilence": "^0.2.1",
72
- "@audio/denoise-debleed": "^0.2.0",
73
- "@audio/denoise-dewow": "^0.3.0"
72
+ "@audio/denoise-debleed": "^0.3.0",
73
+ "@audio/denoise-dewow": "^0.3.0",
74
+ "@audio/denoise-desqueak": "^0.3.0"
74
75
  },
75
76
  "devDependencies": {
76
77
  "audio-lena": "^3.0.0",