{"_id":"@audio/spectral-flatness","_rev":"3-e0618e42750066cb802ae5e6229c52d1","name":"@audio/spectral-flatness","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@audio/spectral-flatness","version":"1.0.0","keywords":["audio","dsp","spectral","features","flatness"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/spectral-flatness@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":"a547d9e9cf9f55f1da4a5fa5cbafb4147c30260a","tarball":"https://registry.npmjs.org/@audio/spectral-flatness/-/spectral-flatness-1.0.0.tgz","fileCount":3,"integrity":"sha512-m8ILbDlBP+jNEqBV6uy5YxFp0HCVUcGrk+q9jzU1WDc86kFMms5oE51KTc46D614TwAZnjU2Pjp9rfRtqM5a0w==","signatures":[{"sig":"MEUCIQCIE/7n2AOhv+Et/IqmBpS0FnG42RnnqaMidhbSJkAjhQIgctmW/0LZYFAFAykw79LbaSahPciRQlGkmTYkpSe7nVY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1242},"main":"flatness.js","type":"module","engines":{"node":">=18"},"exports":{".":"./flatness.js","./package.json":"./package.json"},"gitHead":"a1aba4f2662a0f284ef88a04047c6cfa3c3ce6e5","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Spectral flatness — geometric/arithmetic mean ratio of the POWER spectrum, 0 (tonal) … 1 (noise).","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/spectral-flatness_1.0.0_1783540013781_0.010253326121188566","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@audio/spectral-flatness","version":"1.0.1","keywords":["audio","dsp","spectral","features","flatness"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/spectral-flatness@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/spectral#readme","bugs":{"url":"https://github.com/audiojs/spectral/issues"},"dist":{"shasum":"c81ac4819b568532146cb7345a710522737ae5b3","tarball":"https://registry.npmjs.org/@audio/spectral-flatness/-/spectral-flatness-1.0.1.tgz","fileCount":3,"integrity":"sha512-lCZCs6mgkqsz7FbZrfDaJ5suVjYyDTpVNtJb+ViT+JZJiXjd+Wexzjom4dvyATUBheMmIE/AXvFrqyLNH9osmQ==","signatures":[{"sig":"MEUCIQDnfkKao5qGxVGTid6UciqfMq6BrOW+BqYMiq7WC5c64gIgb5As32ts7X7jb/UiKwbOaJzRciR2Vh22L6hh08xPgbM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1833},"main":"flatness.js","type":"module","engines":{"node":">=18"},"exports":{".":"./flatness.js","./package.json":"./package.json"},"gitHead":"27a82efde8c69de05035cc9f97fc017936efb69e","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/spectral.git","type":"git","directory":"packages/spectral-flatness"},"_npmVersion":"11.12.1","description":"Spectral flatness — geometric/arithmetic mean ratio of the POWER spectrum, 0 (tonal) … 1 (noise).","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/spectral-flatness_1.0.1_1783726343024_0.12808403898499332","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@audio/spectral-flatness","version":"1.0.2","description":"Spectral flatness — geometric/arithmetic mean ratio of the POWER spectrum, 0 (tonal) … 1 (noise).","type":"module","sideEffects":false,"main":"flatness.js","exports":{".":"./flatness.js","./package.json":"./package.json"},"keywords":["audio","dsp","spectral","features","flatness"],"license":"MIT","author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/audiojs/spectral.git","directory":"packages/spectral-flatness"},"funding":"https://github.com/sponsors/audiojs","gitHead":"0bf461273c2acb2401ff9842afec35a43fd05a9a","_id":"@audio/spectral-flatness@1.0.2","bugs":{"url":"https://github.com/audiojs/spectral/issues"},"homepage":"https://github.com/audiojs/spectral#readme","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-/OV32i0OtQJMIbeg+o5yCyurmgkdf8ojsCjfpzv277jjzXmooLIXhXFVU2q2vOJsX/E1sKrCvvEVb+Um/bWsyA==","shasum":"0c60e4859774ce26d8bfd93134388ce61bc6cfa3","tarball":"https://registry.npmjs.org/@audio/spectral-flatness/-/spectral-flatness-1.0.2.tgz","fileCount":4,"unpackedSize":2218,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDzl6xvlKaM9sRqwYtA5Ty1UABLeGEcPonYZypgWjc61QIhALa5e50NNh2PNDAtKj7KCuHiEYcADQVEhQ8/V62E+5Fv"}]},"_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"directories":{},"maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/spectral-flatness_1.0.2_1783731876383_0.7652894155955061"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-08T19:46:53.587Z","modified":"2026-07-11T01:04:36.733Z","1.0.0":"2026-07-08T19:46:53.904Z","1.0.1":"2026-07-10T23:32:23.148Z","1.0.2":"2026-07-11T01:04:36.546Z"},"bugs":{"url":"https://github.com/audiojs/spectral/issues"},"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","homepage":"https://github.com/audiojs/spectral#readme","keywords":["audio","dsp","spectral","features","flatness"],"repository":{"type":"git","url":"git+https://github.com/audiojs/spectral.git","directory":"packages/spectral-flatness"},"description":"Spectral flatness — geometric/arithmetic mean ratio of the POWER spectrum, 0 (tonal) … 1 (noise).","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/spectral-flatness\n\n> Spectral flatness — geometric/arithmetic mean ratio of the power spectrum, 0 (tonal) … 1 (noise). Peeters 2004 §6.3.\n\n`npm install @audio/spectral-flatness`\n\n```js\nimport { fft } from 'fourier-transform'\nimport flatness from '@audio/spectral-flatness'\n\nlet win = frame.map((x, i) => x * (0.5 - 0.5 * Math.cos(2 * Math.PI * i / (frame.length - 1))))\nlet [re, im] = fft(win)\nlet mag = re.map((r, k) => Math.hypot(r, im[k]))\n\nlet f = flatness(mag)   // 0 = tonal, 1 = noise-like\n```\n\nNo options — `flatness(mag)` takes only the magnitude spectrum.\n\nPart of [@audio/spectral](https://github.com/audiojs/spectral).\n","readmeFilename":"README.md"}