@audio/measure 1.1.3 → 1.1.4

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.
Files changed (3) hide show
  1. package/README.md +7 -1
  2. package/index.js +2 -0
  3. package/package.json +5 -3
package/README.md CHANGED
@@ -11,9 +11,11 @@ Try it in the browser: [Room and speaker measurement](https://audiojs.dev/util/m
11
11
  | `@audio/measure-align` | multi-mic delay + polarity alignment, optional correction apply |
12
12
  | `@audio/measure-response` | frequency response of a device/chain from its impulse response |
13
13
  | `@audio/quality` | objective SNR/LSD/spectral-similarity metrics vs. a reference signal |
14
+ | `@audio/measure-lossy` | lossy-transcode detection — spectral cutoff, edge sharpness, spectral holes, upsampling; "is this FLAC really lossless" |
15
+ | `@audio/measure-correct` | measured response + target curve → correction EQ (Kirkeby-regularized inversion) as linear/minimum-phase FIR or parametric bands — room EQ, headphone EQ, speaker linearization |
14
16
 
15
17
  ```js
16
- import { ir, latency, align, response, snr, lsd } from '@audio/measure'
18
+ import { ir, latency, align, response, lossy, correct, snr, lsd } from '@audio/measure'
17
19
  import chirp from '@audio/synth-chirp'
18
20
 
19
21
  let sweep = chirp({ f0: 20, f1: 20000, duration: 1.5, fs })
@@ -34,6 +36,10 @@ snr(clean, processed) // dB; lsd(a, b) — log-spectral distance, dB
34
36
 
35
37
  `response(ir, {fs=44100, n=8192}) → {freqs, db}` — zero-padded FFT magnitude.
36
38
 
39
+ `lossy(data, {fs=44100}) → {cutoff, lossy, confidence, source, evidence, spectrum}` — spectral-cutoff + spectral-hole + upsampling evidence that a "lossless" file went through MP3/AAC/Vorbis/Opus; naturally band-limited recordings are reported with the numbers so a UI can show why (see `packages/measure-lossy`).
40
+
41
+ `await correct(measured, {fs, target='flat', fMin=20, fMax=20000, smoothOct=1/6, maxBoost=6, maxCut=20, regularization=0.1, mode='fir'|'parametric'|'both', taps=4095, minPhase=false}) → {correction, coefs?, bands?, preamp?, residual, rms}` — `measured` is an IR, a `{freqs, db}` response or `[{f, gain}]` points; `target` a `@audio/spectral-target` preset, points, or function (a Harman headphone target, say). FIR via `@audio/eq-fir`, parametric via `@audio/eq-fit`; `toWavIr()` exports the FIR for convolution hosts, `toEqualizerApo()` the bands (see `packages/measure-correct`).
42
+
37
43
  `@audio/quality` exports `snr`, `segSnr`, `lsd`, `spectralSim`, `nrr`, `speechAttenuation`, `goertzelEnergy`, `chordBalance`, `chordRetention`, `modulationDepth` — reference-vs-output metrics for evaluating denoisers, stretchers, codecs, resamplers (see `packages/quality/README.md`). The Goertzel-family functions (`goertzelEnergy` etc.) take a positional sample rate.
38
44
 
39
45
  Sweep generation = `@audio/synth-chirp`; deconvolution = inverse-sweep convolution via `fourier-transform` FFT. The practical-VST/recording surface: measure once, convolve forever.
package/index.js CHANGED
@@ -4,5 +4,7 @@ export { default as ir, inverseSweep } from '@audio/measure-ir'
4
4
  export { default as latency } from '@audio/measure-latency'
5
5
  export { default as align } from '@audio/measure-align'
6
6
  export { default as response } from '@audio/measure-response'
7
+ export { default as lossy } from '@audio/measure-lossy'
8
+ export { default as correct, toWavIr } from '@audio/measure-correct'
7
9
 
8
10
  export { snr, segSnr, lsd, spectralSim, nrr, speechAttenuation, goertzelEnergy, chordBalance, chordRetention, modulationDepth } from '@audio/quality'
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@audio/measure",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
- "description": "Acoustic & system measurement \u2014 umbrella for @audio/measure-* atoms (IR capture, response, latency)",
6
+ "description": "Acoustic & system measurement — umbrella for @audio/measure-* atoms (IR capture, response, latency)",
7
7
  "workspaces": [
8
8
  "packages/*"
9
9
  ],
@@ -37,7 +37,9 @@
37
37
  "@audio/measure-latency": "^1.0.0",
38
38
  "@audio/measure-align": "^1.0.0",
39
39
  "@audio/measure-response": "^1.0.0",
40
- "@audio/quality": "^1.0.0"
40
+ "@audio/quality": "^1.0.0",
41
+ "@audio/measure-lossy": "^0.1.0",
42
+ "@audio/measure-correct": "^0.1.0"
41
43
  },
42
44
  "devDependencies": {
43
45
  "tst": "^9.4.0",