# estimating peak frequency close to bin zero

Given a half complex spectrum (positive frequency bins from DC to Nyquist) as the result of a real FFT, to estimate the true (non integer) peak frequency I usually rely on Eric Jacobsen's estimator:

$$f=Re\bigg[\frac{Z_p-Z_n}{2Z-Z_p-Z_n}\bigg]$$

where $$Z$$ is the complex bin value at local maximum and $$Z_p$$, $$Z_n$$ are the previous and next bin values, and $$f$$ is the obtained fractional position. The problem is when a frequency peak is very close to frequency 0, then we have two cases:

1. When the peak is at bin 1, the estimator starts losing precision.

2. .When the peak is at bin 0 as in case of, say, a frequency peak of 0.2 in bin units, the estimator cannot be used because there is not any previous bin $$Z_p$$. This of course happens because the left portion of the peak body gets reflected back as conjugate, and the closer you get to bin zero, the more radical is the influence of the reflected portion tricking the estimator, which would otherwise work well with an analytic spectrum devoid of reflections.

How can I reliably estimate the peak frequency when the peak is at bin 1 or worst at bin zero ?

• Could you make the FFT size larger so that the peak isn't at bin 1? – Engineer Feb 21 at 21:23
• Of course not Engineer. I am working in a STFT framework and I cannot decide to change the fft size everytime I get a peak at bin 1 or 0. – elena Feb 22 at 15:14
• If the local max is not at bin 0 or 1 then use your estimator, and otherwise you could do a fine search using a larger FFT size. The idea of coarse and fine searches is pretty common I think – Engineer Feb 22 at 15:46
• What is this the peak frequency of, the STFT window? and what do you intend to do with the quantity? "1" is often the truest value there is. – OverLordGoldDragon Feb 23 at 9:32