DFT Vs FFT PDF
DFT Vs FFT PDF
DFT Vs FFT PDF
Introduction
Example Waveform
To illustrate the difference between the DFT and FFT techniques, consider the following
example waveform which consists of a 120Hz fundamental component with a magnitude
of 170V, and a 5th harmonic at 30% of the magnitude of the fundamental (51V).
Figure 1
Let us assume that we are sampling the waveform in figure 1 at 100kHz, and that these
samples will be analyzed using Fourier Analysis.
Fourier Analysis
The principle of Fourier Analysis is to ‘test’ for the presence of each frequency
component by multiplying the waveform, f(t), by a sine and cosine waveform of the same
test frequency and average the results over one or more cycles of the test frequency.
For example:
2π
a (n) = 2 ∫ f (t ) x sin( nωt ) in phase component
0
2π
b(n) = 2 ∫ f (t ) x cos(nωt ) quadrature component
0
Figure 2
1
m( n) = ( a ( n) 2 + b( n) 2 ) 2
Figure 3
In the case of digital Fourier Analysis, the sample waveform is multiplied by numbers
representing the sample of the test sine and cosine waveforms.
DFT
In the case of the DFT analysis used by Voltech, the first step is to determine the
fundamental frequency of the waveform to be analyzed.
The result of this is to produce results that very accurately reflect the magnitude of each
of the actual components in the waveform.
e.g.
Figure 4
The disadvantage of the DFT technique is that it requires each harmonic to be calculated
separately, which requires much more processing power. However, if that processing
power is available, then the DFT provides very accurate answers.
FFT
The FFT, or Fast Fourier Transform is a method of calculating harmonics not one at a
time, but as a group, using a special algorithm. The FFT requires much less processing
power than a DFT for the same number of harmonic results. An FFT however, requires
that the number of samples being analyzed to be a binary number e.g. a power of two.
In our example, the nearest binary number of samples to a whole cycle of the sampled
waveform is 1024. The number of samples represents a window of 1.228 cycles
(1024/833.3) of our waveform. This results in a base ‘test’ waveform frequency of
97.66Hz. In other words , the FFT analysis multiplies the waveform by sine and cosine
waves that do not match one cycle of the waveform. This is shown in figure 5 below.
Figure 6
This effect is well understood, and is often referred to ‘spectral leakage’ i.e. data shows
up in the wrong frequency. Various methods have evolved to improve the results, such as
applying a ‘window’. On of the more common windows is the Hanning window. The
Hanning window is applied to the base data by multiplying the Hanning value by the
sampled value. The Fourier Transform is calculated on resultant data. Since the Hanning
window has a value of zero and the beginning and end, the window helps reduce the
effects of the discontinuity between the sampled waveform and the test waveform. The
affects of applying a Hanning window are showed in figure 6 above. At best, this will
improve values for certain frequencies, and worsen the results for others. Figure 7 below
shows the equation for the Hanning Window, along with its shape.
2π n
w(n) Hanning = 1
2
[Cos ( )] n = 0,1,2,...N-1
N
where N is the number of samples being analyzed
Figure 7
Other types of windowing include Hamming, Blackman and Flat Top. Each windowing
method has its advantages and disadvantages, so the choice of window used can often
dramatically affect the results obtained.
As their name implies, Fast Fourier Transforms are faster than Discrete Fourier
Transforms. But how much faster are they, and does this have an implication in the
analysis of power?
The figures given above show an indication of the performance difference between a
DFT and an FFT in a real-world situation. In today’s world of high performance DSPs, it
is relatively straight forward to compute the desired number of harmonics in a timely
manner using a DFT, and retain the advantage of the precision provided by using a DFT.
Also, although the FFT is significantly faster that a DFT, in practical power applications,
where only a limited number of harmonics are required, more accurate DFT calculation
can be carried out in real-time, so there is no need to sacrifice performance for speed.
For these reasons, the IEC, after a lengthy consideration of the FFT technique versus the
DFT technique, concluded that the DFT is the superior technology for analyzing current
harmonics in power waveforms, and has now embodied the requirement for DFT analysis
in the latest version of IEC 61000-4-7: Testing and Measurement Techniques, which is
specified in IEC 61000-3-2: Limits for harmonics current emissions.