@audio/pitch-amdf
v1.0.1
Published
AMDF (Average Magnitude Difference Function) pitch detection
Readme
@audio/pitch-amdf

AMDF (Average Magnitude Difference Function) pitch detection
npm install @audio/pitch-amdfimport amdf from '@audio/pitch-amdf'Ross et al., 1974. Average Magnitude Difference Function — the classical predecessor to YIN. Measures average absolute difference between a signal and its delayed copy; minima indicate periodicity.
let result = amdf(samples, { fs: 44100 })| Param | Default | |
|---|---|---|
| fs | 44100 | Sample rate (Hz) |
| minFreq | 50 | Minimum detectable frequency (Hz) |
| maxFreq | 2000 | Maximum detectable frequency (Hz) |
| threshold | 0.3 | Normalized AMDF dip threshold |
Use when: Low-complexity environments, embedded systems. Simpler and cheaper than YIN (no squaring, no cumulative normalization). Not for: Noisy signals — lacks YIN's cumulative normalization that suppresses octave errors. Ref: Ross et al., "Average magnitude difference function pitch extractor", IEEE TASSP 1974. Complexity: $O(N^2/4)$.
Part of @audio/pitch — the pitch family umbrella. This README is generated from the umbrella docs.
MIT © audiojs
