15
$\begingroup$

I'm doing a research on the FFT method, and a term that always comes up is "frequency bin". From what I understand, this has something to do with the band created around the frequency of a given sinusoid, but I can't really figure out how. I also figured out how to go from a given bin to its related frequency, but still no intuition on what a frequency bin is.

$\endgroup$
8
$\begingroup$

A frequency bin is a segment $[f_l,f_h]$ of the frequency axis that "collect" the amplitude, magnitude or energy from a small range of frequencies, often resulting from a Fourier analysis. Due to data discretization (possibly due to sampling), it is generally not possible to assign a precise amplitude to every frequency on a real axis. The frequency bin can be derived for instance from the sampling frequency and the resolution of the Fourier transform. However, a portion of the computed amplitude may be attributed to frequencies of the actual signal that are not contained in the bin range. Terms associated to this phenomenon can be leakage, smearing, aliasing, windowing, and depend on the tools used to obtain these amplitude. An instance is demonstrated on the following figure: a pure sine is sampled, and analyzed through a rectangular window. Although one might expect a single peak, as one would obtain on the full continuous-time signal with a continuous Fourier transform, the peak is not precisely localized with an FFT, and leaks in the neighboring bins.

FFT of a pure sine

Very often, the segment $[f_l,f_h]$ is referred to as a single frequency, like the mid-frequency $\frac{f_l+f_h}{2}$ or the lowest frequency $f_l$, yet one should not forget it is an interval, not a single number. Classically, the frequency bins are even in size, non-overlapping, and cover the whole spectrum. On occasion, they can somehow overlap, be non-uniform, for instance when this term is used (rarely) for multirate filter banks.

Similar concepts can be found in probability bins.

$\endgroup$
8
$\begingroup$

It's simpler than you think. When we discretize frequencies, we get frequency bins. So, when you discretize your Fourier Transform: $$e^{-j\omega} \rightarrow e^{-j{2\pi k}/{N}}$$ Our continuous frequencies become $N$ discrete bins.

This is exactly why the following is true: $$n^{th}bin = n*\dfrac{sampleFreq}{num(DFT points)}$$ Note that the FFT represents frequencies 0 to sampleFreq Hz.

$\endgroup$
  • 5
    $\begingroup$ What frequencies does each bin then represent? eg if the formula above come up with 1,000hz for a bin (assume 1 hz wide), then does a bin represent 1000.000 to 1000.999, or is centred - eg 999.5 to 1000.5? $\endgroup$ – Roger Binns Jul 13 '17 at 17:20
  • 1
    $\begingroup$ Check the answer of this question stackoverflow.com/questions/10754549/…. Each bin is SAMPLE_RATE / NUM_POINTS (Hz) wide. And its the center of the bin so its range is half-bin before to half-bin after the center. Also check this en.wikipedia.org/wiki/Histogram, it has some explanation about the 'bin' term. $\endgroup$ – mortalis May 22 '18 at 10:59
5
$\begingroup$

An FFT is a method of computing a DFT. And a DFT is a transform of a finite length vector which produces the same finite number of results. However the range of frequencies of a sinusoid that can be windowed to a finite length in order be fed to an FFT is infinite. Thus, each result vector element of an FFT is predominately associated with a small segment of this frequency continuum, rather than a point (the FFT bin center frequency).

Sometimes the bins are idealized as fixed width rectangular filters. But the actual shape of each FFT result bin is not a rectangular bucket, but either Sinc shaped, or shaped like the transform of any non-rectangular window function that has optionally been applied. Note that these result bins can be wider in bulk than the distance between FFT bins, with tails (the stopband) that trail off around the full width of the result. These tails are sometimes referred to as "leakage".

$\endgroup$
  • $\begingroup$ I don't understand your 2nd paragraph. Please elaborate on the difference, if any, between a "frequency bin" and one of the array elements returned from an FFT. $\endgroup$ – user5108_Dan Nov 9 '15 at 22:14
  • $\begingroup$ An FFT result array element is a summary of the spectral contents of the associated bin. Also the correlation against the basis vector associated with that element. $\endgroup$ – hotpaw2 Nov 10 '15 at 0:22
  • $\begingroup$ Windowed pure sinusoids within a bin usually have a higher correlation against the basis vector than stuff outside (although this depends on the window applied). $\endgroup$ – hotpaw2 Nov 10 '15 at 0:30
0
$\begingroup$

Good info here.

From that and knowledge of sampled audio, the highest frequency in the bins cannot be more than half the samplerate (in Hz). Also, according to this stack conversation, 0 is the lowest bin frequency (a.k.a. the DC component). The first link also describes in depth about leakage and compensating for that.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.