The time resolution of the STFT can be obtained by considering for

a
Dirac impulse:
Thus, the time resolution of the STFT is proportional to the effective
duration of the analysis window

. Similarly, to obtain the
frequency-resolution, we have to consider a complex sinusoid (a Dirac
impulse in the frequency domain):
So the frequency-resolution of the STFT is
proportional to the effective bandwidth of the analysis window

. Consequently, for the STFT, we have a
trade-off between time and
frequency resolutions: on one hand, a good time resolution requires a
short window

; on the other hand, a good frequency resolution
requires a narrow-band filter i.e. a long window

. But unfortunately,
these wishes can not be simultaneously granted. This limitation is a
consequence of the Heisenberg-Gabor inequality. Two instructive cases can
be considered:
- The first one corresponds to a perfect time resolution: the window
is chosen as a Dirac impulse:
the STFT is perfectly localized in time, but does not provide any frequency
resolution.
* Example: This can be computed easily using the Time-Frequency
Toolbox: we consider for
a linear frequency modulation with a gaussian
amplitude modulation (see fig. 3.5).
>> x=real(amgauss(128).*fmlin(128));
>> h=1;
>> tfrstft(x,1:128,128,h);
Figure 3.5:
Perfect time resolution with the STFT, but with no
frequency resolution : the window
is chosen as a Dirac impulse
 |
The signal is perfectly localized in time (a section for a given frequency
of the modulus of the STFT corresponds exactly to the modulus of the
signal), but the frequency resolution is null.
- The second is that of perfect frequency resolution, obtained with a
constant window
here the STFT reduces to the Fourier transform of
, and does not
provide any time resolution (see fig. 3.6).
>> h=ones(127,1);
>> tfrstft(x,1:128,128,h);
Figure 3.6:
Perfect frequency resolution with the STFT : the window
is chosen as a constant
 |
The result obtained for
is not exactly
, because the
window
has not an infinite duration. Thus, some side effects appear.
To illustrate the influence of the shape and length of the analysis
window
, we consider two transient signals having the same gaussian
amplitude and constant frequency, with different arrival times (using the
M-file atoms.m):
>> sig=atoms(128,[45,.25,32,1;85,.25,32,1]);
Here is the result obtained with a Hamming analysis window of 65points
(see fig.
3.7):
>> h=window(65,'hamming');
>> tfrstft(sig,1:128,128,h);
Figure 3.7:
Two gaussian atoms analyzed by the STFT using a
Hamming window
of 65points : it is difficult to discriminate the two
components in time
 |
The frequency resolution is very good, but it is almost impossible to
discriminate the two components in time. If we now consider a short Hamming
window of 17points (see fig.
3.8)
>> h=window(17,'hamming');
>> tfrstft(sig,1:128,128,h);
Figure 3.8:
Same gaussian atoms analyzed by the STFT using a
Hamming window
of 17points : frequency resolution is poorer, but the
two components can be easily distinguished
 |
the frequency resolution is poorer, but the time resolution is sufficiently
good to distinguish the two components. For more information on the choice
of the window, see [
Har78].
Eric Chassande-Mottin
2005-10-26