{"_id":"@audio/weighting-k","_rev":"5-630c3975b2ea7b5ec79a8132b161ddd2","name":"@audio/weighting-k","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@audio/weighting-k","version":"1.0.0","keywords":["audio","dsp","weighting","k"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/weighting-k@1.0.0","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"dist":{"shasum":"e46e14ee4909a16827db2fa7df657ddffc2c8f63","tarball":"https://registry.npmjs.org/@audio/weighting-k/-/weighting-k-1.0.0.tgz","fileCount":2,"integrity":"sha512-/28jsJGHIYAzE3W9+xYO5uPKgLWHxFwaPcUjOqPZT6vsoJH2TcNDZyJi36SqYMaue/TmMVbl2gs+kdJnpf5FLw==","signatures":[{"sig":"MEQCIHIT8/8htCyUSjEy1A60jpXa64Hgs3Csu4oiHACu+YVAAiB5Nvg8XrQaPyQF5DCGBOnoF7WQMSdnKXtDMNQBimxQgg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2144},"main":"k-weighting.js","type":"module","engines":{"node":">=18"},"exports":{".":"./k-weighting.js","./package.json":"./package.json"},"gitHead":"7497a13df657af3880ce03550aa70afe35d5a511","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"ITU-R BS.1770-4 K-weighting: high-shelf + RLB highpass","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"digital-filter":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/weighting-k_1.0.0_1783539791438_0.19954864186431553","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@audio/weighting-k","version":"1.1.0","keywords":["audio","dsp","weighting","k"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/weighting-k@1.1.0","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"dist":{"shasum":"896ae9ad0519a4fc334e83dc13e000978d8e013c","tarball":"https://registry.npmjs.org/@audio/weighting-k/-/weighting-k-1.1.0.tgz","fileCount":2,"integrity":"sha512-uDIN+mpwRKVO8F5ty8NVw5fcWn5E1riMd5iG243BDGVUoNFfMQhgUKN0lQQbVaC0yOHXkNFqqBXz23c4eoAeYA==","signatures":[{"sig":"MEYCIQDJtlpIILK8QCSFG3EJNgU1/J+Htw0pBUqvKHFQGtT1BQIhAJP+E/dQb0dOSvOaFh0d5KvS8zWaoW0SWtALIfOqRK7V","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2127},"main":"k-weighting.js","type":"module","engines":{"node":">=18"},"exports":{".":"./k-weighting.js","./package.json":"./package.json"},"gitHead":"9708e291edb4702f69eba69fa7189143c5f4d124","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"ITU-R BS.1770-4 K-weighting: high-shelf + RLB highpass","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/biquad":"^1.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/weighting-k_1.1.0_1783567875730_0.9351959284259204","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@audio/weighting-k","version":"1.1.1","keywords":["audio","dsp","weighting","k"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/weighting-k@1.1.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/weighting#readme","bugs":{"url":"https://github.com/audiojs/weighting/issues"},"dist":{"shasum":"2a7ccf4523ca94683fb2a13ddb6a2e48d0a2d695","tarball":"https://registry.npmjs.org/@audio/weighting-k/-/weighting-k-1.1.1.tgz","fileCount":2,"integrity":"sha512-tZB7d2jpEnJMWUq5e2Q3xbN9udtLAb1IlsuRa0bIG8RP9ek0K2ZxJN0PDDMBEd84Lwc4km1LZ7FYzP7ZCFidWg==","signatures":[{"sig":"MEQCICLF6DIFc026YHBeqHnEpWhDFpjsgBSD+pt7v2JTQ23XAiAfvjb9VJGtlKAZ3NRd7wy3nk5xgpQ4x8N1Kvj75XWTgw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2494},"main":"k-weighting.js","type":"module","engines":{"node":">=18"},"exports":{".":"./k-weighting.js","./package.json":"./package.json"},"gitHead":"f2ec2225ba71999750e75242536f1e203c912ba0","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/weighting.git","type":"git","directory":"packages/weighting-k"},"_npmVersion":"11.12.1","description":"ITU-R BS.1770-4 K-weighting: high-shelf + RLB highpass","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/biquad":"^1.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/weighting-k_1.1.1_1783726384647_0.4442558928419793","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@audio/weighting-k","version":"1.1.2","keywords":["audio","dsp","weighting","k"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/weighting-k@1.1.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/weighting#readme","bugs":{"url":"https://github.com/audiojs/weighting/issues"},"dist":{"shasum":"39b0282f13040ab9a3a15e7de1a85dff49710729","tarball":"https://registry.npmjs.org/@audio/weighting-k/-/weighting-k-1.1.2.tgz","fileCount":6,"integrity":"sha512-0XtiwcQzplDmgsZvYuAcRcDm5qbXufYjauEWHxo00DSeW9k1JGQIb+qt3vfClN+miBwRdvpWYBFLbOmUZD8tow==","signatures":[{"sig":"MEUCIQC5ZiM+wBcJOYxKUi46sWopRoVDFD6jS3spYxk7I1VD6wIgBMh3DPPKs3U/8i2NPZ7JncvbfDVIhPg+EPy3bLi78oc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8477},"main":"k-weighting.js","type":"module","audio":"./audio.js","types":"./k-weighting.d.ts","engines":{"node":">=18"},"exports":{".":"./k-weighting.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"688ffc6000d207b5e4d0babdc2239aa00bb44850","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/weighting.git","type":"git","directory":"packages/weighting-k"},"_npmVersion":"11.12.1","description":"ITU-R BS.1770-4 K-weighting: high-shelf + RLB highpass","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/biquad":"^1.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/weighting-k_1.1.2_1783732001046_0.04198580218840342","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"_id":"@audio/weighting-k@1.2.0","bugs":{"url":"https://github.com/audiojs/weighting/issues"},"dist":{"shasum":"0b4cdd1c54afbd25f2ce998cc3960941d0c087ae","tarball":"https://registry.npmjs.org/@audio/weighting-k/-/weighting-k-1.2.0.tgz","fileCount":6,"integrity":"sha512-KtF930Uu3kPffV0hl+IyVFvKrTbXfR/PEoqz0gxbfE2cMfEdjdA0u2/IWCkCnU3m8gJ0k5xtxTqD5UMcFXRGsQ==","signatures":[{"sig":"MEUCIBrrRcvnirbSznCrYTQS7QKb54kcoRZ2HApoJmzrzGwbAiEA+xs3p2+AS8As7leDeWbYSwkfspWCZyjgzl550B5nFUc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC3BuZXWl9gFKmF2c6sTQdSJIiotVK4xZzIEW5OGu5XtwIgX+pCDDBbvZDvoLQZby8RK1nUYHlF6AdbSNynSpM/B0A="}],"unpackedSize":11464},"main":"k-weighting.js","name":"@audio/weighting-k","type":"module","audio":"./audio.js","types":"./k-weighting.d.ts","author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"engines":{"node":">=18"},"exports":{".":"./k-weighting.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"3181c3133523da8a6fe57dcc5cccc15f3cf28b31","license":"MIT","version":"1.2.0","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"homepage":"https://github.com/audiojs/weighting#readme","keywords":["audio","dsp","weighting","k"],"repository":{"url":"git+https://github.com/audiojs/weighting.git","type":"git","directory":"packages/weighting-k"},"_npmVersion":"11.12.1","description":"ITU-R BS.1770-4 K-weighting: high-shelf + RLB highpass","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/biquad":"^1.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/weighting-k_1.2.0_1790490973743_0.5277021772892037"}}},"time":{"created":"2026-07-08T19:43:11.226Z","modified":"2026-09-27T06:36:13.997Z","1.0.0":"2026-07-08T19:43:11.574Z","1.1.0":"2026-07-09T03:31:15.871Z","1.1.1":"2026-07-10T23:33:04.770Z","1.1.2":"2026-07-11T01:06:41.177Z","1.2.0":"2026-09-27T06:36:13.813Z"},"bugs":{"url":"https://github.com/audiojs/weighting/issues"},"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","homepage":"https://github.com/audiojs/weighting#readme","keywords":["audio","dsp","weighting","k"],"repository":{"url":"git+https://github.com/audiojs/weighting.git","type":"git","directory":"packages/weighting-k"},"description":"ITU-R BS.1770-4 K-weighting: high-shelf + RLB highpass","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/weighting-k [![npm](https://img.shields.io/npm/v/@audio/weighting-k)](https://www.npmjs.com/package/@audio/weighting-k) [![MIT](https://img.shields.io/badge/MIT-%E0%A5%90-white)](https://github.com/krishnized/license)\n\nITU-R BS.1770-4 K-weighting — the loudness pre-filter behind LUFS\n\n```\nnpm install @audio/weighting-k\n```\n\n```js\nimport kWeighting from '@audio/weighting-k'\n```\n\nTime-domain K-weighting: two cascaded stages redesigned per sample rate from the\ncanonical ITU-R BS.1770-4 Annex 1 analog prototype constants (De Man 2014, \"Evaluation\nof Implementations of the ITU-R BS.1770 Loudness Algorithm\" — the same design pyloudnorm\nuses). Stage 1 is a spherical-head high shelf (G=3.999843853973347 dB,\nQ=0.7071752369554196, fc=1681.974450955533 Hz); stage 2 is the RLB weighting highpass\n(Q=0.5003270373238773, fc=38.13547087602444 Hz, unnormalized `{1,-2,1}` numerator at any\n`fs`). At fs=48000 this reproduces the spec's published coefficient table to ~1e-11.\n\n```js\nkWeighting(data)                          // in place, fs=48000\nkWeighting(data, { fs: 44100 })\nlet sos = kWeighting.coefs(44100)         // 2 SOS sections (shelf, then RLB highpass)\nkWeighting.response(2000, 48000)          // |H(2000)| — shelf boost\n```\n\n| Param | Default | |\n|---|---|---|\n| `fs` | `48000` | sample rate — SOS recomputed when it changes mid-stream |\n\n| Static | Returns | |\n|---|---|---|\n| `.coefs(fs)` | `SOS` | 2-section cascade (high shelf + RLB highpass) at rate `fs`, for analysis/plotting |\n| `.response(f, fs)` | `number` | `\\|H(f)\\|` — exact magnitude of this atom's own `.coefs(fs)` cascade, not an independent approximation |\n| `.ms(channels, params)` | `Float64Array` | mean square of each channel's K-weighted block (input untouched; state per channel on `params`, same `params` every block) — the BS.1770 measurement loop, fused, float64 |\n\n**Use when:** implementing integrated/momentary/short-term loudness (LUFS) per ITU-R BS.1770 / EBU R128 — this is the mandated pre-filter, applied before mean-square gating and channel summing.\n\n---\n\nPart of [@audio/weighting](https://github.com/audiojs/weighting) — the weighting family umbrella.\n\nMIT © [audiojs](https://github.com/audiojs)\n","readmeFilename":"README.md"}