# Is the value of a frequency bin of a DFT-output the average of the 'real' frequency values within that bin's range?

I am wondering whether the value of a frequency bin with a certain resolution is the average of the fourier transform values of the 'real' frequencies within that bin's range.

Assume your continuous-time signal is a sinusoid at freqeuncy $$f_0$$. You then sample that signal, and use a rectangular window to select $$N$$ samples. Feed those $$N$$ samples to your DFT, and you will see non-zero values in the whole spectrum (unless in the special cases where $$f_0$$ is a multiple of $$f_s/N$$).

So you start with a signal whose energy is concentrated in a single frequency, and you end up with non-zero values in all DFT bins.

To understand what is happening:

1. Start with a continuous-time signal $$x_c(t)$$.
2. (Optionally) filter the signal to make it band-limited to $$f_s/2$$.
3. Sample the signal to get $$x[n] = x_c(n/f_s)$$.
4. At this point, the spectrum is given by the sampling theorem. You will have spectrum aliasing if the sampled signal was not band-limited in step 2.
5. Now apply a window of size M. The window type depends on your application (Rectangular (ugly), Hann, Hamming, Blackman, Flat top, etc.).
6. At this point, your spectrum is that of the sampled signal, but convolved with the window (depending on window size and type, you will get some energy spread to other frequencies). This spectrum is $$X_w(e^{j\theta})$$.
7. The DFT of the windowed signal will return samples of its spectrum, at frequencies $$Y[k] = X_w( e^{j 2\pi k/N})$$.
• Thanks for your answer. To clarify: Assume I have a 'perfect' sinusoid with frequency f0 and I sample the signal with a frequency that is high enough fullfilling Nyquist. However I only put N samples into the DFT resulting in a resolution of $f_S/N$. Then assuming a frequency bin happens to be centered around f0. Is this bins's value the average over the 'real' frequency values within this bin's range? Commented Aug 8, 2019 at 18:43

The frequency response of a single FFT bin (when using the default rectangular window) is that of a periodic Sinc or Dirichlet function. If using a non-rectangular window (Hann or Hamming, etc.) the frequency response of each FFT bin is that of the transform of the window applied before the FFT.

It's not the average of the signal energy within the bin width, because energy within the bin width, but not at the exact bin center frequency gets spread to (all) other FFT result bins, thus lessening its contribution to the closest FFT bin center.

• For a real frequency the bins don't follow a Sinc expression. You must be thinking of a complex exponential. Commented Aug 9, 2019 at 5:08
• So, a frequency bin is centered around an interesting frequency $f_0$. Assume the spectrum is such that there is no spectral leakage from other frequencies to that specific frequency $f_0$. Now. I center a frequency bin around $f_0$. The value of this bin is then the value of EXACTLY this frequency '$f_0$ and is not affected by frequencies that also lie in that bin's range. A frequency bin covers the value of its center frequency (+ eventual spectral leaks to that center frequency) ? Commented Aug 9, 2019 at 12:11
• Not only can there be "spectral leakage" into an FFT result bin. But energy leaks out of a bin for any signals that are not pure sinusoids which are exactly integer periodic in the entire FFT length (the energy "leaks" mostly into other adjacent FFT result bins). Commented Aug 9, 2019 at 16:12