4
$\begingroup$

The frequency resolution of a DFT with a rectangular window of size $N$ is given by $f_s/N$. However, when using other window functions like a Hamming or Hanning window the resolution gets worse. How can I calculate the frequency resolution of a DFT when using a Hamming/Hanning window of size $N$?

I found some numbers regarding "effective noise bandwidth (ENBW)" but am not sure what exactly it means. The numbers were 1 for a rectangular window, 1.5 for Hanning and 1.37 for Hamming window. Does that mean the frequency resolution using a Hanning window is $1.5 \cdot f_s/N$?

$\endgroup$
3
  • 1
    $\begingroup$ You need to decide what you mean by "resolution." Taken literally, the resolution of a DFT would be the smallest spacing that you could have between two sinusoidal components and still be able to tell that there are two distinct tones. There's not necessarily a simple, broadly-applicable definition for this, as your requirements for resolving separate tones may vary by application. In a qualitative sense, a windowed DFT will have poorer resolution for two nearby tones. However, it can be vastly superior in resolving two tones far away from each other in frequency but at different power levels. $\endgroup$
    – Jason R
    Jul 14, 2015 at 15:18
  • $\begingroup$ I am calculating MFCCs out of a speech signal. A book states, that the resolution of my DFT needs to match the resolution of my filterbank. I want to implement a corresponding check in my program, since sampling frequency, DFT size and size of the filterbank are not fixed upfront. My understanding was, that the resolution of a DFT is the bandwidth of a single bin. $\endgroup$
    – sigy
    Jul 14, 2015 at 15:24
  • $\begingroup$ I am not able to comment due to lack of points, I would just comment on the discussion. From my point of view, the window type does influence the frequency resolution, and therefore the question is well defined. The equation that user16619 has displayed is, in my opinion, not the frequency resolution, however, it is the distance between the "frequency sticks" $\endgroup$
    – Rook
    Dec 30, 2018 at 14:13

3 Answers 3

5
$\begingroup$

The frequency resolution of a DFT is indeed significantly affected by the choice of window. Two key parameters to consider when selecting a window are the frequency resolution and dynamic range. The frequency resolution is the ability to discern two closely spaced frequencies at similar power levels (therefore a metric of what that spacing is would be the frequency resolution), while dynamic range is the ability to discern two signals at different frequencies and significantly different power levels; specifically the ability to see a low level signal in the presence of a much stronger signal (therefore a metric of what this power difference is would be the dynamic range). Typically a higher dynamic range is achieved by using appropriate windowing at the expense of frequency resolution. The highest frequency resolution that can be achieved is with a rectangular window (and the lowest loss; any other window will also introduce a processing loss).

The Equivalent Noise Bandwidth (ENBW) is a commonly used metric for frequency resolution. The ENBW is the bandwidth (often given in FFT bins) of a brickwall filter that would result in the same noise power as the DFT "filter" for white noise (the DFT can be described as a bank of filters). For the rectangular window, the ENBW is one bin, but the poorest dynamic range (sidelobes with peaks rolling off at a $1/f$ rate in magnitude. Any other windowing used would have a higher ENBW.

For a given length N window function $w[n]$, the ENBW in bins is computed as follows:

$$ENBW = N \frac{\sum \left(w[n]\right)^2 }{\left(\sum w[n] \right)^2}$$

See this classic paper by fred harris tabulating the ENBW as well as other paramters of many commonly used windows. fred harris windowing

Below is a slide I have further depicting the ENBW for a rectangular window:

ENBW

Below compares a N = 30 rectangular window (denoted the Dirichlet kernel) to a Blackman window of the same length. The decrease in level shown of -7.83 dB is the coherent gain for this particular window used. The coherent gain is simply the average of the window weights. The result below is is consistent with the coherent gain of 0.42 as listed for the Blackman window tabulated in the fred harris reference given; $20Log_{10}(0.42) = -7.54$ dB. What is very clear from this picture is the significant increase in both dynamic range and frequency resolution.

window comparison

The reason for not being an exact match to the tabulated results is the window length. As the window length approaches infinity the physical result approaches the tabulated, as shown in the figure below for coherent gain. For this reason caution must be applied when using the tabulated results for any smaller length windows.

dependence of window length

$\endgroup$
1
$\begingroup$

There is a physical frequency resolution that depends on the window coefficients (and therefore the window length, or number of samples). Of course, this also depends on the sampling rate .

There is also a computational frequency resolution, which depends on the sampling rate and the DFT or FFT order.

These are two independent resolutions. The physical frequency resolution is not the same as the computational frequency resolution.

$\endgroup$
1
  • 1
    $\begingroup$ I'd suggest not referring to "the above", since it's ambiguous. Also, since you're not providing an actual answer, but rather commenting on an existing one, this should probably be a comment. $\endgroup$
    – MBaz
    Mar 16, 2018 at 1:54
-5
$\begingroup$

The frequency resolution does not depend on the type of the window. It is the length that matters. The frequency resolution is

$\qquad\text{frequency resolution} = \displaystyle\frac{\text{sampling frequency}}{\text{window length}}.$

For example, say you have an audio signal with $f_{s} = 44100$ Hz. If the window length is $2\text{ s} = 2\cdot 44100 = 88200$ samples then the frequency resolution will be

$\qquad\displaystyle\frac{44100\text{ Hz}}{88200} = 0.5\text{ Hz}.$

Just to clarify, what I am describing here is the resolution of the DFT.

$\endgroup$
7
  • $\begingroup$ I have several sources stating that the window function used in fact does affect the frequency resolution. For example en.wikipedia.org/wiki/Window_function. Are they talking about another frequency resolution? $\endgroup$
    – sigy
    Jul 14, 2015 at 16:44
  • $\begingroup$ Please give a direct quote. $\endgroup$
    – user16619
    Jul 14, 2015 at 16:48
  • $\begingroup$ For example in the paragraph about the flat top window: "The drawback of the broad bandwidth is poor frequency resolution" $\endgroup$
    – sigy
    Jul 14, 2015 at 16:50
  • $\begingroup$ I guess the bandwidth just refers to the sampling frequency but I don't know really. Read the referenced papers. $\endgroup$
    – user16619
    Jul 14, 2015 at 17:08
  • $\begingroup$ -1 from me. with a fixed non-zero window length, choice of the window shape definitely affects the shape of the Fourier transform of the window and the frequency resolution, however it's defined, depends on the shape of the spectra of various windows. say, with a Kaiser window, given a fixed window length, you can trade off resolution with sidelobe suppression. if you don't mind some relatively big sidelobes, you can have pretty tight resolution. $\endgroup$ Jul 14, 2015 at 20:09

Your Answer

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

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