{"_id":"@audio/noise-estimate","_rev":"5-7d5294232e99c54b6db0f4d806435677","name":"@audio/noise-estimate","dist-tags":{"latest":"2.1.0"},"versions":{"1.0.0":{"name":"@audio/noise-estimate","version":"1.0.0","keywords":["audio","dsp","noise-estimation","noise-psd","minimum-statistics","imcra","mcra","speech-enhancement"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/noise-estimate@1.0.0","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/denoise/tree/main/packages/noise-estimate","bugs":{"url":"https://github.com/audiojs/denoise/issues"},"dist":{"shasum":"e04898feb1055104efc50a9f8ccc281962b8529e","tarball":"https://registry.npmjs.org/@audio/noise-estimate/-/noise-estimate-1.0.0.tgz","fileCount":3,"integrity":"sha512-zuH6I8qY7KcunXAXK3WeBIe6eBHS0kaA1MxaxtnT1fb9IHxQJ7pnsNeET9SnoJvyUH7rg1AGmOc7l33mT+X6NA==","signatures":[{"sig":"MEUCIQDwCgs6BSmH3lfYDotQCns28zf+6/aEB+bu68lTmThGWgIgWZ7RWfTG0nHpz/sX+wVMRcBMC1lnTXwVEblEAcFDSgc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7299},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"eab763e3482a5668fae782f958bce3c9945ed753","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/denoise.git","type":"git","directory":"packages/noise-estimate"},"_npmVersion":"11.12.1","description":"Noise PSD estimation — minimum statistics (Martin 2001), IMCRA (Cohen 2003), and quiet-segment profiling for spectral denoisers","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/stft":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/noise-estimate_1.0.0_1783602712945_0.8409082851673451","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@audio/noise-estimate","version":"1.0.1","keywords":["audio","dsp","noise-estimation","noise-psd","minimum-statistics","imcra","mcra","speech-enhancement"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/noise-estimate@1.0.1","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/denoise/tree/main/packages/noise-estimate","bugs":{"url":"https://github.com/audiojs/denoise/issues"},"dist":{"shasum":"ed3758a1aeccaa1a23fe5610e6700cee28de0749","tarball":"https://registry.npmjs.org/@audio/noise-estimate/-/noise-estimate-1.0.1.tgz","fileCount":4,"integrity":"sha512-if1X0MFN/vTlIt3NkVPCPssy/sdkgp51jLvkYngsBltka7ot2U++65NPwLypKq2bhaif/T7rVX0HxzmEfUB2Qw==","signatures":[{"sig":"MEQCIBd0RQ4xEVqj4LvI++8QIOBsfXH0vy0CtT4ZTNRSjVDeAiBThsxoH/fBakmYXJnnDOaAa1J0q0XeuUB6ofqGLtsUDQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9187},"main":"index.js","type":"module","types":"index.d.ts","engines":{"node":">=18"},"exports":{".":"./index.js","./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"ba9ee02218bebb513128b0b15252127a6544b2d6","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/denoise.git","type":"git","directory":"packages/noise-estimate"},"_npmVersion":"11.12.1","description":"Noise PSD estimation — minimum statistics (Martin 2001), IMCRA (Cohen 2003), and quiet-segment profiling for spectral denoisers","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/stft":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/noise-estimate_1.0.1_1783731417152_0.7272666305181508","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@audio/noise-estimate","version":"1.0.2","keywords":["audio","dsp","noise-estimation","noise-psd","minimum-statistics","imcra","mcra","speech-enhancement"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/noise-estimate@1.0.2","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/denoise/tree/main/packages/noise-estimate","bugs":{"url":"https://github.com/audiojs/denoise/issues"},"dist":{"shasum":"f3de5a0e41561f45d0c14b66f8c9ffa7d38661ff","tarball":"https://registry.npmjs.org/@audio/noise-estimate/-/noise-estimate-1.0.2.tgz","fileCount":4,"integrity":"sha512-aVqU/LAS2K7+HPKJxJwZp+eB+/LB9sIbqev6QrGE/v97cP1Fcls1PLLOdRMVU0Me6x5eMPZEgPHPMcIH4AaeZA==","signatures":[{"sig":"MEUCIQCOKt/U4LCnuoI49+iGKyGTedC4+P3pERbn4UakUB/QFwIgI/NQqz5IMn2BVdu2d+7wb/acYlOgG5qqQQiSPCUhah4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIBtzHDx574fCNWq40MXAASGMpHcIioco11LWvjmeonBQAiEAtefA2EZmDX8Hunh+LMWUlEe2EwDSFz/uLO8hhewL6QM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9623},"main":"index.js","type":"module","types":"index.d.ts","engines":{"node":">=18"},"exports":{".":"./index.js","./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"f8701ffecdb1265fdee2ba7a0e649339fb3c0a02","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/denoise.git","type":"git","directory":"packages/noise-estimate"},"_npmVersion":"11.12.1","description":"Noise PSD estimation — minimum statistics (Martin 2001), IMCRA (Cohen 2003), and quiet-segment profiling for spectral denoisers","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/stft":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/noise-estimate_1.0.2_1790521744085_0.621863602003869","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@audio/noise-estimate","version":"2.0.0","keywords":["audio","dsp","noise-estimation","noise-psd","minimum-statistics","imcra","mcra","speech-enhancement"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/noise-estimate@2.0.0","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/denoise/tree/main/packages/noise-estimate","bugs":{"url":"https://github.com/audiojs/denoise/issues"},"dist":{"shasum":"0e8f7018d42d86176afb91dbf618b0812b3905f6","tarball":"https://registry.npmjs.org/@audio/noise-estimate/-/noise-estimate-2.0.0.tgz","fileCount":4,"integrity":"sha512-CJP1jbtej3BnSVZfCnwpdyC+a1BYE9y0fzyHnbtMLLnXJRQ4vX9gLPRpJxTD3Up1TC2ptOuvPzIdVeuBJYmugw==","signatures":[{"sig":"MEYCIQDDz0kcTlfRC9A/2h6XDz9dj8zOMQAfqHfJgE0I3ndGbQIhAIYMfTmCsDC5oeva3MkgpKQkptfMZ2ywQU8rDjSGN8J5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIAz5DXjvmLrvfHbPIekZ98dm6I/5GUno58P+eG63r6r7AiBAo8F63NmHATaaJAiBSdiKYd46fuW20L7OLiGqVonwUg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22659},"main":"index.js","type":"module","types":"index.d.ts","engines":{"node":">=18"},"exports":{".":"./index.js","./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"f8701ffecdb1265fdee2ba7a0e649339fb3c0a02","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/denoise.git","type":"git","directory":"packages/noise-estimate"},"_npmVersion":"11.12.1","description":"Noise PSD estimation — minimum statistics (Martin 2001), IMCRA (Cohen 2003), and quiet-segment profiling for spectral denoisers","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/stft":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/noise-estimate_2.0.0_1790637665080_0.17852211015033248","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"_id":"@audio/noise-estimate@2.1.0","bugs":{"url":"https://github.com/audiojs/denoise/issues"},"dist":{"shasum":"de5fcaed47f7f9aca141e533ee601a93a8e307f3","tarball":"https://registry.npmjs.org/@audio/noise-estimate/-/noise-estimate-2.1.0.tgz","fileCount":4,"integrity":"sha512-I1YBImfzteNbfx1GIT2XNv00e9lBE/GSDD5DHhR/s4183pep+VEQXVUzYWyZnqtVHNK5QA8MYTeeoCr2wodO0g==","signatures":[{"sig":"MEYCIQDj8AjbuS/lZDR8ha1HOdauQpB9iQ51otNnEU1i1cehiQIhANZeiWAC7I1XBiZ1l3Da+Btbyr7MjR9fL4pZyvSMt7qa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBHbj2SGPw24pmdFNvObAng98Z05kyyYYwGJWN4UyOoeAiEAo4cASnHwf8fDPkGMcb8pfdDae/W6I1+97u/AsNpj5MU="}],"unpackedSize":25118},"main":"index.js","name":"@audio/noise-estimate","type":"module","types":"index.d.ts","author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"engines":{"node":">=18"},"exports":{".":"./index.js","./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"f613e757819927d0593e26e90dac25d29779d8e6","license":"MIT","version":"2.1.0","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"homepage":"https://github.com/audiojs/denoise/tree/main/packages/noise-estimate","keywords":["audio","dsp","noise-estimation","noise-psd","minimum-statistics","imcra","mcra","speech-enhancement"],"repository":{"url":"git+https://github.com/audiojs/denoise.git","type":"git","directory":"packages/noise-estimate"},"_npmVersion":"11.12.1","description":"Noise PSD estimation — minimum statistics (Martin 2001), IMCRA (Cohen 2003), and quiet-segment profiling for spectral denoisers","directories":{},"maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/stft":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/noise-estimate_2.1.0_1790713132985_0.24507496455065003"}}},"time":{"created":"2026-07-09T13:11:52.754Z","modified":"2026-09-29T20:18:53.237Z","1.0.0":"2026-07-09T13:11:53.076Z","1.0.1":"2026-07-11T00:56:57.280Z","1.0.2":"2026-09-27T15:09:04.170Z","2.0.0":"2026-09-28T23:21:05.168Z","2.1.0":"2026-09-29T20:18:53.064Z"},"bugs":{"url":"https://github.com/audiojs/denoise/issues"},"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","homepage":"https://github.com/audiojs/denoise/tree/main/packages/noise-estimate","keywords":["audio","dsp","noise-estimation","noise-psd","minimum-statistics","imcra","mcra","speech-enhancement"],"repository":{"url":"git+https://github.com/audiojs/denoise.git","type":"git","directory":"packages/noise-estimate"},"description":"Noise PSD estimation — minimum statistics (Martin 2001), IMCRA (Cohen 2003), and quiet-segment profiling for spectral denoisers","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/noise-estimate\n\n> Noise power-spectral-density estimation — the noise floor that spectral denoisers subtract.\n\nStateful estimators over STFT magnitude frames. Feed them per-frame; read `.psd` (a `Float64Array` of `N/2+1` bins) whenever you need the current noise estimate.\n\n```js\nimport { minStats } from '@audio/noise-estimate'\nimport { stftAnalyse } from '@audio/stft'\n\nlet est = minStats(1024, { D: 96 })          // half = frameSize/2\nstftAnalyse(signal, mag => est.update(mag), { frameSize: 2048 })\nlet noisePsd = est.psd                        // drive Wiener / MMSE / OM-LSA gain\n```\n\n## `minStats(half, opts?)`\n\nMinimum Statistics (Martin 2001): the minimum of the recursively smoothed periodogram over the last `D` frames, times the bias compensation B<sub>min</sub> that makes it estimate the noise power rather than its lower tail. `opts`: `D` (window frames, default 96: 1.1 s at hop 512, 44.1 kHz), `alpha` (smoothing, 0.7), `bias` (default B<sub>min</sub>(D, α), Martin 2001 eq. 17: 3.44 for the defaults; the window's mean caps it either way). Returns `{ psd, bias, update(mag) }`.\n\nOnce the window holds `D` frames, the estimate never exceeds their mean. B<sub>min</sub> is Gaussian noise's ratio of mean to minimum; a steady line (a whine, a pilot tone, a carrier) hardly swings, its minimum is its mean, and B<sub>min</sub> put it 5–7 dB over (6.5 dB in `@audio/denoise-wiener`'s 1.5 s window at 44.1 kHz, where the line then came through 6 dB louder than on its learned profile). The noise holds no more power than its bin: the window's mean caps it, and where the bin swings as noise or speech does, the minimum governs. Before the window is full the minimum alone counts: over fewer frames B<sub>min</sub>(D) runs over the Gaussian bias of that window, and the mean would undercut it everywhere.\n\nThe smoother starts at the first frame, and frames of digital silence are skipped: neither a warm-up from zero nor an edited-out pause becomes the window's minimum. On white Gaussian noise through 2048/512 Hann frames the estimate's mean is 0.4–0.7 dB under the noise power for D 48–96 and α 0.7–0.95 (the cap takes 0.03–0.35 dB of it, where P<sub>min</sub>·B<sub>min</sub> spreads over the mean).\n\n## `imcra(half, opts?)`\n\nImproved Minima Controlled Recursive Averaging (Cohen 2003): recursive averaging of the noisy power, frozen by the speech presence probability, with that probability from two iterations of time–frequency smoothing and minimum tracking. As the paper (eqs. 7, 10–12, 14–29, Table I), with Cohen's own `omlsa.m` for what it leaves open; `scripts/reference.py` in [@audio/denoise](https://github.com/audiojs/denoise) is written from the paper and reproduces `omlsa.m` to the last bit on VoiceBank frames (but for near-empty bins, where `omlsa.m`'s absolute 1e-10 floors bind), and test.js holds this code to it.\n\n`opts`: `fs` and `hop` (the frame step: Table I's constants are for 8 ms frames and are rescaled to it, so time constants and the ~1 s minimum window hold in seconds; without them the constants apply per frame), `alpha` (α<sub>s</sub>, 0.9), `alphaD` (α<sub>d</sub>, 0.85), `beta` (1.47), `bMin` (1.66), `gamma0` (4.6), `gamma1` (3), `zeta0` (1.67), `w` (1), `U` (8), `V` (15 frames of 8 ms), `alphaDD` (0.92) and `xiMin` (−25 dB) for the decision-directed a priori SNR.\n\nReturns `{ psd, xi, xi0, gamma, v, gain, p, frames, update(mag, spp?) }`: per frame, on the updated noise estimate, the a priori SNR ξ (`xi0`: on the previous estimate, what the speech presence probability used), the a posteriori SNR γ, v = γξ/(1+ξ), the LSA gain G<sub>H1</sub> and the speech presence probability p. `spp` (a number or per-bin array) replaces p. Digital silence is skipped. On white Gaussian noise the estimate's mean is within 0.4 dB of the noise power at 16, 44.1 and 48 kHz.\n\n## `noiseProfile(data, opts?)`\n\nOne-shot baseline: averages |X|² over a quiet segment (`opts.from`/`opts.to` samples). Returns a `Float64Array` PSD. Use when you can point at a known noise-only region.\n\n## `known(profile, opts?)`\n\nA noise known rather than tracked: `profile` (a `noiseProfile`) is held, and each `update(mag)` gives what `imcra` gives on it: ξ, decision-directed on G<sub>H1</sub> (`alphaDD` 0.92, `xiMin` −25 dB), γ, v and G<sub>H1</sub>, so a gain written for `imcra` (OM-LSA's) runs on a learned noise unchanged. `xi0` is `xi`; `p` stays 0. Digital silence is skipped.\n\n## References\n\nR. Martin, \"Noise power spectral density estimation based on optimal smoothing and minimum statistics\", IEEE Trans. Speech Audio Process. 9(5), 2001 · R. Martin, \"Bias compensation methods for minimum statistics noise power spectral density estimation\", Signal Processing 86, 2006 (M(D), Table 5) · I. Cohen, \"Noise spectrum estimation in adverse environments: improved minima controlled recursive averaging\", IEEE Trans. Speech Audio Process. 11(5), 2003 · I. Cohen, `omlsa.m`, [israelcohen.com/software](https://israelcohen.com/software/).\n\n## Notes\n\nSTFT via [`@audio/stft`](https://github.com/audiojs/stft); pairs with [`@audio/vad`](https://github.com/audiojs/denoise/tree/main/packages/vad)'s `spp()`. Also re-exported from [`@audio/denoise`](https://github.com/audiojs/denoise). MIT.\n","readmeFilename":"README.md"}