0
$\begingroup$

It is my understanding that for FFT (or DFT) returns a single amplitude per frequency bin. e.g., If the frequency bin size is 20Hz, the FFT tells us whether there are 0Hz, 20Hz, 40Hz,60Hz,...frequency components in the input signal, and if there is , the FFT also provides us the amplitudes at those frequencies.

Now suppose, the input signal has a frequency component at 50Hz, then my question is-

  • Is the amplitude of the 50Hz component going to show up in the third bin of the frequency spectrum? My guess is -yes.
  • If so, is the amplitude spike going to show up at 40Hz or 55z? My guess is that the spike is going to show at 40Hz since FFT returns amplitudes only at starting frequency of each bin. In that case, a.k.a. if the frequency component is in the middle of a bin, does FFT performs any averaging of the amplitude spike over the entire bin?
  • Suppose the input signal is a voltage signal and the amplitude of the 50Hz component is 100V(RMS), then if the frequency bin width is 20Hz, will I get an amplitude of 100V/20=5V at 40Hz?

Thank you for taking the time to answer.

$\endgroup$

2 Answers 2

1
$\begingroup$

What you are describing is called "spectral leakage". The energy of the 50 Hz will be distributed over ALL other frequency bins following the shape of a Dirichlet kernel https://en.wikipedia.org/wiki/Dirichlet_kernel. See picture below for a complex sine wave of 50Hz and a bin size of 20Hz.

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you, it is clear to me now. $\endgroup$
    – Bee16
    Commented Aug 10 at 13:19
2
$\begingroup$

As Hilmar mentioned, this is a phenomenon known as spectral leakage. The DFT is defined for all frequencies $[0,2\pi)$ that are periodic within $N$ samples. If the input signal is composed of frequencies that lie purely on the DFT sample points, then there will be no spectral leakage. This is because the DFT is an orthobasis expansion. If the signal is composed of frequencies that lie purely on the DFT sample points, then the signal is composed of the DFT basis functions, which will cancel out with all other non-matching basis functions when computing the DFT, and will add perfectly when matched with the correct basis function. If the signal is aperiodic within $N$ sample points, it is not composed of purely DFT basis functions, and will not add perfectly with any of the DFT basis functions, leaving residual values from the coherent summation in each DFT bin, known as leakage.

This is probably difficult to read, so I'll write out an example, but see more here on how the DFT is an orthobasis expansion. Let's let our signal be \begin{equation} x[n] = e^{j2\pi\frac{M}{N}n} \end{equation} where $N$, the number of sample points, is 3, and $M$ determines the digital frequency. For $M = 1$, i.e., our signal is purely composed of DFT basis functions, we get \begin{align} X[0] &= \sum_{n=0}^{2}e^{j2\pi\frac{n}{3}}e^{j0} = \sum_{n=0}^{2}e^{j2\pi\frac{n}{3}} = 0 \\ X[1] &= \sum_{n=0}^{2}e^{j2\pi\frac{n}{3}}e^{-j2\pi\frac{n}{3}} = \sum_{n=0}^{2}e^{j0} = 3 \\ X[2] &= \sum_{n=0}^{2}e^{j2\pi\frac{n}{3}}e^{-j2\pi\frac{2n}{3}} = \sum_{n=0}^{2}e^{-j2\pi\frac{n}{3}} = 0 \end{align}

Now let's let $M = 1.5$. Our signal is $e^{j2\pi\frac{1.5n}{3}} = e^{j\pi n}$. We then get \begin{align} X[0] &= \sum_{n=0}^{2}e^{j\pi n}e^{j0} = \sum_{n=0}^{2}e^{j\pi n} = 1 \\ X[1] &= \sum_{n=0}^{2}e^{j\pi n}e^{-j2\pi\frac{n}{3}} = \sum_{n=0}^{2}e^{j\frac{pi}{3}n} = 1 + j\sqrt{3} \\ X[2] &= \sum_{n=0}^{2}e^{j\pi n}e^{-j2\pi\frac{2n}{3}} = \sum_{n=0}^{2}e^{-j\frac{pi}{3}n} = 1 - j\sqrt{3} \end{align}

So, as we can see, when $M$ is an integer, making it composed of one of the DFT basis functions, there is no spectral leakage. However, if $M$ isn’t an integer, making $x[n]$ not purely composed of basis functions, there will be spectral leakage into all other frequency bins.

$\endgroup$
1
  • $\begingroup$ Thank you for the detailed explanation. $\endgroup$
    – Bee16
    Commented Aug 11 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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