1
$\begingroup$

I am experimenting a bit with FFT's. From what I have read the first bin of an FFT is called the DC bin -- that is it is the mean of the other components in the FFT. I have also read that it should be close to 0.

When I actually perform the FFT and take the absolute value, what I find is that the first element of this is always 0. This makes sense mathematically if you consider the definition of the DFT itself.

Is there a best practice to reconstructing this first DC bin?


So it seems that because I was making my test FFT with a sine wave as the transient signal, this is what caused the 0 valued first FFT bin. I changed it to a cosine and got a non-zero first element...And the same with any random data. I should have thought a bit first.

$\endgroup$
  • $\begingroup$ fft([1,1,1,1]) = [4,0,0,0] - far from being zero! The first bin is the DC which is the sum/average of the samples in time domain. It's zero if your signal is zero mean. Otherwise it's not. What do you mean by "reconstruct"? $\endgroup$ – Florian Jul 12 at 13:12
  • $\begingroup$ There is absolutely no reason for the DC bin to be close to 0. Can you cite your source ? $\endgroup$ – Hilmar Jul 12 at 15:46
1
$\begingroup$

FFT computes the DFT which is

$$X[k] = \sum_{n=0}^{N-1} x[n] e^{-j \frac{2\pi}{N} k n } $$

where $x[n]$ is a sequence of length $N$ defined in $0 \leq n \leq N-1$.

The DC bin is $X[0]$; for $k=0$

$$ X[0] = \sum_{n=0}^{N-1} x[n] $$

is the sum of all samples of the signal $x[n]$. It's not the average, but the average is obtained simply by dividing it by $N$.

$\endgroup$
  • $\begingroup$ Thanks for the answer. I peform my FFT via mathematica, and the very first element of the output of this is always 0 once I take the absolute value. Does this imply my FFT algorithm is making some strange normalisation? $\endgroup$ – Q.P. Jul 12 at 13:05
  • $\begingroup$ is the first element ( X[0] ) still zero even for the input signal x = [1,1,1,1,1] ? $\endgroup$ – Fat32 Jul 12 at 16:17
1
$\begingroup$

Depending on your normalization factor the DC bin is either the sum of the signal values in your frame (1), the average (1/N), a "representation" (1/sqr(N)),

In the DFT formula the exponential value is $e^0$, or 1, for each term.

$\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.