The DFT is defined only for frequencies
. If we
are analyzing one or more periods of an exactly periodic signal, where the
period is exactly
samples (or some integer divisor of
), then these
really are the only frequencies present in the signal, and the spectrum is
actually zero everywhere but at
. However, we use the
DFT to analyze arbitrary signals from nature. What happens when a
frequency
is present in a signal
that is not one of the
DFT-sinusoid frequencies
?
To find out, let's project a length
segment of a sinusoid at an
arbitrary frequency
onto the
th DFT sinusoid:
The coefficient of projection is proportional to
using the closed-form expression for a geometric series sum. As previously
shown, the sum is
at
and zero at
, for
. However, the sum is nonzero at all other frequencies.
Since we are only looking at
samples, any sinusoidal segment can be
projected onto the
DFT sinusoids and be reconstructed exactly by a
linear combination of them. Another way to say this is that the DFT
sinusoids form a basis for
, so that any length
signal
whatsoever can be expressed as linear combination of them. Therefore, when
analyzing segments of recorded signals, we must interpret what we see
accordingly.
The typical way to think about this in practice is to consider the DFT operation as a digital filter.6.4 The frequency response of this filter is what we just computed,6.5 and its magnitude is
We see that
is sensitive to all frequencies between dc
and the sampling rate except the other DFT-sinusoid frequencies
for
. This is sometimes called spectral leakage
or cross-talk in the spectrum analysis. Again, there is no
error when the signal being analyzed is truly periodic and we can choose
to be exactly a period, or some multiple of a period. Normally,
however, this cannot be easily arranged, and spectral leakage can
be a problem.
Note that spectral leakage is not reduced by increasing
. It can be
thought of as being caused by abruptly truncating a sinusoid at the
beginning and/or end of the
-sample time window. Only the DFT sinusoids
are not cut off at the window boundaries. All other frequencies will
suffer some truncation distortion, and the spectral content of the abrupt
cut-off or turn-on transient can be viewed as the source of the sidelobes.
Remember that, as far as the DFT is concerned, the input signal
is
the same as its periodic extension. If we repeat
samples of a
sinusoid at frequency
, there will be a ``glitch''
every
samples since the signal is not periodic in
samples. This
glitch can be considered a source of new energy over the entire spectrum.
See Fig. 8.3 for an example waveform.
To reduce spectral leakage (cross-talk from far-away
frequencies), we typically use a
window
function, such as a
``raised cosine'' window, to taper the data record gracefully
to zero at both endpoints of the window. As a result of the smooth
tapering, the main lobe widens and the sidelobes
decrease in the DFT response. Using no window is better viewed as
using a rectangular window of length
, unless the signal is
exactly periodic in
samples. These topics are considered further
in Chapter 8.
Since the
th spectral sample
is properly regarded as
a measure of spectral amplitude over a range of frequencies,
nominally
to
, this range is sometimes called a
frequency bin
(as in a ``storage bin'' for spectral energy).
The frequency index
is called the bin number, and
can be regarded as the total energy in the
th
bin (see §7.4.9).
Similar remarks apply to samples of any continuous bandlimited
function; however, the term ``bin'' is only used in the frequency
domain, even though it could be assigned exactly the same meaning
mathematically in the time domain.
In the very special case of truly periodic signals
, for all
, the DFT may be regarded as
computing the Fourier series coefficients of
from one
period of its sampled representation
,
. The
period of
must be exactly
seconds for this to work. For the
details, see §E.3.