Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Fundamental Frequency Estimation from Spectral Peaks

Spectral peak measurement was discussed in Chapter 5. Given a set of peak frequencies $ f_k$ , $ k=1,\ldots,N_f$ , it is usually straightforward to form a fundamental frequency estimate ``$ F_0$ ''. This task is also called pitch detection, where the perceived ``pitch'' of the audio signal is assumed to coincide well enough with its fundamental frequency. We assume here that the signal is periodic, so that all of its sinusoidal components are harmonics of a fundamental component having frequency $ F_0$ . (For inharmonic sounds, the perceived pitch, if any, can be complex to predict [54].)

An approximate maximum-likelihood $ F_0$ -detection algorithm11.1 consists of the following steps:

  1. Find the peak of the histogram of the peak-frequency-differences in order to find the most common harmonic spacing. This is the nominal $ F_0$ estimate. The matlab hist function can be used to form a histogram from the measured peak-spacings.

  2. Refine the nominal $ F_0$ estimate using linear regression. A linear regression is a least-squares straight-line fit. Our straight line is $ f_k=k\,F_0$ , $ k=1,2,\ldots\,$ , where $ f_k$ are the measured harmonic peak frequencies. (The histogram estimate can be used to reject peaks too far from the expected harmonic frequencies.) Thus, $ F_0$ is the slope of the fitted line. In matlab, the function polyfit(x,y,1) can be used. As an ideal example, p = polyfit([1,2,3],[440,2*440,3*440],1) returns p = [440,0], where p(1) is the slope, and p(2) is the offset.

A matlab listing for $ F_0$ estimation along these lines appears in §F.6.

Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

[How to cite this work]  [Order a printed hardcopy]  [Comment on this page via email]

``Spectral Audio Signal Processing'', by Julius O. Smith III, W3K Publishing, 2011, ISBN 978-0-9745607-3-1.
Copyright © 2022-02-28 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University