I'm not too sure why we got side tracked into this curve fitting discussion, I thought the topic was zero padding.
I mentioned 3 techniques, they are all very closely related and I’d like to review how they tie together. I'll quote myself just to save retyping
Once we have fixed the number of time samples, there are three things discussed above that can increase the resolution in estimating a peak.
1 – Quadratic interpolation. The least computationally intensive and biggest bang for the computational buck. Also well suited to improve the output of one of the other methods.
2 – Zero-padding. More computationally intensive. Gives a higher resolution for all peaks on the whole spectrum. (Note).
3- Reconstruction of the DTFT. The most computationally intensive (in my implementation, anyway... I don't think this can be broken down into a simple convolution which could be processed by FFT multiplication). Gives unlimited ability to improve the resolution (Note).
Let's start with #3 (reconstruction) because it gives a very good framework to view the previous two.
Reconstruction of the DTFT provides a mapping from the discretely-spaced FFT results to a continuous DTFT function. That mapping again can be found for example equation 6.17 and 6.18 here:
It involves a sum of weighted, frequency-shifted continuous sinc functions. Each FFT point factors into one term. The complex value of the FFT is the weighting, the frequency of the FFT point figures into the frequency shift.
The peak of the continuous-frequency DTFT is the peak which is our best available estimate of the frequency of interest (assuming not two peaks in a bin in which case there is no technique that will separate them... I don't consider the inability to achieve the impossible as a disadvantage AND and as I showed above 1.000, 2.001, 3.007, 4.002... even where one of the peaks in the pattern is merged with another peak, we can usually recognize the pattern and the outliers better if we have the best available estimate of all the frequencies in our spectrum).
So the reconstruction provides this continous function and it’s peak the the most precise estimate we can possibly come up with. That is by my view the true best answer with available data, but it is computationally intensive. So we can try the other two approaches to try to get part way to the same answer. How does that work?
First start with zero padding. As we know, the FFT is simply samples of the DTFT at discrete intervals corresponding to the bin width. As we showed in previous discussion, the underlying DTFT is the same regardless of whether we zero pad or not. All we do with zero padding is get finer samples of that underlying DTFT function. With finer samples we will likely get closer to finding the true peak.
But zero padding is also a little bit compuationally intensive. And it has to be done before we do the FFT, not really suitable to be done when we’re poking around an FFT result. So that leads to the other approach: frequency interpolation (curve fitting as you called it).
In contrast to the other two techniques, I don’t know if any rigorous proof of the frequency interpolation techniques are available. I have my own intuitive fuzzy proof. It is that the sinc functions that we use to build the DTFT from are relatively smooth. Looking at zero crossings of the sinc to estimate it’s frequency content, the highest frequency posible occurs away from the center lobe where we see maximum rate of 180 degrees per bin-width. (By the way if we were looking at samples of a time function rather than samples of a frequency function, that would be the Nyquist frequency..... the idea that we can reconstruct the entire continuous DTFT from the discrete FFT points is analogous to the idea that we can reconstruct a time waveform from it’s samples if and only if the relation betwen sampling frequency and original waveform meets Nyquist limit). The fact that we build this final DTFT out of bandlimited sinusoids imposes a certain kind of smoothness on the resulting complex function and its’ real magnitude. It cannot vary too eratically between the known points, it is limited to varying at the rate of it’s components. This characteristic I believe is what helps the frequency interolation work.
The quadratic interpolation approach is to select the highest bin magnitude and one on each side. With three data points we can solve the A,B, C constants in a quadratic form: Y = A + B*f + C*f^2. Obviously we know dY/df = B + 2*C*F and so the maximum occurs where dY/df = 0 (f = -B/[2*C]). You can solve all the algebra ahead and you end up with a fairly simple result (I can provide the algebra/results if anyone wants). That solution is built into the vba of my spreadsheet along with some other stuff... you can graphically some results works on the first two tabs on left of the workbook... fill out the green input blocks with three frequencies spaced equally and three magnitudes (the center has to be the higest of the three).
Here is an empirical study of results of quadratic method (I’m not positive if it’s identical to the method I described):
I have done my own empircal study in the spreadsheet. I used a fixed sinusoid of varying frequencies from 74 to 79 sampled at interval of 0.0005sec as input to a 512-point FFT. Bin width is 1/(512*0.0005) ~ 3.9hz. The bin centers in the neighborhood are 74.2,
78.1, 82.0. Look at the first seven rows of the table in the summary tab which use nothing other than quadratic interpolation:
Tab / Freq / Estimate / Error / BinWidth / Fraction Of BinWidth
Trial74 74 74.05 0.05 3.90625 1.4%
Trial 75 75 74.83 0.17 3.90625 4.4%
Ttial 76 76 75.91 0.09 3.90625 2.4%
Trial 77 77 77.20 0.20 3.90625 5.2%
Trial 79.1 79.1 78.91 0.19 3.90625 5.0%
Trial76NW 76 75.35 0.65 3.90625 16.6%
Trial77NW 77 77.86 0.86 3.90625 21.9%
The accuracy of the first 5 trials in determining the frequency is 5% of the bin width. The accuracy of the last two is up to 22%, but we didn’t use a window (These last two don’t count in my book, we really should be using a window). It’s a pretty darned good improvement in precision (beyond just picking the highest bin) and it’s pretty cheap computationally. (If you want to go the other extreme and number crunch using the DTFT reconstruction, you can see the 77hz input sinusoid was estimated from FFT output to be 77.00001015).
The Entek E-monitor data base must use frequency interpolation (since they work from FFT magnitudes only, they cannot accomlish the other techniques). I don’t know exactly which technique they use, but I have reasons to suspect it’s pretty close to the quadratic method. For the user it is as simple as putting your cursor on the peak and pressing p.
I have been using that program to look at machinery spectra for probably an average of 10 hours per month for the last 12 years. Knowing the frequency is important to accomplish my job and I spend time studying the patterns to estimate how accurate they are (to how many decimal places are my harmonics exact multiples of the fundamental). I can say without hesitation that the Entek peak label feature is substantially better than just picking the highest bin center (exactly as we expect from my empirical study). I can also state my opinion that anyone assigned to do my job who didn’t use that tool based on vague unfounded fears or objections as expressed in this thread would be just plain misinformed. I have to say it that way to conviction that I feel about this subject. I definitely am not saying it that way to reflect on you, Greg. (I have learned a lot from you Greg and still am light-years away from knowing half the stuff you do about vibration).
How the three approaches tie together is that none of them accepts the false premise that the highest bin center is the best estimate and all of them move us in the direction of the same ideal best answer given available info.
=====================================
(2B)+(2B)' ?