DFT FFT Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

UNIT II

Discrete Fourier Transforms

INTRODUCTION :The DFT of a discrete-time signal x(n) is a finite duration discrete frequency
sequence. The DFT sequence is denoted by X(k). The DFT is obtained by sampling one period of the
Fourier transform X(W) of the signal x(n) at a finite number of frequency points. This sampling is
conventionally performed at N equally spaced points in the period 0 ≤w≤2w or at wk = 2πk/N;
0 ≤ k≤ N – 1. We can say that DFT is used for transforming discrete-time sequence x(n) of finite length
into discrete frequency sequence X(k) of finite length. The DFT is important for two reasons. First it
allows us to determine the frequency content of a signal, that is to perform spectral analysis. The
second application of the DFT is to perform filtering operation in the frequency domain. Let x(n) be a
discrete-time sequence with Fourier transform X(W), then the DFT of x(n) denoted by X(k) is defined
as

The DFT of x(n) is a sequence consisting of N samples of X(k). The DFT sequence starts at k = 0,
corresponding to w = 0, but does not include k = N corresponding to w = 2π (since the sample at w = 0
is same as the sample at w = 2 π). Generally, the DFT is defined as

EXAMPLE 2.1 (a) Find the 4-point DFT of x(n) = {1, –1, 2, –2} directly.
(b) Find the IDFT of X(k) = {4, 2, 0, 4} directly.

Solution:
(a) Given sequence is x(n) = {1, –1, 2, –2}. Here the DFT X(k) to be found is N =4-point
and length of the sequence L = 4. So no padding of zeros is required. We know that the DFT
{x(n)} is given by
EXAMPLE 2.2 (a) Find the 4-point DFT of x(n) = {1, –2, 3, 2}.
(b) Find the IDFT of X(k) = {1, 0, 1, 0}.
EXAMPLE 2.3 Compute the DFT of the 3-point sequence x(n) = {2, 1, 2}. Using the same sequence,
compute the 6-point DFT and compare the two DFTs.
To compute the 6-point DFT, convert the 3-point sequence x(n) into 6-point sequence by
padding with zeros.
MATRIX FORMULATION OF THE DFT AND IDFT
THE IDFT FROM THE MATRIX FORM

The matrix x may be expressed in terms of the inverse of WN as:

WN is called the IDFT matrix. We may also obtain x directly from the IDFT relation in matrix form,
where the change of index from n to k and the change in the sign of the exponent in e j(2􀀀/N)nk lead to
the conjugate transpose of WN. We then have

EXAMPLE 2.4 Find the DFT of the sequence x(n) = {1, 2, 1, 0}


Solution: The DFT X(k) of the given sequence x(n) = {1, 2, 1, 0} may be obtained by solving the
matrix product as follows. Here N = 4.

EXAMPLE 2.5 Find the DFT of x(n) = {1, –1, 2, –2}.


Solution: The DFT, X(k) of the given sequence x(n) = {1, –1, 2, –2} can be determined using matrix as
shown below.

EXAMPLE 2.6. Find the 4-point DFT of x(n) = {1, –2, 3, 2}.
Solution: Given x(n) = {1, –2, 3, 2}, the 4-point DFT{x(n)} = X(k) is determined using matrix as
shown below.
EXAMPLE 2.6 Find the IDFT of X(k)={4, –j2, 0, j2} using DFT.
Solution: Given X(k) = {4, –j2, 0, j2} _ X*(k) = {4, j2, 0, –j2}
The IDFT of X(k) is determined using matrix as shown below.
To find IDFT of X(k) first find X*(k), then find DFT of X*(k), then take conjugate of DFT {X*(k)} and
divide by N.

EXAMPLE 2.7Find the IDFT of X(k) = {4, 2, 0, 4} using DFT.


Solution: Given X(k) = {4, 2, 0, 4}
X*(k) = {4, 2, 0, 4}
The IDFT of X(k) is determined using matrix as shown below.
To find IDFT of X(k), first find X*(k), then find DFT of X*(k), then take conjugate of DFT {X*(k)} and
divide by N

EXAMPLE2.8 Find the IDFT of X(k) = {1, 0, 1, 0}.


Solution: Given X(k) = {1, 0, 1, 0}, the IDFT of X(k), i.e. x(n) is determined using matrix
as shown below.

PROPERTIES OF DFT

Like the Fourier and Z-transforms, the DFT has several important properties that are used to
process the finite duration sequences. Some of those properties are discussed as follows

Periodicity:
If a sequence x(n) is periodic with periodicity of N samples, then N-point DFT of the sequence, X(k) is
also periodic with periodicity of N samples.
Hence, if x(n) and X(k) are an N-point DFT pair, then
Linearity

DFT of Even and Odd Sequences


The DFT of an even sequence is purely real, and the DFT of an odd sequence is purely
imaginary. Therefore, DFT can be evaluated using cosine and sine transforms for even and
odd sequences respectively.

Time Reversal of the Sequence


The time reversal of an N-point sequence x(n) is obtained by wrapping the sequence x(n)
around the circle in the clockwise direction. It is denoted as x[(–n), mod N] and
Circular Frequency Shift
Complex Conjugate Property

DFT of Real Valued Sequences


Multiplication of Two Sequences

Circular Convolution of Two Sequences


Parseval’s Theorem

Parseval’s theorem says that the DFT is an energy-conserving transformation and allows us
to find the signal energy either from the signal or its spectrum. This implies that the sum of
squares of the signal samples is related to the sum of squares of the magnitude of the DFT
samples.

Circular Correlation
Linear Convolution using DFT

The DFT supports only circular convolution. When two numbers of N-point sequence are circularly
convolved, it produces another N-point sequence. For circular convolution, one of the sequence should
be periodically extended. Also the resultant sequence is periodic with period N. The linear convolution
of two sequences of length N1 and N2 produces an output sequence of length N1 + N2 – 1. To perform
linear convolution using DFT, both the sequences should be converted to N1 + N2 – 1 sequences by
padding with zeros. Then take N1 + N2 – 1-point DFT of both the sequences and determine the product
of their DFTs. The resultant sequence is given by the IDFT of the product of DFTs. [Actually the
response is given by the circular convolution of the N1 + N2 – 1 sequences]. Let x(n) be an N1-point
sequence and h(n) be an N2-point sequence. The linear convolution of x(n) and h(n) produces a
sequence y(n) of length N1 + N2 – 1. So pad x(n) with N2 – 1 zeros and h(n) with N1 – 1 zeros and make
both of them of length N1 + N2 – 1. Let X(k) be an N1 + N2 – 1-point DFT of x(n), and H(k) be an N1 +
N2 – 1-point DFT of h(n). Now, the sequence y(n) is given by the inverse DFT of the product X(k)
H(k).
y(n) = IDFT {X(k)H(k)}

This technique of convolving two finite duration sequences using DFT techniques is called fast
convolution. The convolution of two sequences by convolution sum formula. This technique of
convolving two finite duration sequences using DFT techniques is called fast convolution. The
convolution of two sequences by convolution sum formula.

Y(n)=∑∞
−∞ 𝑥(𝑘)ℎ(𝑛 − 𝑘)

is called direct convolution or slow convolution. The term fast is used because the DFT can be
evaluated rapidly and efficiently using any of a large class of algorithms called Fast Fourier Transform
(FFT). In a practical sense, the size of DFTs need not be restricted to N1 + N2 – 1-point transforms.
Any number L can be used for the transform size subject to the restriction L _ (N1 + N2 – 1). If
L > (N1 + N2 – 1), then y(n) will have zero valued samples at the end of the period.

EXAMPLE 2.1 Find the linear convolution of the sequences x(n) and h(n) using DFT.
x(n) = {1, 2}, h(n) = {2, 1}
Solution: Let y(n) be the linear convolution of x(n) and h(n). x(n) and h(n) are of length 2 each. So
the linear convolution of x(n) and h(n) will produce a 3 sample sequence (2 + 2 – 1 = 3). To avoid time
aliasing, we convert the 2 sample input sequences into 3 sample sequences by padding with zeros.

x(n) = {1, 2, 0} and h(n) = {2, 1, 0}

By the definition of N-point DFT, the 3-point DFT of x(n) is:


The sequence y(n) is obtained from IDFT of Y(k). By definition of IDFT,
___________ __ _______ _____
The linear convolution of x(n) = {1, 2} and h(n) = {2, 1} is obtained using the tabular
method as shown below.

From the above table, y(n) = {2, 1 + 4, 2} = {2, 5, 2}.

EXAMPLE 2.2 Find the linear convolution of the sequences x(n) and h(n) using DFT.
x(n) = {1, 0, 2}, h(n) = {1, 1}
Solution: Let y(n) be the linear convolution of x(n) and h(n). x(n) is of length 3 and h(n) is
of length 2. So the linear convolution of x(n) and h(n) will produce a 4-sample sequence
(3 + 2 – 1 = 4). To avoid time aliasing, we convert the 2-sample and 3-sample sequences
into 4-sample sequences by padding with zeros.
x(n) = {1, 0, 2, 0} and h(n) = {1, 1, 0, 0}
By the definition of N-point DFT, the 4-point DFT of x(n) is:
Therefore, the linear convolution of x(n) and h(n) is:
y(n) = x(n) * h(n) = {1, 1, 2, 2}

The linear convolution of x(n) = {1, 0, 2} and h(n) = {1, 1} is obtained using the tabular
method as shown below.

From the above table, y(n) = {1, 1, 2, 2}.

OVERLAP-ADD METHOD :

In overlap-add method, the longer sequence x(n) of length L is split into m number of smaller
sequences of length N equal to the size of the smaller sequence h(n). (If required zero padding may be
done to L so that L = mN). The linear convolution of each section (of length N) of longer sequence with
the smaller sequence of length N is performed. This gives an output sequence of length 2N – 1.
In t his method, the last N – 1 samples of each output sequence overlaps with the first N – 1
samples of next section. While combining the output sequences of the various sectioned convolutions,
the corresponding samples of overlapped regions are added and the samples of non-overlapped regions
are retained as such. If the linear convolution is to be performed by DFT (or FFT), since DFT supports
only circular convolution and not linear convolution directly, we have to pad each section of the longer
sequence (of length N) and also the smaller sequence (of length N) with N – 1 zeros before computing
the circular convolution of each section with the smaller sequence. The steps for this fast convolution
by overlap-add method are as follows:
Step 1: N – 1 zeros are padded at the end of the impulse response sequence h(n) which isof length N
and a sequence of length 2N – 1 is obtained. Then the 2N – 1 point FFT is performed and the output
values are stored.
Step 2: Split the data, i.e. x(n) into m blocks each of length N and pad N – 1 zeros to each block to
make them 2N – 1 sequence blocks and find the FFT of each block.
Step 3: The stored frequency response of the filter, i.e. the FFT output sequence obtained
in Step 1 is multiplied by the FFT output sequence of each of the selected block in
Step 2.
Step 4: A 2N – 1 point inverse FFT is performed on each product sequence obtained in Step 3.
Step 5: The first (N – 1) IFFT values obtained in Step 4 for each block, overlapped with the last N – 1
values of the previous block. Therefore, add the overlapping values and keep the non-overlapping
values as they are. The result is the linear convolution of x(n) and h(n).

OVERLAP-SAVE METHOD

In overlap-save method, the results of linear convolution of the various sections are obtained
using circular convolution. Let x(n) be a longer sequence of length L and h(n) be a smaller
sequence of length N. The regular convolution of sequences of length L and N has L + N – 1
samples. If L > N, we have to zero pad the second sequence h(n) to length L. So their linear
convolution will have 2L – 1 samples. Its first N – 1 samples are contaminated by

wraparound and the rest corresponds to the regular convolution. To understand this let L =
12 and N = 5. If we pad N by 7 zeros, their regular convolution has 23 (or 2L – 1) samples
with 7 trailing zeros (L – N = 7). For periodic convolution, 11 samples (L – 1 = 11) are
wrapped around. Since the last 7 (or L – N) are zeros only, first four samples (2L – 1) – (L)
– (L – N) = N – 1 = 5 – 1 = 4 of the periodic convolution are contaminated by wraparound.
This idea is the basis of overlap-save method. First, we add N – 1 leading zeros to the longer
sequence x(n) and section it into k overlapping (by N – 1) segments of length M. Typically
we choose M = 2N. Next, we zero pad h(n) (with trailing zeros) to length M, and find the periodic
convolution of h(n) with each section of x(n). Finally, we discard the first N – 1 (contaminated)
samples from each convolution and glue (concatenate) the results to give the required convolution.
Step 1: N zeros are padded at the end of the impulse response h(n) which is of length N and a sequence
of length M = 2N is obtained. Then the 2N point FFT is performed
and the output values are stored.
Step 2: A 2N point FFT on each selected data block is performed. Here each data block begins with the
last N – 1 values in the previous data block, except the first data
block which begins with N – 1 zeros.
Step 3: The stored frequency response of the filter, i.e. the FFT output sequence obtained in Step 1 is
multiplied by the FFT output sequence of each of the selected blocks
obtained in Step 2.
Step 4: A 2N point inverse FFT is performed on each of the product sequences obtained in
Step 3.
Step 5: The first N – 1 values from the output of each block are discarded and the remaining values are
stored. That gives the response y(n).
In either of the above two methods, the FFT of the shorter sequence need be found only once, stored,
and reused for all subsequent partial convolutions. Both methods allow online implementation if we
can tolerate a small processing delay that equals the time required for each section of the long sequence
to arrive at the processor

Fast Fourier Transform

2.2 INTRODUCTION
The N-point DFT of a sequence x(n) converts the time domain N-point sequence x(n) to a
frequency domain N-point sequence X(k). The direct computation of an N-point DFT requires
N x N complex multiplications and N(N – 1) complex additions. Many methods were
developed for reducing the number of calculations involved. The most popular of these is the
Fast Fourier Transform (FFT), a method developed by Cooley and Turkey. The FFT may be
defined as an algorithm (or a method) for computing the DFT efficiently (with reduced
number of calculations). The computational efficiency is achieved by adopting a divide and
conquer approach. This approach is based on the decomposition of an N-point DFT into
successively smaller DFTs and then combining them to give the total transform. Based on
this basic approach, a family of computational algorithms were developed and they are
collectively known as FFT algorithms. Basically there are two FFT algorithms; Decimation- in-
time (DIT) FFT algorithm and Decimation-in-frequency (DIF) FFT algorithm. In this chapter,
we discuss DIT FFT and DIF FFT algorithms and the computation of DFT by these methods.

FAST FOURIER TRANSFORM


The DFT of a sequence x(n) of length N is expressed by a complex-valued sequence X(k) as

N 1
X ( K )   x(n)e  j 2 nk / N , K  0,1, 2,....N  1 where
n 0

Let WN be the complex valued phase factor, which is an Nth root of unity given by

WN  e j 2 nk / N
Thus,

X(k) becomes,

N 1
X ( K )   x(n)WN nk , K  0,1, 2,....N  1
n 0

Similarly, IDFT is written as


N 1
x(n)   X ( K )WN  nk , n  0,1, 2,....N  1
n 0
From the above equations for X(k) and x(n), it is clear that for each value of k, the direct
computation of X(k) involves N complex multiplications (4N real multiplications) and N – 1
complex additions (4N – 2 real additions). Therefore, to compute all N values of DFT, N2
complex multiplications and N(N – 1) complex additions are required. In fact the DFT and
IDFT involve the same type of computations.
If x(n) is a complex-valued sequence, then the N-point DFT given in equation for X(k)
can be expressed as
X(k) = XR(k) + jXI(k)
The direct computation of the DFT needs 2N2 evaluations of trigonometric functions, 4N2
real multiplications and 4N(N – 1) real additions. Also this is primarily inefficient as it
cannot exploit the symmetry and periodicity properties of the phase factor WN, which are

Symmetry property WNk  N /2  WNK

Periodicity property WNk  N  WNK

FFT algorithm exploits the two symmetry properties and so is an efficient algorithm for DFT
computation.
By adopting a divide and conquer approach, a computationally efficient algorithm can
be developed. This approach depends on the decomposition of an N-point DFT into
successively smaller size DFTs. An N-point sequence, if N can be expressed as N = r1r2r3, ..., rm.
where r1 = r2 = r3 = ... = rm, then N = rm, can be decimated into r-point sequences. For each r-
point sequence, r-point DFT can be computed. Hence the DFT is of size r. The number r is
called the radix of the FFT algorithm and the number m indicates the number of stages in
computation. From the results of r-point DFT, the r2-point DFTs are computed. From the
results of r2-point DFTs, the r3-point DFTs are computed and so on, until we get rm-point
DFT. If r = 2, it is called radix-2 FFT.

DECIMATION IN TIME (DIT) RADIX-2 FFT


In Decimation in time (DIT) algorithm, the time domain sequence x(n) is decimated and
smaller point DFTs are computed and they are combined to get the result of N-point DFT.
In general, we can say that, in DIT algorithm the N-point DFT can be realized from
two numbers of N/2-point DFTs, the N/2-point DFT can be realized from two numbers of N/4-
point DFTs, and so on.
In DIT radix-2 FFT, the N-point time domain sequence is decimated into 2-point
sequences and the 2-point DFT for each decimated sequence is computed. From the results
of 2-point DFTs, the 4-point DFTs, from the results of 4-point DFTs, the 8-point DFTs and
so on are computed until we get N-point DFT.
For performing radix-2 FFT, the value of r should be such that, N = 2m. Here, the
decimation can be performed m times, where m = log2N. In direct computation of N-
point DFT, the total number of complex additions are N(N – 1) and the total number of complex
multiplications are N2. In radix-2 FFT, the total number of complex additions are reduced to N
log2N and the total number of complex multiplications are reduced to (N/2) log2N.
Let x(n) be an N-sample sequence, where N is a power of 2. Decimate or break this
sequence into two sequences f1(n) and f2(n) of length N/2, one composed of the even indexed
values of x(n) and the other of odd indexed values of x(n).

N
Given sequence x(n) : x(0), x(1), x(2),.....x(  1)....x( N  1)
2

Even indexed sequence f1 (n)  x(2n) : x(0), x(2), x(4),.......x( N  2)

Odd indexed sequence f 2 (n)  x(2n  1) : x(1), x(3), x(5),.......x( N 1)

We know that the transform X(k) of the N-point sequence x(n) is given by

N 1
X ( K )   x(n)WN nk , K  0,1, 2,....N  1
n 0
Breaking the sum into two parts, one for the even and one for the odd indexed values, gives
N /2 1 N 1
X (K )  n 0
x(n)WN nk  
n  N /2
x(n)WN nk , K  0,1, 2,....N  1.

N /2 1 N 1
X (K )  
n  even
x(n)WN nk  WN nk  x(n)W
n  odd
N
nk

When n is replaced by 2n, the even numbered samples are selected and when n is replaced by
2n + 1, the odd numbered samples are selected. Hence,
N /2 1 N /2 1
X (K )   x(2n)W
n 0
N
2 nk
  x(2n  1)W
n 0
N
(2 n 1) k

Rearranging each part of X(k) into (N/2)-point transforms using

2 nk
  j 2 
W 2 nk
N  (W )  e N 
2 nk
N  WNnk/2 and WN(2 n 1) k  (WNk )WNnk/2
 
We can write
N /2 1 N /2 1
X (K )  
n 0
f1 (n)WNnk/2  WN k n 0
f 2 (n)WNnk/2

By definition of DFT, the N/2-point DFT of f1(n) and f2(n) is given by


N /2 1 N /2 1
F1 ( K )  n 0
f1 (n)WNnk/2 & F2 ( K )  
n 0
f 2 (n)WNnk/2

X (k )  F1 ( K )  WN F2 ( K ),...k  0,1, 2,3,....N  1


k

The implementation of this equation for X(k) is shown in the following Figure . This first step in
the decomposition breaks the N-point transform into two (N/2)-point transforms and the k WN
provides the N-point combining algebra. The DFT of a sequence is periodic with period given by
the number of points of DFT. Hence, F1(k) and F2(k) will be periodic with period N/2.
F1 (k  N / 2)  F1 ( K ), &F2 (k  N / 2)  F2 ( K )
F1 (k  N / 2)  F1 ( K ), &F2 (k  N / 2)  F2 ( K )
( k  N /2)
In addition, the phase factor WN  (WNk )

Therefore, for k ≥ N/2, X(k) is given by


X ( K )  F1 (k  N / 2)  WN k F2 ( K  N / 2)

The implementation using the periodicity property is also shown in following Figure

Figure 2.1 Illustration of flow graph of the first stage DIT FFT algorithm for N = 8.

Having performed the decimation in time once, we can repeat the process for each of the
sequences f1(n) and f2(n). Thus f1(n) would result in two (N/4)-point sequences and f2(n) would
result in another two (N/4)-point sequences.

THE 8-POINT DFT USIKG RADIX-2 DIT FFT


The computation of 8-point DFT using radix-2 FFT involves three stages of computation.
Here N = 8 = 23, therefore, r = 2 and m = 3. The given 8-point sequence is decimated into
four 2-point sequences. For each 2-point sequence, the two point DFT is computed. From the
results of four 2-point DFTs, two 4-point DFTs are obtained and from the results of two 4-
point DFTs, the 8-point DFT is obtained.
Let the given 8-sample sequence x(n) be {x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)}.
The 8-samples should be decimated into sequences of two samples. Before decimation they
are arranged in bit reversed order as shown in Table 2.1.

Figure 2.4 Illustration of complete flow graph obtained by combining all the three stages for N = 8.

TABLE 2.1 Normal and bit reversed order for N = 8.

Normal order Bit reversed order


x(0) x(000) x(0) x(000)
x(1) x(001) x(4) x(100)
x(2) x(010) x(2) x(010)
x(3) x(011) x(6) x(110)
x(4) x(100) x(1) x(001)
x(5) x(101) x(5) x(101)
x(6) x(110) x(3) x(011)
x(7) x(111) x(7) x(111)

The x(n) in bit reversed order is decimated into 4 numbers of 2-point sequences as
shown below.
(i) x(0) and x(4)
(ii) x(2) and x(6)
(iii) x(1) and x(5)
(iv) x(3) and x(7)
Using the decimated sequences as input, the 8-point DFT is computed. Figure 7.5 shows the
three stages of computation of an 8-point DFT.
The computation of 8-point DFT of an 8-point sequence in detail is given below. The 8-
point sequence is decimated into 4-point sequences and 2-point sequences as shown below.
(a) (b) (c)
Figure 7.6 (a)–(c) Flow graphs for implementation of first, 2nd and 3rd stages of computation.

Butterfly Diagram
Observing the basic computations performed at each stage, we can arrive at the following
conclusions:
(i) In each computation, two complex numbers a and b are considered.
(ii) The complex number b is multiplied by a phase factor W kN.
(iii) The product bW kNis added to the complex number a to form a new complex number A.
(i) The product bW k N is subtracted from complex number a to form new complex
number B.
The above basic computation can be expressed by a signal flow graph shown in Figure 7.7.
The signal flow graph is also called butterfly diagram since it resembles a butterfly.

Figure 7.7 Basic butterfFy diagram or fFow graph of radix–2 DI† FF†.

The complete flow graph for 8-point DIT FFT considering periodicity drawn in a way
to remember easily is shown in Figure 7.8. In radix-2 FFT, N/2 butterflies per stage are
required to represent the computational process. In the butterfly diagram for 8-point DFT
shown in Figure 7.8, for symmetry, W 20 , W4 0 and W8 0 are shown on the graph eventhough they
are unity. The subscript 2 indicates that it is the first stage of computation. Similarly,
subscripts 4 and 8 indicate the second and third stages of computation.
Figure 7.8 †he signal flow graph or butterfly diagram for 8–point radix–2 DIT FFT.

DECIMATION IN FREQUENCY (DIF) RADIX-2 FFT


In decimation in frequency algorithm, the frequency domain sequence X(k) is decimated. In
this algorithm, the N-point time domain sequence is converted to two numbers of N/2-point

sequences. Then each N/2-point sequence is converted to two numbers of N/4-point


sequences. This process is continued until we get N/2 numbers of 2-point sequences. Finally,
the 2-point DFT of each 2-point sequence is computed. The 2-point DFTs of N/2 numbers of 2-
point sequences will give N-samples, which is the N-point DFT of the time domain sequence.
Here the equations for N/2-point sequences, N/4-point sequences, etc., are obtained by
decimation of frequency domain sequences. Hence this method is called DIF.
To derive the decimation-in-frequency form of the FFT algorithm for N, a power of 2,
we can first divide the given input sequence x(n) = {x(0), x(1), x(2), x(3), x(4), x(5), x(6),
x(7) into the first half and last half of the points so that its DFT X(k) is

N 1 N /2 1 N 1
X ( K )   x(n)WN nk   x(n)WN nk  WN nk  x(n)WN nk
n 0 n 0 n  N /2
N /2 1 N /2 1
  x(n)W
n 0
N
nk
 WN nk 
n  N /2
x(n  N / 2)WN ( n N /2) k

It is important to observe that while the above equation for X(k) contains two summations
over N/2-points, each of these summations is not an N/2-point DFT, since WNnk rather than
nk N/2
W

N /2 1 N /2 1
X (K )  
n 0
x(n)WN nk  WN ( N /2) k n 0
x(n  N / 2)WN nk
N /2 1
 N 
 n 0
 x ( n )WN
nk
 ( 1) nk
x ( n 
2
)WN nk 

N /2 1
 N  nk
 n 0
 x(n)  (1) x(n  2 )  WN
nk

Let us split X(k) into even and odd numbered samples. For even values of k, the X(k) can be
written as

N /2 1
 N 
X (2 K ) 
n 0
 x ( n )  ( 1) 2k
x ( n 
2
)WN 2 nk 

N /2 1
 N  nk
 n 0
 x(n)  x(n  2 )  WN

For odd values of k, the X(k) can be written as


N /2 1
 N (2 k 1) n 
X (2 K  1)   n 0
2 k 1
 x(n)  (1) x(n  2 )WN 
N /2 1
 N  nk
 n 0
 x(n)  x(n  2 )  WN WN /2
nk

The above equations for X(2k) and X(2k + 1) can be recognized as N/2-point DFTs. X(2k) is
the DFT of the sum of first half and last half of the input sequence, i.e. of
{x(n) + x(n + N/2)} and X(2k + 1) is the DFT of the product W Nn with the difference of first
n
half and last half of the input, i.e. of {x(n) x(n + N/2)}WN .
If we define new time domain sequences, u1(n) and u2(n) consisting of N/2-samples, such that

then the DFTs U1(k) = X(2k) and U2(k) = X(2k + 1) can be computed by first forming the
sequences u1(n) and u2(n), then computing the N/2-point DFTs of these two sequences to
obtain the even numbered output points and odd numbered output points respectively. The
procedure suggested above is illustrated in Figure 7.9 for the case of an 8-point sequence.

Figure 7.9 FFow graph of the DIF decomposition of an N–point DF† computation into two N/2–point
DF† computations N = 8.
Now each of the N/2-point frequency domain sequences, U1(k) and U2(k) can be decimated
into two numbers of N/4-point sequences and four numbers of new N/4-point sequences can be
obtained from them.
Let the new sequences be v11(n), v12(n), v21(n), v22(n). On similar lines as discussed
above, we can get

This process is continued till we get only 2-point sequences. The DFT of those 2-point
sequences is the DFT of x(n), i.e. X(k) in bit reversed order.
The third stage of computation for N = 8 is shown in Figure 7.11.
The entire process of decimation involves m stages of decimation where m = log2N.
The computation of the N-point DFT via the DIF FFT algorithm requires (N/2) log2N
complex multiplications and (N – 1) log2N complex additions (i.e. total number of
computations remains same in both DIF and DIT).

Observing the basic calculations, each stage involves N/2 butterflies of the type shown
in Figure 7.12.
The butterfly computation involves the following operations:
(i) In each computation two complex numbers a and b are considered.
(ii) The sum of the two complex numbers is computed which forms a new complex
number A.
(iii) Subtract the complex number b from a to get the term (a – b). The difference term
(a – b) is multiplied with the phase factor or twiddle factor W Nn to form a new
complex number B.

Figure 7.12 Basic butterfFy diagram for DIF FI†.

The signal flow graph or butterfly diagram of all the three stages together is shown in Figure
7.13.

TKE 8-POINT DFT USIKG RADIX-2 DIF FFT


The DIF computations for an 8-sample sequence are given below in detail.
Let x(n) = {x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)} be the given 8-sample sequence.
First stage of COMPUTATION
In the first stage of computation, two numbers of 4-point sequences u1(n) and u2(n) are
obtained from the given 8-point sequence x(n) as shown below.

Figure 7.13 SignaF fFow graph or butterfFy diagram for the 8–point radix–2 DIF FF† aFgorithm.

Seconb stage of CONPUTATION


In the second stage of computation, four numbers of 2-point sequences v11(n), v12(n) and
v21(n), v22(n) are obtained form the two 4-point sequences u1(n) and u2(n) obtained in stage
one
Thirb stage of CONPUTATION
In the third stage of computation, the 2-point DFTs of the 2-point sequences obtained in the
second stage . The computation of 2-point DFTs is done by the butterfly operation shown in
Figure 7.14(c).

Figure 7.14 (a)–(c) †he first, second and third stages of computation of 8–point DF† by Radix–2 DIF FF†.

CONPARISON of DlT (DECIMATION-IN-TINE) and DlF (DECINATION-IN-


FREQUENCY) ALGORITHMS
Difference between DIT and DIF
1. In DIT, the input is bit reversed while the output is in normal order. For DIF, the
reverse is true, i.e. the input is in normal order, while the output is bit reversed.
However, both DIT and DIF can go from normal to shuffled data or vice versa.
2. Considering the butterfly diagram, in DIT, the complex multiplication takes place
before the add subtract operation, while in DIF, the complex multiplication takes
place after the add subtract operation.
Similarities
1. Both algorithms require the same number of operations to compute DFT.
2. Both algorithms require bit reversal at some place during computation.

7.6.f Computation of IDFT through FFT

The term inside the square brackets in the above equation for x(n) is same as the DFT
computation of a sequence X*(k) and may be computed using any FFT algorithm. So we can
say that the IDFT of X(k) can be obtained by finding the DFT of X*(k), taking the conjugate
of that DFT and dividing by N. Hence, to compute the IDFT of X(k) the following procedure
can be followed
1. Take conjugate of X(k), i.e. determine X*(k).
2. Compute the N-point DFT of X*(k) using radix-2 FFT.
3. Take conjugate of the output sequence of FFT.
4. Divide the sequence obtained in step-3 by N.
The resultant sequence is x(n).Thus, a single FFT algorithm serves the evaluation of both direct and
inverse DFTs.

EXAMPLE 1 Draw the butterfly line diagram for 8-point FFT calculation and briefly explain.
Use decimation-in-time algorithm.
Solution: The butterfly line diagram for 8-point DIT FFT algorithm is shown in following
Figure
Solution: For 8-point DIT FFT
1. The input sequence x(n) = {x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)},
2. bit reversed order, of input as i.e. as xr(n) = {x(0), x(4), x(2), x(6), x(1), x(5), x(3), x(7)}.
Since N = 2m = 23, the 8-point DFT computation
3. Radix-2 FFT involves 3 stages of computation, each stage involving 4 butterflies. The output
X(k) will be in normal order.
4. In the first stage, four 2-point DFTs are computed. In the second stage they are combined
into two 4-point DFTs. In the third stage, the two 4-point DFTs are combined into one 8-
point DFT.
5. The 8-point FFT calculation requires 8 log28 = 24 complex additions and (8/2) log28 = 12
complex multiplications.
Figure : Butterfly Fine diagram for 8–point DIT FFT algorithm for N = 8.

EXAMPLE 2 Implement the decimation-in-frequency FFT algorithm of N-point DFT where


N = 8. Also explain the steps involved in this algorithm.
Solution: The 8-point radix-2 DIF FFT algorithm
1. It involves 3 stages of computation. The input to the first stage is the input time sequence
x(n) in normal order. The output of first stage is the input to the second stage and the
output of second stage is the input to the third stage. The output of third stage is the 8-
point DFT in bit reversed order.
2. In DIF algorithm, the frequency domain sequence X(k) is decimated.
3. In this algorithm, the N-point time domain sequence is converted to two numbers of N/2-
point sequences. Then each N/2-point sequence is converted to two numbers of N/4-point
sequences. Thus, we get 4 numbers of N/4, i.e. 2-point sequences.
4. Finally, the 2-point DFT of each 2-point sequence is computed. The 2-point DFTs of N/2
number of 2-point sequences will give N-samples which is the N-point DFT of the time
domain sequence. The implementation of the 8-point radix-2 DIF FFT algorithm is shown
in Figure 7.16.

Figure 7.16 Butterfly Fine diagram for 8–point radix–2 DIF FFT algorithm.
EXAMPLE 7.4 What is FFT? Calculate the number of multiplications needed in the calculation
of DFT using FFT algorithm with 32-point sequence.
Solution: The FFT, i.e. Fast Fourier transform is a method (or algorithm) for computing
the DFT with reduced number of calculations. The computational efficiency is achieved by
adopting a divide and conquer approach. This approach is based on the decomposition of an N-
point DFT into successively smaller DFTs. This basic approach leads to a family of efficient
computational algorithms known as FFT algorithms. Basically there are two FFT algorithms. (i)
DIT FFT algorithm and (ii) DIF FFT algorithm. If the length of the sequence N = 2 m, 2
indicates the radix and m indicates the number of stages in the computation. In radix-2 FFT, the
N-point sequence is decimated into two N/2-point sequences, each N/2-point sequence is
decimated into two N/4-point sequences and so on till we get two point sequences. The DFTs
of two point sequences are computed and DFTs of two 2-point sequences are combined into
DFT of one 4-point sequence, DFTs of two 4-point sequences are combined into DFT of one
8-point sequence and so on till we get the N-point DFT.
The number of multiplications needed in the computation of DFT using FFT algorithm
N 32
with N = 32-point sequence is = log N = log 25 = 80 .
2 2
2 2
The number of complex additions
= N log2 N = 32 log2 32 = 32 log2 25 = 160

EXAMPLE 7.5 Explain the inverse FFT algorithm to compute inverse DFT of a 8-point
DFT. Draw the flow graph for the same.
Solution: The IDFT of an 8-point sequence {X(k), k = 0, 1, 2, ..., 7} is defined as

The term inside the square brackets in the RHS of the above expression for x(n) is the 8- point DFT
of X *(k). Hence, in order to compute the IDFT of X(k) the following procedure can be followed:
1. Given X(k), take conjugate of X (k) i.e. determine X *(k).
2. Compute the DFT of X*(k) using radix-2 DIT or DIF FFT, [This gives 8x*(n)]

1. Take conjugate of output sequence of FFT. This gives 8x(n).


2. Divide the sequence obtained in step 3 by 8. The resultant sequence is x(n).
The flow graph for computation of N = 8-point IDFT using DIT FFT algorithm is
shown in Figure 7.18.
Figure 7.18 Computation of 8–point DF† of X*(k) by radix–2, DI† FF†.

From Figure 7.18, we get the 8-point DFT of X*(k) by DIT FFT as

8x*(n) = {8x* (0), 8x*(1), 8x* (2), 8x* (3), 8x*(4), 8x* (5), 8x* (6), 8x* (7)}
1
x(n) = {8x* (0), 8x* (1), 8x* (2), 8x* (3), 8x*(4), 8x* (5), 8x* (6), 8x* (7)}*
8

EXAMPLE 7.11 Compute the DFT of the sequence x(n) = {1, 0, 0, 0, 0, 0, 0, 0} (a) directly,
(b) by FFT.
Solution: (a) Direct computation of DFT
The given sequence is x(n) = {1, 0, 0, 0, 0, 0, 0, 0}. We have to compute 8-point DFT. So
N = 8.
N 1 2 N 1 7
DFT {x(n)} = X(k) = x(n) e  j Nnk = x(n) Wnk = x(n) Wnk
N 8
n 0 n 0 n 0
= x(0)W80 + x(1)W 18 + x(2)W 28 + x(3)W 3 8+ x(4) W 4 8+ x(5)W 5 +8 x(6)W 6 +8 x(7)W 7 8

= (1) (1) + (0) (W8 1) + (0)W8 2 + (0) W8 3 + (0)W8 4 + (0)W 85 + (0)W 68 + (0)W 78= 1
X(k) = 1 for all k
X(0) = 1, X(1) = 1, X(2) = 1, X(3) = 1, X(4) = 1, X(5) = 1, X(6) = 1, X(7) = 1
X(k) = {1, 1, 1, 1, 1, 1, 1, 1}
(b) Computation by FFT. Here N = 8 = 23
The computation of 8-point DFT of x(n) = {1, 0, 0, 0, 0, 0, 0, 0} by radix-2 DIT FFT
algorithm is shown in Figure 7.31. x(n) in bit reverse order is
xr(n) = {x(0), x(4), x(2), x(6), x(1), x(5), x(3), x(7)}
= {1, 0, 0, 0, 0, 0, 0, 0}
For DIT FFT input is in bit reversed order and output is in normal order.
From Figure 7.31, the 8-point DFT of the given x(n) is X(k) = {1, 1, 1, 1, 1, 1, 1, 1}

EXAMPLE 7.12 An 8-point sequence is given by x(n) = {2, 2, 2, 2, 1, 1, 1, 1}.


Compute the 8-point DFT of x(n) by
(a) Radix-2 DIT FFT algorithm
(b) Radix-2 DIF FFT algorithm
Also sketch the magnitude and phase spectrum.

Solution: (a) 8-point DFT by Radix-2 DIT FFT algorithm


The given sequence is x(n) = {x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)}
= {2, 2, 2, 2, 1, 1, 1, 1}
The given sequence in bit reversed order is
xr(n) = {x(0), x(4), x(2), x(6), x(1), x(5), x(3), x(7)}
= {2, 1, 2, 1, 2, 1, 2, 1}
For DIT FFT, the input is in bit reversed order and the output is in normal order. The
computation of 8-point DFT of x(n), i.e. X(k) by Radix-2 DIT FFT algorithm is shown in
Figure 7.32.
From Figure 7.32, we get the 8-point DFT of x(n) as
X(k) = {12, 1 j2.414, 0, 1 j0.414, 0, 1 + j0.414, 0, 1 + j2.414}

(b) 8-point DFT by radix-2 DIF FFT algorithm


For DIF FFT, the input is in normal order and the output is in bit reversed order. The
computation of DFT by radix-2 DIF FFT algorithm is shown in Figure 7.33.

Figure 7.33 Computation of 8–point DF† of x(n) by radix–2 DIF FF† aFgorithm.

From Figure 7.33, we observe that the 8-point DFT in bit reversed order is

Xr (k) = {X(0), X(4), X(2), X(6), X(1), X(5), X(3), X(7)}


= {12, 0, 0, 0, 1 j2.414, 1 + j0.414, 1 j0.414, 1 + j2.414}
The 8-point DFT in normal order is

X(k) = {X(0), X(1), X(2), X(3), X(4), X (5), X(6), X(7)}


= {12, 1 j2.414, 0, 1 j0.414, 0, 1 + j0.414, 0, 1 + j2.414}

Magnitude and Phase Spectrum


Each element of the sequence X(k) is a complex number and they are expressed in
rectangular coordinates. If they are converted to polar coordinates, then the magnitude and
phase of each element can be obtained.
The magnitude spectrum is the plot of the magnitude of each sample of X(k) as a
function of k. The phase spectrum is the plot of phase of each sample of X(k) as a function of k.
When N-point DFT is performed on a sequence x(n) then the DFT sequence X(k) will have a
periodicity of N. Hence, in this example, the magnitude and phase spectrum will have a
periodicity of 8 as shown below.
X(k) = {12, 1 j2.414, 0, 1 j0.414, 0, 1 + j0.414, 0, 1 + j2.414}
= {12 0 , 2.61 67 , 0 0 , 1.08 22 , 0 0 , 1.08 22 , 0 0 , 2.61 67 }
= {12 0, 2.61 0.37 , 0 0 , 1.08 0.12 , 0 0 , 1.08 0.12 , 0 0 , 2.61 0.37 }

X(k) = {12, 2.61, 0, 1.08, 0, 1.08, 0, 2.61}


X(k) = {0, 0.37 , 0, 0.12 , 0, 0.12 , 0, 0.37 }

The magnitude and phase spectrum are shown in Figures 7.34(a) and (b).

Figure 7.34 (a) Magnitude spectrum, (b) Phase spectrum.

EXAMPLE 7.13 Find the 8-point DFT by radix-2 DIT FFT algorithm.
x(n) = {2, 1, 2, 1, 2, 1, 2, 1}
Solution: The given sequence is x(n) = {x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)}

= {2, 1, 2, 1, 2, 1, 2, 1}
For DIT FFT computation, the input sequence must be in bit reversed order and the output
sequence will be in normal order.
x(n) in bit reverse order is
xr(n) = {x(0), x(4), x(2), x(6), x(1), x(5), x(3), x(7)}
= {2, 2, 2, 2, 1, 1, 1, 1}
The computation of 8-point DFT of x(n) by radix-2 DIT FFT algorithm is shown in Figure 7.35.
From Figure 7.35, we get the 8-point DFT of x(n) as X(k) = {12, 0, 0, 0, 4, 0, 0, 0}
Figure 7.35 Computation of 8–point DF† of x(n) by radix–2, DI† FF†.

EXAMPLE 7.14 Compute the DFT for the sequence x(n) = {1, 1, 1, 1, 1, 1, 1, 1}.
Solution: The given sequence is x(n) = {x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)}
= {1, 1, 1, 1, 1, 1, 1, 1}
The computation of 8-point DFT of x(n), i.e. X(k) by radix-2, DIT FFT algorithm is shown
in Figure 7.36.
The given sequence in bit reversed order is
xr(n) = {x(0), x(4), x(2), x(6), x(1), x(5), x(3), x(7)}
= {1, 1, 1, 1, 1, 1, 1, 1}
For DIT FFT, the input is in bit reversed order and output is in normal order.

Figure 7.36 Computation of 8–point DF† of x(n) by radix–2, DI† FF†.

From Figure 7.36, we get the 8-point DFT of x(n) as X(k) = {8, 0, 0, 0, 0, 0, 0, 0}.
EXAMPLE 7.15 Given a sequence x(n) = {1, 2, 3, 4, 4, 3, 2, 1}, determine X(k) using
DIT FFT algorithm.
Solution: The given sequence is x(n) = {x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)}
= {1, 2, 3, 4, 4, 3, 2, 1}
The computation of 8-point DFT of x(n), i.e. X(k) by radix-2, DIT FFT algorithm is shown
in Figure 7.37. For DIT FFT, the input is in bit reversed order and the output is in normal
order.
The given sequence in bit reverse order is
xr(n) = {x(0), x(4), x(2), x(6), x(1), x(5), x(3), x(7)} = {1, 4, 3, 2, 2, 3, 4, 1}

Figure 7.37 Computation of 8–point DF† of x(n) by radix–2, DI† FF†.

From Figure 7.37, we get the 8-point DFT of x(n) as


X(k) = {20, 5.828 j2.414, 0.172 j0.414, 0.172 + j0.414, 5.828 + j2.414}
0, 0, 0,

EXAMPLE 7.16 Given a sequence x(n) = {0, 1, 2, 3, 4, 5, 6, 7}, determine X(k) using
DIT FFT algorithm.
Solution: The given sequence is x(n) = {x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)}
= {0, 1, 2, 3, 4, 5, 6, 7}
The computation of 8-point DFT of x(n), i.e. X(k) by radix-2, DIT FFT algorithm is shown
in Figure 7.38. For DIT FFT, the input is in bit reversed order and output is in normal order.
The given sequence in bit reverse order is
xr(n) = {x(0), x(4), x(2), x(6), x(1), x(5), x(3), x(7)}
= {0, 4, 2, 6, 1, 5, 3, 7}
Figure 7.38 Computation of 8–point DF† of x(n) by radix–2, DI† FF†.

From Figure 7.38, we get the 8-point DFT of x(n) as


X(k) = {28, 4 + j9.656, 4+ 4+ 4 j1.656, 4 j4, j9.656}
j4, j1.656, 4, 4

EXAMPLE 7.18 Find the IDFT of the sequence


X(k) = {4, 1 j2.414, 0, 1 j0.414, 0, 1 + j0.414, 0, 1 + j2.414}
using DIF algorithm.
Solution: The IDFT x(n) of the given 8-point sequence X(k) can be obtained by finding
X*(k), the conjugate of X(k), finding the 8-point DFT of X*(k), using DIF algorithm to get
8x*(n), taking the conjugate of that to get 8x(n) and then dividing the result by 8 to get x(n).
For DIF algorithm, input X *(k) must be in normal order. The output will be in bit reversed
order for the given X(k).

X*(k) = {4, 1 + j2.414, 0, 1 + j0.414, 0, 1 j0.414, 0, j2.414}


1
The DFT of X*(k) using radix-2, DIF FFT algorithm is computed as shown in Figure 7.42.

Figure 7.42 Computation of 8–point DF† of X*(k) by radix–2 DIF FF†.

From the DIF FFT algorithm of Figure 7.42, we get


8x*r (n) = {8, 0, 8, 0, 8, 0, 8, 0}
8xr (n) = {8, 0, 8, 0, 8, 0, 8, 0}* = {8, 0, 8, 0, 8, 0, 8, 0}
1
x(n) = {8, 8, 8, 8, 0, 0, 0, 0} = {1, 1, 1, 1, 0, 0, 0, 0}
8
EXAMPLE 7.19 Compute the IDFT of the sequence

X(k) = {7, 0.707 j0.707, j, 0.707 j0.707, 1, 0.707 + j0.707, 0.707 + j0.707}
j,
using DIT algorithm.
Solution: The IDFT x(n) of the given sequence X(k) can be obtained by finding X*(k), the
conjugate of X(k), finding the 8-point DFT of X*(k) using radix-2 DIT FFT algorithm to get
8x*(n), taking the conjugate of that to get 8x(n) and then dividing by 8 to get x(n). For DIT
FFT, the input X*(k) must be in bit reverse order. The output 8x*(n) will be in normal order.
For the given X(k).

X* (k) = {7, 0.707 + j0.707, j, 0.707 + j0.707, 1, 0.707 j, 0.707 j0.707}


j0.707,
X*(k) in bit reverse order is
Xr (k) = {7, 1, j, j, 0.707 + j0.707, j0.707, 0.707 + j0.707, 0.707 j0.707}
0.707
The 8-point DFT of X*(k) using radix-2, DIT FFT algorithm is computed as shown in
Figure 7.43.

Figure 7.43 Computation of 8–point DF† of X*(k) by radix–2, DI† FF†.

From the DIT FFT algorithm of Figure 7.43, we have


8x*(n) = {8, 8, 8, 8, 8, 8, 8, 0}
8x(n) = {8, 8, 8, 8, 8, 8, 8, 0}
x(n) = {1, 1, 1, 1, 1, 1, 1, 0}

EXAMPLE 7.20 Compute the IDFT of the square wave sequence X(k) = {12, 0, 0, 0, 4, 0,
0, 0} using DIF algorithm.

Solution: The IDFT x(n) of the given sequence X(k) can be obtained by finding X*(k), the
conjugate of X(k), finding the 8-point DFT of X*(k) using DIF algorithm to get 8x*(n) taking
the conjugate of that to get 8x(n) and then dividing the result by 8 to get x(n). For DIF
algorithm, the input X*(k) must be in normal order and the output 8x*(n) will be in bit
reversed order.
For the given X(k)
X*(k) = {12, 0, 0, 0, 4, 0, 0, 0}
The 8-point DFT of X*(k) using radix-2, DIF FFT algorithm is computed as shown in Figure
7.44.

From Figure 7.44, we have

8 xr * (n) = {16, 16, 16, 16, 8, 8, 8, 8}

8xr (n) = {16, 16, 16, 16, 8, 8, 8, 8}* = {16, 16, 16, 16, 8, 8, 8, 8}
1
x(n) = {16, 8, 16, 8, 16, 8, 16, 8} = {2, 1, 2, 1, 2, 1, 2, 1}

You might also like