@audio/denoise 0.3.3 → 0.3.5
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.
- package/README.md +8 -7
- package/index.js +37 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -110,7 +110,8 @@ dewind(data, { cutoffMin: 60, cutoffMax: 250 })
|
|
|
110
110
|
| `Q` | `0.707` | Butterworth-ish |
|
|
111
111
|
| `blockSize` | `1024` | Coefficient update interval (samples) |
|
|
112
112
|
|
|
113
|
-
**Use when:** wind buffeting,
|
|
113
|
+
**Use when:** intermittent wind buffeting, handling thumps, low-frequency room modes — the adaptive cutoff opens on gusts and closes between them (measured: beats `wiener` on gusty wind at ~1/10 the CPU).<br>
|
|
114
|
+
**Not for:** continuous rumble under speech — a time-domain cutoff can't separate overlapping spectra; use `wiener`/`omlsa` there (measured ~9 dB vs ~1 dB SNR gain). An LPC-null post-filter was evaluated and rejected: voiced speech is as AR-predictable as wind, so nulling wind poles whitens vowels too (LSD improves, SNR and speech level degrade).
|
|
114
115
|
|
|
115
116
|
|
|
116
117
|
### `deplosive`
|
|
@@ -134,7 +135,7 @@ deplosive(data, { triggerRatio: 4, attack: 0.005, release: 0.08 })
|
|
|
134
135
|
|
|
135
136
|
### `deesser`
|
|
136
137
|
|
|
137
|
-
Dynamic peaking EQ centred on the sibilance band. Detection runs on a HP side-chain; when the envelope exceeds threshold, a negative-gain peaking EQ at `freq` engages on the audio path. Re-computed every `block` samples for smooth gain riding.
|
|
138
|
+
Dynamic peaking EQ centred on the sibilance band. Detection runs on a HP side-chain; when the envelope exceeds threshold, a negative-gain peaking EQ at `freq` engages on the audio path. Re-computed every `block` samples for smooth gain riding. Backed by [`@audio/dynamics-deesser`](https://github.com/audiojs/dynamics) `mode: 'band'` since the 2026-07 near-dupe merge — same seconds-based options here.
|
|
138
139
|
|
|
139
140
|
```js
|
|
140
141
|
deesser(data, { freq: 6500, threshold: -28, ratio: 4 })
|
|
@@ -269,8 +270,7 @@ declip(data) // auto-detects c
|
|
|
269
270
|
|
|
270
271
|
### `dereverb`
|
|
271
272
|
|
|
272
|
-
Late-reverb
|
|
273
|
-
`|R̂(k)|² ≈ exp(-2·δ·t·hop) · |Y_prev(k)|²` and subtracts à la Berouti.
|
|
273
|
+
Late-reverb suppression (Lebart, Boucher & Denbigh 2001 estimate, Habets-class gain). Models the late tail as a decaying sum of past frames' power, then applies a decision-directed Wiener gain on the signal-to-reverb ratio — the cross-frame smoothing suppresses the musical noise hard subtraction produces.
|
|
274
274
|
|
|
275
275
|
```js
|
|
276
276
|
dereverb(data, { t60: 0.6, predelay: 0.04 })
|
|
@@ -280,8 +280,9 @@ dereverb(data, { t60: 0.6, predelay: 0.04 })
|
|
|
280
280
|
|---|---|---|
|
|
281
281
|
| `t60` | `0.5` | Assumed reverberation time (s) |
|
|
282
282
|
| `predelay` | `0.04` | Direct-sound passthrough (s) |
|
|
283
|
-
| `alpha` | `1.5` |
|
|
284
|
-
| `
|
|
283
|
+
| `alpha` | `1.5` | Reverb-PSD over-estimation factor |
|
|
284
|
+
| `alphaDD` | `0.98` | Decision-directed SIR smoothing |
|
|
285
|
+
| `gMin` | `0.05` | Gain floor for reverb-dominated bins |
|
|
285
286
|
|
|
286
287
|
**Use when:** moderate room reverb (RT60 ≤ 1 s) on a single channel.<br>
|
|
287
288
|
**Not for:** heavy reverb or convolutive distortion — use multi-channel WPE (out of scope).
|
|
@@ -291,7 +292,7 @@ dereverb(data, { t60: 0.6, predelay: 0.04 })
|
|
|
291
292
|
|
|
292
293
|
### `gate`
|
|
293
294
|
|
|
294
|
-
Look-ahead noise gate with hysteresis.
|
|
295
|
+
Look-ahead noise gate with hysteresis. Backed by [`@audio/dynamics-gate`](https://github.com/audiojs/dynamics) since the 2026-07 near-dupe merge — same seconds-based options here; `closeThreshold` (default `threshold − 6` dB) sets the hysteresis close level.
|
|
295
296
|
|
|
296
297
|
```js
|
|
297
298
|
gate(data, { threshold: -45, attack: 0.005, release: 0.1, hold: 0.05, lookahead: 0.005 })
|
package/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// @audio/denoise — noise reduction & restoration umbrella re-exporting every @audio/denoise-* atom.
|
|
2
2
|
// For smaller bundles, depend directly on the individual atom.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import gate_ from '@audio/dynamics-gate'
|
|
5
|
+
import deesser_ from '@audio/dynamics-deesser'
|
|
6
|
+
|
|
5
7
|
export { default as dehum } from '@audio/denoise-dehum'
|
|
6
8
|
export { default as specsub } from '@audio/denoise-spectral'
|
|
7
9
|
export { default as wiener } from '@audio/denoise-wiener'
|
|
@@ -11,7 +13,6 @@ export { default as decrackle } from '@audio/denoise-decrackle'
|
|
|
11
13
|
export { default as declip } from '@audio/denoise-declip'
|
|
12
14
|
export { default as dewind } from '@audio/denoise-dewind'
|
|
13
15
|
export { default as deplosive } from '@audio/denoise-deplosive'
|
|
14
|
-
export { default as deesser } from '@audio/denoise-deesser'
|
|
15
16
|
export { default as debreath } from '@audio/denoise-debreath'
|
|
16
17
|
export { default as dereverb } from '@audio/denoise-dereverb'
|
|
17
18
|
export { default as denoise, classify } from '@audio/denoise-detect'
|
|
@@ -21,3 +22,37 @@ export { snr, segSnr, lsd, nrr, speechAttenuation } from '@audio/quality'
|
|
|
21
22
|
export { vad, spp, ddSnr } from '@audio/vad'
|
|
22
23
|
export { noiseProfile, minStats, imcra } from '@audio/noise-estimate'
|
|
23
24
|
export { stftBatch, stftStream, stftAnalyse } from '@audio/stft'
|
|
25
|
+
|
|
26
|
+
// gate/deesser — @audio/dynamics-{gate,deesser} behind this family's seconds-based,
|
|
27
|
+
// in-place API (2026-07 near-dupe merge: the hysteresis + look-ahead gate lives in
|
|
28
|
+
// dynamics-gate; deesser mode 'band' is the dynamic peaking-EQ architecture this
|
|
29
|
+
// family shipped). Batch shape — for chunked streaming use the dynamics streams.
|
|
30
|
+
export const gate = (data, params = {}) => {
|
|
31
|
+
let th = params.threshold ?? -40
|
|
32
|
+
data.set(gate_(data, {
|
|
33
|
+
sampleRate: params.fs || 44100,
|
|
34
|
+
threshold: th,
|
|
35
|
+
closeThreshold: params.closeThreshold ?? th - 6,
|
|
36
|
+
attack: (params.attack ?? 0.001) * 1000,
|
|
37
|
+
release: (params.release ?? 0.05) * 1000,
|
|
38
|
+
hold: (params.hold ?? 0.01) * 1000,
|
|
39
|
+
range: params.range ?? -80,
|
|
40
|
+
lookahead: (params.lookahead ?? 0.005) * 1000,
|
|
41
|
+
}))
|
|
42
|
+
return data
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const deesser = (data, params = {}) => {
|
|
46
|
+
data.set(deesser_(data, {
|
|
47
|
+
sampleRate: params.fs || 44100,
|
|
48
|
+
mode: 'band',
|
|
49
|
+
freq: params.freq ?? 6000,
|
|
50
|
+
q: params.Q ?? 1.4,
|
|
51
|
+
threshold: params.threshold ?? -30,
|
|
52
|
+
ratio: params.ratio ?? 4,
|
|
53
|
+
attack: (params.attack ?? 0.001) * 1000,
|
|
54
|
+
release: (params.release ?? 0.05) * 1000,
|
|
55
|
+
block: params.block,
|
|
56
|
+
}))
|
|
57
|
+
return data
|
|
58
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@audio/denoise",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Noise reduction — gate, spectral subtraction, Wiener, OM-LSA, dehum, declick, decrackle, declip, deesser, dereverb",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"@audio/denoise-declip": "^0.1.0",
|
|
58
58
|
"@audio/denoise-dewind": "^0.1.0",
|
|
59
59
|
"@audio/denoise-deplosive": "^0.1.0",
|
|
60
|
-
"@audio/denoise-deesser": "^0.1.0",
|
|
61
60
|
"@audio/denoise-debreath": "^0.1.0",
|
|
62
61
|
"@audio/denoise-dereverb": "^0.1.0",
|
|
63
|
-
"@audio/denoise-gate": "^0.1.0",
|
|
64
62
|
"@audio/denoise-detect": "^0.1.0",
|
|
63
|
+
"@audio/dynamics-gate": "^0.1.4",
|
|
64
|
+
"@audio/dynamics-deesser": "^0.2.3",
|
|
65
65
|
"@audio/denoise-repair": "^0.1.0",
|
|
66
66
|
"@audio/quality": "^1.0.0",
|
|
67
67
|
"@audio/stft": "^1.0.3"
|