@audio/pitch-yin
v1.0.4
Published
YIN pitch detection (de Cheveigné & Kawahara, 2002)
Downloads
1,199
Readme
@audio/pitch-yin

YIN pitch detection (de Cheveigné & Kawahara, 2002)
npm install @audio/pitch-yinimport yin from '@audio/pitch-yin'de Cheveigné & Kawahara, 2002. The reference algorithm for monophonic pitch estimation. Most cited, most tested, most robust.
let result = yin(samples, { fs: 44100 })
// → { freq: 440.1, clarity: 0.97 } or null| Param | Default | |
|---|---|---|
| fs | 44100 | Sample rate (Hz) |
| threshold | 0.15 | CMND threshold — lower = stricter, fewer detections |
Use when: General-purpose monophonic pitch tracking — speech, singing, solo instruments. The most reliable choice when in doubt. Not for: Polyphonic audio (returns dominant or null), real-time with hard latency budgets (needs full window). Ref: de Cheveigné & Kawahara, "YIN, a fundamental frequency estimator for speech and music", JASA 2002. Complexity: $O(N^2/4)$ — two nested passes over half the window.
Part of @audio/pitch — the pitch family umbrella. This README is generated from the umbrella docs.
MIT © audiojs
