## 3 Estimating Sinusoidal Parameters from 3 Bins of Spectrum  
The methods in this article estimate \((\mathcal{K},\mathcal{X})\) using some form of parabolic fit on the magnitude spectrum maximum at peak bin \(k_{m}\) and its lower and upper neighbors at bins \(k_{m}-1\) and \(k_{m}+1\). For compactness, we introduce the magnitude spectrum value substitutions [12]  
\[\alpha =|X\left[k_{m}-1\right]| \tag{6}\] \[\beta =|X\left[k_{m}\right]|\] (7) \[\gamma =|X\left[k_{m}+1\right]|\,. \tag{8}\]  
A coarse way of estimating sinusoid parameters is to find peaks in the DFT magnitude spectrum \(|X[k]|\) and use their frequency and amplitude as estimates. Here the sinusoid's fractional bin index andmagnitude \((\mathcal{K},\mathcal{X})\) are estimated as \((\hat{\mathcal{K}},\hat{\mathcal{X}})\). The values associated with a peak bin \(k_{m}\) in the magnitude spectrum are  
\[\hat{\mathcal{K}} =k_{m} \tag{9}\] \[\hat{\mathcal{X}} =\left|X[k_{m}]\right|. \tag{10}\]  
We call this method the _nearest bin method_, or \"nearest\" for short. Here the fractional bin estimate \(\mathcal{K}\) will always be an integer; hence the bin estimate of the nearest bin method can have up to \(\pm\)0.5 bins of error. The nearest bin method is inherently limited by the finite frequency definition of the DFT. This lack of accuracy can be problematic, especially if typical DFT frequency definition falls below a satisfactory level (e.g., human perception in the lower frequency domain). A typical engineering solution is to refine this coarse estimate by a fine search over \(\pm\)0.5 bins around this peak [2; 14; 15; 18; 27; 28]. Approaches to refining the coarse estimate can be divided into _iterative_ approaches and _direct_ approaches [27]. Iterative approaches (e.g., [29]) involve multiple rounds of function evaluations or a series of DTFT evaluations that narrow in on the solution. Direct methods form the estimate \((\hat{\mathcal{K}},\hat{\mathcal{X}})\) using a single function evaluation on \(X\left[k_{m}-1\right]\), \(X\left[k_{m}\right]\), and \(X\left[k_{m}+1\right]\). For many spectral audio applications, efficiency is important. This is especially true for real-time applications and applications based on processing huge data sets, e.g. MIR. For this reason, we focus on direct methods in particular. It is worth noting that as with most direct methods, the direct method presented in this article can be further refined into an interactive method using correction functions [20; 30]. A popular class of techniques, sometimes referred to as the _Quadratically-Interpolated FFT_ (QIFFT) in the literature [30; 31; 32; 33], is the subject of this article. Assuming that over a range of \(\pm 1\) bins around a peak bin \(k_{m}\) (i.e., between \(k_{m}-1\) and \(k_{m}+1\)), the underlying DTFT of a window transform is reasonably smooth, QIFFT methods fit a parabola to the magnitude spectrum and use the vertex of this parabola as a refined estimate of the true spectral peak. (Some other direct methods fit a predetermined parabola shape to the spectrum peak bin and its left and right neighbors, e.g., using least-squares regression [34].) Parabolic fitting in the QIFFT is done by writing the Lagrange interpolating polynomial [4; 35] that fits the three points \((k_{m}-1,\alpha)\), \((k_{m},\beta)\), and \((k_{m}+1,\gamma)\), rearranging it into the vertex form of a parabola \(\chi(\kappa)=a(\kappa-\hat{\mathcal{K}})^{2}+\hat{\mathcal{X}}\) with dummy bin index \(\kappa\), and then considering the vertex of the parabola \((\hat{\mathcal{K}},\hat{\mathcal{X}})\) to be an estimate of the sinusoidal parameters. In terms of \(k_{m}\), \(\alpha\), \(\beta\), and \(\gamma\), \((\hat{\mathcal{K}},\hat{\mathcal{X}})\) are:  
\[\hat{\mathcal{K}} =k_{m}+\frac{1}{2}\frac{\alpha-\gamma}{\alpha-2\beta+\gamma} \tag{11}\] \[\hat{\mathcal{X}} =\beta-\frac{1}{8}\frac{(\alpha-\gamma)^{2}}{\alpha-2\beta+ \gamma}\,. \tag{12}\]  
Since it is performed directly on the magnitude spectrum, we denote this technique the \"magnitude-spectrum QIFFT\" or _MQIFT_.