@audio/measure 1.0.0 → 1.1.1
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.
- package/README.md +30 -4
- package/index.js +2 -0
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -1,11 +1,37 @@
|
|
|
1
1
|
# @audio/measure
|
|
2
2
|
|
|
3
|
-
> Practical recording measurement — capture what your room/gear actually does.
|
|
3
|
+
> Practical recording measurement — capture what your room/gear actually does.
|
|
4
4
|
|
|
5
5
|
| Package | What |
|
|
6
6
|
|---|---|
|
|
7
7
|
| `@audio/measure-ir` | ESS sweep → impulse response (Farina 2000) — feeds `reverb-convolution` + `amp-cabinet` |
|
|
8
|
-
| `@audio/measure-
|
|
9
|
-
| `@audio/measure-
|
|
8
|
+
| `@audio/measure-latency` | loopback round-trip latency, sample-exact via FFT cross-correlation |
|
|
9
|
+
| `@audio/measure-align` | multi-mic delay + polarity alignment, optional correction apply |
|
|
10
|
+
| `@audio/measure-response` | frequency response of a device/chain from its impulse response |
|
|
11
|
+
| `@audio/quality` | objective SNR/LSD/spectral-similarity metrics vs. a reference signal |
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
```js
|
|
14
|
+
import { ir, latency, align, response, snr, lsd } from '@audio/measure'
|
|
15
|
+
import chirp from '@audio/synth-chirp'
|
|
16
|
+
|
|
17
|
+
let sweep = chirp({ f0: 20, f1: 20000, duration: 1.5, fs })
|
|
18
|
+
let h = ir(recorded, { sweep, f0: 20, f1: 20000, fs, length: 1000 }) // impulse response
|
|
19
|
+
let { freqs, db } = response(h, { fs, n: 8192 }) // frequency response
|
|
20
|
+
|
|
21
|
+
let lat = latency(recorded, reference, { fs }) // { samples, seconds, confidence }
|
|
22
|
+
let al = align(a, b, { fs, apply: true }) // { delay, seconds, polarity, aligned? }
|
|
23
|
+
|
|
24
|
+
snr(clean, processed) // dB; lsd(a, b) — log-spectral distance, dB
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`ir(recorded, {sweep, f0=20, f1, fs=44100, length}) → Float32Array` — Farina exponential-sine-sweep deconvolution: inverse filter = time-reversed sweep with exp(−t/L) compensation, distortion products land at negative time and are trimmed. Self-deconvolution calibrated so an identity system yields δ = 1.0.
|
|
28
|
+
|
|
29
|
+
`latency(recorded, reference, {fs=44100}) → {samples, seconds, confidence}` — FFT cross-correlation peak.
|
|
30
|
+
|
|
31
|
+
`align(a, b, {fs=44100, apply=false}) → {delay, seconds, polarity: 1|-1, aligned?}` — signed cross-correlation peak gives delay + polarity of `b` relative to `a`; `apply: true` shifts/flips `b`.
|
|
32
|
+
|
|
33
|
+
`response(ir, {fs=44100, n=8192}) → {freqs, db}` — zero-padded FFT magnitude.
|
|
34
|
+
|
|
35
|
+
`@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.
|
|
36
|
+
|
|
37
|
+
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,3 +4,5 @@ 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
|
+
|
|
8
|
+
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.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"description": "Acoustic & system measurement
|
|
6
|
+
"description": "Acoustic & system measurement — umbrella for @audio/measure-* atoms (IR capture, response, latency)",
|
|
7
7
|
"workspaces": [
|
|
8
8
|
"packages/*"
|
|
9
9
|
],
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"@audio/measure-ir": "^1.0.0",
|
|
37
37
|
"@audio/measure-latency": "^1.0.0",
|
|
38
38
|
"@audio/measure-align": "^1.0.0",
|
|
39
|
-
"@audio/measure-response": "^1.0.0"
|
|
39
|
+
"@audio/measure-response": "^1.0.0",
|
|
40
|
+
"@audio/quality": "^1.0.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"tst": "^9.4.0",
|
|
@@ -44,5 +45,9 @@
|
|
|
44
45
|
},
|
|
45
46
|
"publishConfig": {
|
|
46
47
|
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/audiojs/measure.git"
|
|
47
52
|
}
|
|
48
53
|
}
|