Adaptive notch bank — pooled narrow IIR cuts, click-free coefficient morphing, deepen-on-redeploy
- Status
- calibrated
- Updated
- Family
- defeedback, 3 packages under it
- Category
- repair
- Licence
- MIT
- Dependencies
- 1 package, all permissive: MIT
- Downloads
- 2,305 last month
- Tests
- at least 10 in audiojs/defeedback's CI, passed at d7bb02a,
import notchbank from '@audio/defeedback-notchbank'
A pool of narrow peaking-EQ cuts sitting directly in the signal path — pure IIR, zero added latency. deploy(freq) activates a free slot at that frequency (or, if the pool is full, steals the shallowest cut); a repeated deploy at a frequency already covered deepens that notch instead of adding a new one (residual howl still growing → cut harder, down to maxDepth). Coefficients morph linearly over ramp samples on every deploy, so cuts fade in/deepen without clicks.
let notches = notchbank({ fs: 48000, size: 12, Q: 30, depth: -9 })
notches.deploy(2340) // cut a howl at 2340 Hz
let out = notches.process(chunk) // apply the active cuts, in place
notches.notches() // → [{ freq, gain }, ...] currently active
| Param | Default | |
|---|---|---|
fs |
44100 |
Hz |
size |
12 |
pooled notch slots |
Q |
30 |
notch Q (sharpness; q still accepted) |
depth |
-9 |
dB cut per deploy call |
maxDepth |
-24 |
dB, deepest a single notch can reach |
ramp |
256 |
samples, coefficient morph length |
slots |
size |
slots made, the most cfg[2] may put in use |
Returns { process(chunk): chunk, run(chunk, from, to), deploy(freq): void, notches(): Array<{freq, gain}>, cfg, retune() }. process mutates and returns chunk in place; run applies the cuts to a range of it. cfg is [Q, depth, slots in use]: changed between calls, retune() morphs every active notch to its new Q and lets slots past the count go flat; a new depth applies to the next deploys. Each slot lives in typed arrays: nothing is allocated while it runs, and one number (16 bytes) at each deploy.
Use when: the direct audio path of an AFS chain — pair with @audio/defeedback-analyzer + @audio/defeedback-tracker to decide when to deploy.
Not for: detection — this module only applies cuts, it has no howl criteria of its own.
Part of @audio/defeedback — the defeedback family umbrella.
MIT © audiojs