Starting with the 500Hz sine wave, you should observe that in the frequency domain there are two pulses, one at 500Hz, and one at the aliased frequency of 7500Hz. With the Fourier transform, a sine wave produced two impulses, i.e.
s(t) =
(1)
S(f) =
(2)
Since the signal is sampled in the time domain, it includes periodic repetitions of (14) spaced by the sampling rate of 8kHz. Thus, pulses are seen at 500Hz and at 8000Hz-500Hz=7500Hz from the first of these periodic repetitions.
The reason that the DFT has only discrete pulses in the
frequency domain, and not impulses of infinite height, is that
it is assumed that the signal being transformed is periodic with
a period equal to the length of the DFT (
where
is the sampling interval, and N is the number of
samples). For this case
and N = 64 when the DFT tool is first started, thus a
period of 8ms is assumed.
Now try changing the input signal to a unit pulse of length 4ms. You can now clearly see that the frequency domain consists of a number of discrete components. If you use your mouse to click on the frequency graph to magnify a section and move it along the scale you should see that most of the components are spaced by 250Hz, except for the very first two with a spacing of 125Hz. In reality, all of the frequency components are spaced by 125Hz, it is just that every second component has a value of 0, hence the apparent 250Hz spacing.
This spacing,
is defined by the reciprocal of the period just calculated
above, i.e.
(3)
You may wish to compare these transform with the 8ms segments of a 500Hz cosine wave and the pulse of 4ms duration in the Fourier transform tool to see how the waveform has been sampled in the DFT. If you examine the Fourier transform at multiples of 125Hz, you will find a correspondance between what is seen in the DFT frequency domain and the Fourier transform frequency domain. For the example of the 500Hz sinusoid/cosinusoid you can observe that all of the discrete frequencies that are multiples of 125Hz are zero, save for those at 500Hz and -500Hz. For the case of the unit pulse the non-zero values occur at 0Hz, and odd multiples of 125Hz only. Thus the DFT may be considered to be a sampled version of a Fourier transform that has been made periodic with a period of 8kHz in this example.
The spacing of the samples in the frequency domain has been
shown to be related to the sampling rate and number of samples
in equation (3). If we wished to reduce the frequency spacing,
then there are two options for doing so. The first is to
increase the sample
spacing by decreasing the sampling rate
fs. However this would move the
periodic repetitions in frequency closer together.
Alternatively the number of samples, N, can be increased
to reduce the frequency domain sample spacing. However, if only
the 64 samples shown are available, how can additional samples
be introduced. One method is to simply append 0 values to the
end of the data set, hence increasing the total number of
samples. This is termed zero padding. To see the effect of
this click on the checkbox in the tool.
Each frame of the animation shows the result of doubling the
total number of samples N by adding zeros to the end of
the original data sequence. It is clear that every doubling of
N results in a halving of
It should now be clear for the two signals that we have already
looked at that the DFT is strongly related to a sampled version
of the Fourier transform as mentioned previously.
You may ask why bother with zero padding. One answer is that it allows you to ascertain frequencies with more accuracy. Switch the input signal to a 333Hz sine wave. With the zero padding on you can, by zooming into the frequency domain plot, see that the peak of the two highest ``lobes'' lie at approximately -333Hz and 333Hz as expected. (Actually at this frequency spacing the highest pulses are at 336Hz and -336Hz). Now try this after switching zero padding off. You will find that the best estimate that can be made is that the frequency is around 375Hz. We will also find zero padding useful in explaining what happens with windowing.
It is also noticable in the non-zero padded version that not only are there non-zero values at 375Hz and 7625Hz (being the closest values to 333Hz and 7667Hz that are represented in the DFT), all of the other samples are non-zero. Compare this with the Fourier transform of a 333Hz cosine wave and you should see that it has been sampled not at the zero amplitude values of the frequency domain as the 500Hz sine wave was, but at non-zero amplitudes for all the samples spaced by 125Hz. This effect in the DFT is called leakage as the power of the sine wave ``leaks'' into other frequency bins. (A bin is simply a sample in the frequency domain, eg 375Hz is the fourth bin in the non-zero padded spectrum, and the 64th bin in the zero padded version).
You may wish to investigate at this stage what the zero padded versions of the other signals look like.
Now switch the source signal to the ``333Hz sine wave plus low power signal'' option. You should see that there is very little difference between this signal and the 333Hz sine wave by itself. Even with zero padding little clear difference can be observed. It is clear that if there were any noise on the signal being measured that no distinction could be made between the two.
Now select a window such as a Hamming window from the selection of options. You will see the time domain signal being altered and the frequency domain plot will change at the same time. If zero padding is not being applied the change in the time domain can be clearly seen that both ends of the signal sample are attenuated, while samples closer to the center are attenuated by progressively smaller amounts. In actual fact, each sample is being multiplied by a factor determined by a raised cosine equation such that
where w[i] is the scaling factor for the
sample. The difference in the frequency plot is obvious. The
low power signal of 1kHz can now be seen above the leakage of
the 333Hz signal.
To explain what is happening, switch the source signal to an 8ms duration unit pulse, making sure that zero padding is switched on. Switch between no windowing and the Hamming window and you will see how the frequency domain changes. Remembering that multiplication in time is equivalent to convolution in frequency, it should become apparent that the frequency transform of the window shape is being convolved with the impulses of the two sine wave signals. The first of these is the 333Hz signal, and the second can be seen to be at 1kHz once a Hamming window is applied.
In reality, any sampled signal that is transformed is implicitly being windowed by a rectangular window since only a limited number of samples are used. This is why leakage is such a problem. However by application of other window shapes, the frequency domain representation of the sampled signal can be modified to highlight certain features. Try other window shapes on the 8ms unit pulse and the mixture of sine waves to see what each window does to the frequency domain transform.
After using the DFT tool you should understand the following points:
| Up: EE4 page | Previous: Fourier Series to Fourier Transform |