1

I'm currently working with Fourier transforms and I notice that the output of an FFT usually has the dimensions (n_fft, ) where n_fft is the number of samples to consider in the FFT, though some implementations discard frequency bins above the Nyquist frequency. What I can't wrap my head around is why the frequency resolution is dependent on the number of samples considered in the FFT. Could someone please explain the intuition behind this please?

AlePouroullis
  • 333
  • 2
  • 12
  • 1
    The Fourier Transform is a an alternate representation of the signal, it contains all of the information in the signal. If you have N input samples, you need at least N numbers to fully describe the input. If the DFT would produce fewer than N numbers, you wouldn't be able to do an inverse transform and get the input signal back. – Cris Luengo May 26 '22 at 15:49
  • I’m voting to close this question because it is not about programming. https://dsp.stackexchange.com would be an appropriate place to ask this question (though it has already likely been asked there already, search first!) – Cris Luengo May 26 '22 at 15:50

1 Answers1

1

The DFT is a change of basis from the time domain to the frequency domain. As Cris put it, "If you have N input samples, you need at least N numbers to fully describe the input."

some implementations discard frequency bins above the Nyquist frequency.

Yes, that's right. When the input signal is real-valued, its spectrum is Hermitian symmetric. The components above the Nyquist frequency are complex-conjugates of lower frequencies, so it is common practice to use real-to-complex FFTs to skip explicitly computing and storing them. In other words, if you have N real-valued samples, you need N/2 complex numbers to represent them.

Pascal Getreuer
  • 2,906
  • 1
  • 5
  • 14