Professional Documents
Culture Documents
We could in principle evaluate this for any , 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 over a nite interval (usually the fundamental period ) rather than from to 82
# YcbaC YXV HeC r 01 $# # pstHIC h'& p # #$# psrIC h qC hg ` G E c G E c HG E p i G E d QP HG E feC YcaC YXW@ b` V
i w yxt
8 53 u764
ie.
SR&
We could regard each sample as an impulse having area integrand exists only at the sample points:
c t HG E IC h'&
8 53 U76T
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 is the same as to .) 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
Since the operation treats the data as if it were periodic, we evaluate the DFT equation for the fundamental frequency (one cycle per sequence, Hz, rad/sec.) and its harmonics (not forgetting the d.c. component (or average) at ).
or, in general
83
r
# # $# $
h i8
## # $$!
` aC v X
iywt 8 %
8 5
i.e. set
c X `
0 1
"!
"!
8
r
"!
r!
r
0 1
85 c X
!
s s 8 q
8 & 8 t 'r 8 r
to
n nn nn m
u p s tp p
q vp p p
"! g
o q C kl nn C kk nn aC ` jkk nnn m
X
n nn nn m
8 kkl kk kk jk
"! 2 g 2 2
. . .
. . .
. . .
0 1
at 4 times per second (ie. Let us sample values of the discrete samples are given by:
DFT example
where
10
dc
84 1Hz
5 6
by putting
7
10
. The
kl kk jkk
0 0
kl jk
nn m
3 3 0 ! o r o 0 8 o "! 3 3 6! 0 kl g kl n jk nn m jk n m
3 3 0 0
8 8 8 8 % t"! % t
, , ,
|F[n]|
i.e.
Therefore
10
15
20
85
` aC v X
iywt 8 % 2
f (Hz)
2 2 2 2 jkkl
8 o "! nn m g
is
Note that the coefcients are complex. We can assume that the 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). and (reIn the process of taking the inverse transform the terms member that the spectrum is symmetrical about ) combine to produce frequency components, only one of which is considered to be valid (the one at the Hz where ; the higher frequency lower of the two frequencies, component is at an aliasing frequency ( )).
(7.2)
But
8 %
i.e.
86
&
1 for all
f E t gde 6G 8 t d6G E e
i w yt
t C E G
8 %
8 b f C de C E t XV G
'&
For all
real
E t "4b f C YXV de G h
'&
of
and
0 2
'R&
0 2
p f h %'& f E 8 0 1 2 t gde G 2
` aC v X
0 2
c B
i yw f 8 f E t de G h 2 v %'R& ` aC X `
times the complex conjugate of the original (symmet-
0 2
&
X 8
s ! 8 r 8 8 3 { 8 2 0
2 2
s r8 i %g ` X 8 2
# X 2
c f X
8 t G E
ie.
or
Hz, of magnitude
above gives,
8 '&
Interpretation of example
g
1.
! 8 6rg
2.
8
2
i.e.
(as expected)
X 2
3.
! 8 r%"!
since
for all
no other
87
&
(as expected) (as expected)
8 & ti{h
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 , has components, but are the complex conjugates of , as the d.c. component, to as complete a.c. comleaving ponents and frequency as the cosine-only component at the highest distinguishable .
Most computer programmes evaluate (or for the power spectral density) which gives the correct shape for the spectrum, except for the values at and .
88
6 ! 0 8
qs i ) f` ` e`
X f )
{s f` ) i ` ! 0 X ) f
X ) `
8 s if` ` s i f )` ! ( i X
8
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 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 number of cycles in the data samples. The DFT for this case (for to ) 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
X 8
8
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
it is easy to realise that the same values of are calculated many times as the computation proceeds. Firstly, the integer product repeats for different combinations of and ; secondly, is a periodic function with only distinct values.
Then
91
~8
W8
is an integral power
say
iywxt 8 %
&
t fX p
t fX p
iywt 8
Re-writing
as
p t f X d'&
` aC v X
G E t f de C h'&
` aC v X
&
Note that
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 frequency index ranges over values, only values of and need to be computed since and are periodic in with period . For example, for :
i yw i yw p p 8 X p f e d p ! p f e dR! v % 2 v ` aC e ` aC e
ie.
92
p f b` V X d p !
p E f e r8 f d e C W8 b f V de C t8 f X p G E G
X
X iX p p t% 8 2
&
&
i yw i yw 8 % p X dR! 2 v p f v ` aC e ` aC e
` C 8 a t &
8 ri&
t8
eg. if
and
q t8 q s 8 q t8 q p
W8
&
8 t X
&
Also, if
falls outside the range 0-7, we still get one of the above values:
q vp p 0 0 ` p 0 i p 0
8 vp 8 u p 8 p 8 tp s
Figure 7.8: FFT ow graph 1. Assuming than is a power of , we can repeat the above process on the two -point transforms, breaking them down to -point transforms, etc , until we come down to -point transforms. For , only one further stage is needed (i.e. there are stages, where ), 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
## $$#
18 s X
"! g
q rp p 0 ` p 0 i p 0
N/4 point DFT N/4 point DFT N/4 point DFT N/4 point DFT
F[0]
F[7]
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.
94
X Bp 0 X p 0 X p p X Bp p
Figure 7.10: Buttery operation in FFT. is an integral power of ).
0 1 2 3 4 5 6 7
1. take advantage of such factors as possesses. For example, if is divisi), the nal decimation stage would include a -point ble by (e.g. transform.
95
32 256 1,024
X p iX p e
ff
D X
& ( e
Index
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
X X p p ! e f|
-point
2. pack the data with zeroes; e.g. include 16 zeroes with the 48 data points (for ) and compute a -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).
v8
96