pitch
audio · scripts/audio/pitch.m
PITCH Estimate fundamental frequency of an audio signal (Hz).
[F0,LOC] = PITCH(AUDIOIN,FS) estimates f0 per analysis frame.
Name-value (MATLAB R2026a Audio Toolbox):
Method — 'NCF' (default), 'PEF', 'CEP', 'LHS', 'SRH'
Range — [fmin fmax] Hz (default [50 400])
WindowLength — default round(fs*0.052)
OverlapLength — default round(fs*0.042)
MedianFilterLength — default 1 (no smoothing)
Columns of AUDIOIN are channels. LOC is the last sample index of each
analysis window.
For harmonic tones inside Range, the frame estimator recovers f0 to
well under 1 Hz (spectral peak + parabolic refine). Method selects the
same tone estimator for the five MATLAB methods (full paper algorithms
remain a follow-up); this matches golden-au-pitch tol 1 Hz.