@audio/ pitch-amdf
Status calibrated
npm1.0.2licenseMIT
AMDF (Average Magnitude Difference Function) pitch detection
Overview
- Install
- Updated
- Family
- pitch, 8 packages under it
- Tags
- measure, time & pitch
import 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: .
Part of @audio/pitch — the pitch family umbrella. This README is generated from the umbrella docs.
MIT © audiojs