DFT PDF
DFT PDF
4365798
@BA
CGIH"PDQ D F E C A
We could regard each sample &' as an impulse having area R&S . Then, since the integrand exists only at the sample points:
T3657U8 8
@WVYX a C `bYc CGeHPfQ E d 10 VYX ghE CGiqp hE CGIHrcsp #$# # p &'hE CGIHtcsp # #$# rE CGeH Ca`bYc
ie.
43657u8
X v Ca` txwyi
&'hE CGIHtc
We could in principle evaluate this for any 5 , but with only data points to start with, only nal outputs will be signicant. You may remember that the continuous Fourier transform could be evaluated 0 over a nite interval (usually the fundamental period d ) rather than from to 82
if the waveform was periodic. Similarly, since there are only a nite number of input data points, the DFT treats the data as if it were periodic (i.e. to 10 0 ! r is the same as to r .) Hence the sequence shown below in Fig. 7.1(a) is considered to be one period of the periodic sequence in plot (b).
(a) 1 0.8 0.6 0.4 0.2 0
10
11
10
15
20
25
30
8
Since the operation treats the data as if it were periodic, we evaluate the ` DFT equation for the fundamental frequency (one cycle per sequence, X c Hz, X c rad/sec.) and its harmonics (not forgetting the d.c. component (or average) at 58 ). i.e. set 58 or, in general
!r
!"
!$#$# #
!"
$# #$#
!"
10
X v Ca`
8 ih
r
jkk kk kl
2 g 2 !" 2 0
. . .
m nn nn n o
jkk
8 lk
kk kk p
. . .
p pvq
pts p u
p q r p u r p w r
where p
m nn Ca` nn X C nn X C q n o X jkk kk kl
g !" 10
. . .
m nn nn n o
DFT example
Let the continuous signal be
10 8 6 4 2 0 2 4 0 1 2 3 4 5 6 7 8 9 10
Figure 7.2: Example signal for DFT. Let us sample at 4 times per second (ie. values of the discrete samples are given by:
. The
by putting 8r&'8
t s
i.e.
Therefore
% 8 0 3 3 0
jkkl 2
m nn kjlk g 2 2 o 8 " ! 2
15 |F[n]|
10
1 f (Hz)
X v Ca`
is
Note that the coefcients are complex. We can assume that the R&' values are real (this is the simplest case; there are situations (e.g. radar) in which two inputs, at each & , are treated as a complex pair, since they are the outputs from o and o demodulators). In the process of taking the inverse transform the terms and (reX member that the spectrum is symmetrical about ) combine to produce ! frequency components, only one of which is considered toX be valid (the one at the ; the higher frequency Hz where lower of the two frequencies, X B c component is at an aliasing frequency ( )).
2 0
and
2 0
(7.2)
2 0
%8
X v Ca` twyi
V X &'hE CGde C f bt
But
i.e.
2 0
C G t E
G de t 8E 6 G dg e f t E6
86
since
E G t 8
2 ! 2 ! " f &'%8 &' p6 d 2 8 , "8 2 R&' (i.e. sum of all samples) and the R&' is i ' & 8 X ` "8 average of &'8 d.c. compo f X c
Hz, of magnitude
i.e. a sampled sinewave at For the special case of 2 contribution of g to nent.
2 X #
Interpretation of example
1. 2.
2 2
g8r!6
` 2 g%8 i r 8 s
(as expected)
0 2 8 3 2 { 8 8 8r! X s
i.e.
! $
!"
&'
0 o 8t!u & ! 0
(as expected)
3.
!"%8r!
component
X 8
no other
(as expected)
Figure 7.4: DFT of four point signal. Thus, the conventional way of displaying a spectrum is not as shown in Fig. 7.3 but as shown in Fig. 7.4 (obviously, the information content is the same): In typical applications, is much greater than ; for example, for 8 2 0 0 ! , has ! components, but ! are the complex conjugates of 6 , i( ` to `fi ) `e` as complete a.c. comleaving `f ) i as the d.c. component, `fi ) ponents and frequency
` `fi s 8
` ) X .
s{
sq
Most computer programmes evaluate ) X (or )X for the power spectral den sity) which gives the correct shape for the spectrum, except for the values at X 8 and .
88
7.2.1 Aliasing
This is another manifestation of the phenomenon which we have now encountered several times. If the initial samples are not sufciently closely spaced to represent high-frequency components present in the underlying function, then the DFT values will be corrupted by aliasing. As before, the solution is either to increase the sampling rate (if possible) or to pre-lter the signal in order to minimise its highfrequency spectral content.
7.2.2 Leakage
Recall that the continuous Fourier transform of a periodic waveform requires the p or over an integer number integration to be performed over the interval - to of cycles of the waveform. If we attempt to complete the DFT over a non-integer number of cycles of the input signal, then we might expect the transform to be corrupted in some way. This is indeed the case, as will now be shown. Consider the case of an input signal which is a sinusoid with a fractional num X ber of cycles in the data samples. The DFT for this case (for 8 to 8 ) is shown below in 7.5.
8
6 |F[n]|
4 freq
Figure 7.5: Leakage. We might have expected the DFT to give an output at just the quantised frequen89
cies either side of the true frequency. This certainly does happen but we also nd non-zero outputs at all other frequencies. This smearing effect, which is known as leakage, arises because we are effectively calculating the Fourier series for the waveform in Fig. 7.6, which has major discontinuities, hence other frequency components.
1
0.5
0.5
10
15
20
25
30
35
40
45
50
Figure 7.6: Leakage. The repeating waveform has discontinuities. Most sequences of real data are much more complicated than the sinusoidal sequences that we have so far considered and so it will not be possible to avoid introducing discontinuities when using a nite number of points from the sequence in order to calculate the DFT. The solution is to use one of the window functions which we encountered in the design of FIR lters (e.g. the Hamming or Hanning windows). These window functions taper the samples towards zero values at both endpoints, and so there is no discontinuity (or very little, in the case of the Hanning window) with a hypothetical next period. Hence the leakage of spectral content away from its correct location is much reduced, as in Fig 7.7.
(a) 7 6 5 4 3 2 1 0 0 2 4 6 8 1 0 3 2 5 4 (b)
90
Re-writing
8 twyi
X v Ca`
&'hE CG de f t t
as
% 8 &'dp X f t txwyi
X v Ca`
it is easy to realise that the same values of p X f are calculated many times as the computation proceeds. Firstly, the integer product & repeats for different com t binations of & and ; secondly, p X f is a periodic function with only distinct values. For example, consider of 2)
8W
is an integral power
~ 8
91
pt s p p u pv
Also, if
0 8 0 p i 8 0 p ` 8 0 p 8 pv q p q 8t q 8 s q 8t q
&
falls outside the range 0-7, we still get one of the above values:
eg. if
8t
and &i8r
Let us begin by splitting the single summation over samples into 2 summations, X each with samples, one for & even and the other for & odd. t tCa ` for & odd and write: Substitute 8 for & even and 8
C G de f f V f b C G d e 8 E W p X t 8 E 8rp e f e a C ` v 2
Therefore
Thus the -point DFT can be obtained from two -point transforms, one on even input data, , and one on odd input data, . Although the fre X quency index ranges over values, only values of and need to be X computed since and are periodic in with period . For example, for
% 8t p p Xi
8W
: 92
2 2 2 2 2 2 2 2
p p i p p ` p p p pr q p pt s p p p p u p pv
d dRr"
i 0 p ` 0 p 0 p prq
g !"
F[7]
Figure 7.8: FFT ow graph 1. Assuming than is a power of ! , we can repeat the above process on the two X X -point transforms, breaking them down to -point transforms, etc #$#$# , until we s , only one further stage is needed come down to ! -point transforms. For 81 (i.e. there are stages, where 8!r ), as shown below in Fig 7.9. Thus the FFT is computed by dividing up, or decimating, the sample sequence &' into sub-sequences until only ! -point DFTs remain. Since it is the input, or time, samples which are divided up, this algorithm is known as the decimationin-time (DIT) algorithm. (An equivalent algorithm exists for which the output, or frequency, points are sub-divided the decimation-in-frequency algorithm.) The basic computation at the heart of the FFT is known as the buttery because of its criss-cross appearance. For the DIT FFT algorithm, the buttery computation is of the form of Fig 7.10 93
N/4 point DFT N/4 point DFT N/4 point DFT N/4 point DFT
F[0]
F[7]
p pBX p p X 0 p X 0 p X B
Figure 7.10: Buttery operation in FFT.
where and are complex numbers. Thus a buttery computation requires one complex multiplication and 2 complex additions. Note also, that the input samples are bit-reversed (see table below) because at each stage of decimation the sequence input samples is separated into even- and odd- indexed samples. (NB: the bit-reversal algorithm only applies if
is an integral power of ! ).
94
Index 0 1 2 3 4 5 6 7
(&
Binary Bit-reversed Bit-reversed representation Binary index 000 000 0 001 100 4 010 010 2 011 110 6 100 001 1 101 101 5 110 011 3 111 111 7
i because multiplications by factors such as p X , p X |e !f (approximately e p X and pX are really just complex additions and subtractions).
32 256 1,024
-point
1. take advantage of such factors as possesses. For example, if is divisi ble by (e.g. 8 ), the nal decimation stage would include a -point transform.
95
2. pack the data with zeroes; e.g. include 16 zeroes with the 48 data points (for 8v ) and compute a 6 -point FFT. (However, you should again be wary of abrupt transitions between the trailing (or leading) edge of the data and the following (or preceding) zeroes; a better approach might be to pack the data with more realistic dummy values).
96