Wednesday, April 24, 2013

Nice discussion on FFT bins and leakage :)

There are no brick wall filters.  Basically all digital filters have ripple in the stopband due to the basis in the sinc (sin(x)/x) function.  FFT's also have aliased ripple out past their 'stop' band; this is controlled with the windowing function used. The less the stopband ripple, the wider (in terms of bins) the passband is (for any given bin).  The reason this is so is due to the way discrete Fourier transforms (including the FFT) assume that the data being transformed is periodic; the problem occurs when the signal period doesn't end exactly on the DFT's boundaries.  The response of the default rectangular window for all frequencies except multiples of the FFT frequency (sampling rate divided by number of points) is the sinc function, and the ripple out of band (out of each bin's band) is 12dB down for the first sidelobe, and the sidelobes roll off at the leisurely rate of 6dB per octave.   This is the 'tail' you see on narrow spectral features in FFT's.

So, since there is spectral leakage from bin to bin, if you zero out the bins you don't want and do an inverse FFT, you will get spectral leakage from the bins you want into the frequencies whose bins you zeroed, and the leakage is defined by the window (which just happens to have the same shape as a filter kernel, but I digress).  Adding points on an FFT is basically the same thing as adding taps on a filter, both computationally (in terms of CPU load) and spectrally.

No comments:

Post a Comment