DSPRelated.com
Forums

Frequency resolution of FFT after windowing

Started by spaz July 26, 2006
spaz wrote:
> I guess I am confused. The frequency resolution I'm trying to get at is > the difference between two adjacent bins in the spectrum. I have heard > this also called the Fourier frequency. > > Suppose I have a signal at 1 MHz and another one at 1.024 kHz. If > everything is coherent, and I sample at 8.192 MHz, capture time domain > data with 1024 samples, fft, and then look at the spectrum, I have 512 > bins. Each one represents fres = fs/ns = 8 kHz, and see two signals which > I can easily resolve. There's one in bin #125 and one in bin #128. That's > what I call a correct spectrum. > > If I do the same thing, but window before the fft, and then look at the > spectrum, I still have 512 bins. But each bin does not represent 8 kHz, > because I messed with the time domain data before the fft. The signals > are still there in the frequency domain, but they are too close to each > other to easily resolve. So I think either this spectrum should either be > plotted with fewer bins or I have to to something else, like capture more > samples.
If everything is coherent, and the signal is composed on only bin frequency sinusoids, then you do not need a window to reduce smearing. If there are non-bin frequencies present, then plotting even more points (sinc interpolation) might help in resolving two nearby non-bin frequencies. Windowing might help if one frequency might be hidden within the aliased side-lobes of another. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
"spaz" <cmas@earthlink.net> wrote in message 
news:vbWdnRsjOZR4xFfZnZ2dnUVZ_vqdnZ2d@giganews.com...
> > >>"spaz" <cmas@earthlink.net> wrote in message >>news:rpWdnVXmcNMK9VrZnZ2dnUVZ_vKdnZ2d@giganews.com... >>> When I normally do a FFT, the frequency resolution = sampling >>> frequency/number of samples. >>> >>> When I use windowing (like BH4) to prevent smearing, this should > increase >>> the frequency resolution of the FFT, because of the convolution in the >>> frequency domain. I have seen tables which show the frequency > resolution >>> increases by a factor of 1.9 for a Blackman Harris window, so if the >>> frequency resolution was 100 Hz without windowing, it should now be > ~190 >>> Hz. >>> >>> 1) How can I calculate what this factor is, or what the new frequency >>> resolution is? >>> >>> 2) I can only do FFTs when the number of samples is a power of 2. So > if I >>> assume the 1.9 is correct, should I capture 1.9 x samples, and then >>> decimate by a factor of 1.9 (i.e. throw away 47% of the samples)? Is > this >>> the best or simplest way to obtain the correct spectrum? >>> >>> Can anyone refer me to a book or article which explains this? >> >>It's easy to confuse sampling interval with resolution because the sample > >>interval splits or "resolves" the signal into discrete points. >>However, the actual resolution is something else. >> >>How to determine? >> >>Compute the *continuous* Fourier Transform of the window you're using. >>If there's "no window" i.e. a continuous rectangular window then the FT > will >>be a sinc and you can ponder what resolution is implied by a sinc. >>If there's some other continuous window then you do the same thing. >> >>Now, if the data is time-sampled and you use the FFT then the frequency >>domain will be sampled and the underlying shape that you get above is >>obscured - but it's still there. >>Try doing an FFT of a sinusoid with exactly K+0.5 cycles in time. You > will >>see all the peaks of the sinc if the window is rectangular. >> >>No need to interpolate or decimate in this regard. But, there may be > other >>reasons. >> >>There is no "correct" spectrum *or* every spectrum that you compute is >>"correct" depending on how you view what you're doing and the associated > >>math... >> >>Fred >> >> >> > I guess I am confused. The frequency resolution I'm trying to get at is > the difference between two adjacent bins in the spectrum. I have heard > this also called the Fourier frequency. > > Suppose I have a signal at 1 MHz and another one at 1.024 kHz. If > everything is coherent, and I sample at 8.192 MHz, capture time domain > data with 1024 samples, fft, and then look at the spectrum, I have 512 > bins. Each one represents fres = fs/ns = 8 kHz, and see two signals which > I can easily resolve. There's one in bin #125 and one in bin #128. That's > what I call a correct spectrum. > > If I do the same thing, but window before the fft, and then look at the > spectrum, I still have 512 bins. But each bin does not represent 8 kHz, > because I messed with the time domain data before the fft. The signals > are still there in the frequency domain, but they are too close to each > other to easily resolve. So I think either this spectrum should either be > plotted with fewer bins or I have to to something else, like capture more > samples.
The "frequency resolution" you mention is the frequency interval between samples. It doesn't have to be very much related to the ability to separate frequencies. For example: If you zero-pad a time-domain sequence (so the time epoch is longer) you will get a smaller frequency interval but no better frequency resolution because the "window" remains the length of the original (presumably nonzero) data sequence. ... later on .... If you window before the fft you still have 512 (actually 1024) bins and each bin still represents 8iHz. That is, unless you changed the length of the time sequence. Windowing is generally weighting but not changing the length - so it has no affect on this. The reason the signals are "too close to each other to easily resolve is because: When you apply a window - that is, some shape on top of the rectangular window that's already there - you are generally doing it to reduce the spectral spreading sidelobe levels. This is done at the expense of the width of the spectral main lobe (of the FFT of the window). It gets wider than the sinc. If the main lobe extends to capture most of two sinusoids then the ability to resolve them is worsened. It is pretty much true that a rectangular window gives the narrowest main lobe and thus the best frequency to frequency resolution - albeit with higher sidelobes / more leakage into other frequencies. So, it's a trade between ability to separate closely adjacent signals and ability to see low level signals in the presence of strong signals (which affect many frequencies due to the window's sidlobes). Fred