0% found this document useful (0 votes)
28 views40 pages

DSP Module 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views40 pages

DSP Module 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

MODULE - II

Linear filtering methods based on the DFT: Use of DFT in Linear Filtering, Filtering
of Long data Sequences. Fast-Fourier-Transform (FFT) algorithms: Efficient Computation of
the DFT: Radix-2 FFT algorithms for the computation of DFT and IDFT-decimation-in-time
and decimation-in-frequency algorithms.

2.1 Introduction
Linear filtering is one of the most powerful image enhancement methods. It is a process
in which part of the signal frequency spectrum is modified by the transfer function of the
filter. Linear filtering of a signal can be seen as a controlled scaling of the signal components
in the frequency domain. DFT provides an alternative approach to time domain convolution.
It can be used to perform linear filtering in frequency domain. The advantage is that, having
knowledge of faster DFT techniques likes of FFT, a computationally higher efficient algorithm
can be developed for digital computer computation in comparison with time domain approach.

2.2 Use of DFT in Linear Filtering


Since the DFT provides a discrete frequency representation of a finite-duration sequence
in the frequency domain, it is interesting to explore its use as a computational tool for linear
system analysis and, especially, for linear filtering. Suppose that we have a finite-duration
sequence x(n) of length L which excites an FIR filter of length M . Without loss of generality,
let,
x(n) = 0, n < 0 and n ≥ L
h(n) = 0, n < 0 and n ≥ M

where h(n) is the impulse response of the FIR filter. The output sequence y(n) of the FIR
filter can be expressed in the time domain as the convolution of x(n) and h(n), that is

M
X −1
y(n) = h(k)x(n − k)
k=0

37
38 Module-2

Since h(n) and x(n) are finite-duration sequences, their convolution is also finite in duration.
In fact, the duration of y(n) is L + M − 1. The frequency-domain equivalent is

Y (ω) = X(ω)H(ω)

If the sequence y(n) is to be represented uniquely in the frequency domain by samples of its
spectrum Y (w) at a set of discrete frequencies, the number of distinct samples must equal or
exceed (L + M − 1). Therefore, a DFT of size N ≥ L + M − 1 is required to represent y(n)
in the frequency domain. Now if,

Y (k) = Y (ω)|ω=2πk/N ; k = 0, 1, . . . , N − 1
= X(ω)H(ω)|ω=2πk/N ; k = 0, 1, . . . , N − 1

then,
Y (k) = X(k)H(k); k = 0, 1, . . . , N − 1

The DFT provides an efficient way to calculate the time-domain convolution of two signals.
One of the most important applications of the DFT is calculating the time-domain convolution
of signals. This can be achieved by multiplying the DFT representation of the two signals
and then calculating the inverse DFT of the result as shown in Fig. 2.1.

x(n) M-1 zeros N-point


length L padding DFT
y(n)
N-point N-point
length
DFT IDFT
N=L+M-1
h(n) L-1 zeros N-point
length M padding DFT

Fig. 2.1. Linear convolution of x(n) and h(n) in frequency domain.

Example 2.1: Given x(n) = {1, 2, 3, 4} and h(n) = {1, 2, 2} compute


i) circular convolution
ii) linear convolution
iii) linear convolution using circular convolution.
Digital Signal Processing 39

 Solution: Given x(n) = {1, 2, 3, 4} and h(n) = {1, 2, 2}


()i) Circular convolution

1 4 3 2 1 15
2 1 4 3 2 12
y(n) = x(n) ⊗4 h(n) = =
3 2 1 4 2 8
4 3 2 1 0 14

y(n) = x(n) ⊗4 h(n) = {15, 12, 8, 14}

(ii) Linear convolution


x(n) 1 2 3 4
h(n) 1 2 2
2 4 6 8
2 4 6 8
1 2 3 4
1 4 9 14 14 8

y(n) = x(n) ∗ h(n) = {1, 4, 9, 14, 14, 8}

(iii) Linear convolution using circular convolution

• x(n) = {1, 2, 3, 4} ; length of x(n) is M = 4.

• h(n) = {1, 2, 2}; length of h(n) is N = 3.

• y(n) = x(n) ∗ h(n) will have a length of (M + N − 1) = 4 + 3 − 1 = 6. Padding zeros,

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

1 0 0 4 3 2 1 1
2 1 0 0 4 3 2 4
3 2 1 0 0 4 2 9
y(n) = x(n) ⊗6 h(n) = =
4 3 2 1 0 0 0 14
0 4 3 2 1 0 0 14
0 0 4 3 2 1 0 8

y(n) = x(n) ∗ h(n) = {1, 4, 9, 14, 14, 8}


40 Module-2

Example 2.2: Obtain linear convolution using circular convolution. Also, verify the result.
x(n) = {1, 1, 0, −1, −1} and h(n) = {1, 2, 3, 2, 1}.

 Solution: Given, x(n) = {1, 1, 0, −1, −1} and h(n) = {1, 2, 3, 2, 1}

• x(n) = {1, 1, 0, −1, −1} ; length of x(n) is M = 5.

• h(n) = {1, 2, 3, 2, 1}; length of h(n) is N = 5.

• y(n) = x(n) ∗ h(n) will have a length of (M + N − 1) = 5 + 5 − 1 = 9. Padding zeros,

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

1 0 0 0 0 1 2 3 2 1 1
2 1 0 0 0 0 1 2 3 1 3
3 2 1 0 0 0 0 1 2 0 5
2 3 2 1 0 0 0 0 1 −1 4
y(n) = h(n) ⊗9 x(n) = 1 2 3 2 1 0 0 0 0 −1 = 0
0 1 2 3 2 1 0 0 0 0 −4
0 0 1 2 3 2 1 0 0 0 −5
0 0 0 1 2 3 2 1 0 0 −3
0 0 0 0 1 2 3 2 1 0 −1

y(n) = {1, 3, 5, 4, 0, −4, −5, −3, −1}


Verification:
x(n) 1 1 0 −1 −1
h(n) 1 2 3 2 1
1 1 0 −1 −1
2 2 0 −2 −2
3 3 0 −3 −3
2 2 0 −2 −2
1 1 0 −1 −1
1 3 5 4 0 −4 −5 −3 −1

Example 2.3: An FIR filter has the impulse response, h(n) = {1, 2, 3}. Determine the
response of the filter to the input sequence, x(n) = {1, 2}. Use DFT and IDFT. Also, verify
the result. .
Digital Signal Processing 41

 Solution: Given, x(n) = {1, 2, 3} and h(n) = {1, 2}

• h(n) = {1, 2, 3} ; length of h(n) is M = 3.

• x(n) = {1, 2}; length of x(n) is N = 2.

• y(n) = x(n) ∗ h(n) will have a length of (M + N − 1) = 3 + 2 − 1 = 4. Padding zeros,

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

DFT-IDFT method or Stockham’s method or Frequency domain approach:

1 1 1 1 1 3
1 −j −1 j 2 1 − 2j
H(k) = =
1 −1 1 −1 3 −1
1 j −1 −j 0 1 + 2j

1 1 1 1 1 6
1 −j −1 j 2 −2 − 2j
X(k) = =
1 −1 1 −1 0 2
1 j −1 −j 0 −2 + 2j

X(k) × H(k) = {18, −6 + 2j, −2, −6 − 2j}


y(n) = x(n) ⊗4 h(n) = IDF T {X(k) × H(k)}
1 1 1 1 18 4
1 1 j −1 −j −6 + 2j 1 16
y(n) = 4 = 4
1 −1 1 −1 −2 28
−1 −j −1 j −6 − 2j 24

y(n)={1, 4, 7, 6}

Verification:
x(n) 1 2 3
h(n) 1 2
2 4 6
1 2 3
1 4 7 6
42 Module-2

2.3 Filtering of Long data Sequences


Suppose, the input sequence x(n) of long duration is to be processed with a system having
finite duration impulse response by convolving the two sequences. Since, the linear filtering
performed via DFT involves operation on a fixed size data block, the input sequence is divided
into different fixed size data block before processing. The successive blocks are then processed
one at a time and the results are combined to produce the net result. As the convolution is
performed by dividing the long input sequence into different fixed size sections, it is called
sectioned convolution. A long input sequence is segmented to fixed size blocks, prior to FIR
filter processing.

[x1 (n) + x2 (n)] ∗ h(n) = x1 (n) ∗ h(n) + x2 (n) ∗ h(n)

Two methods are used to evaluate the discrete convolution:

1. Overlap-add method: Because convolution is linear, the output of a long sequence can
be calculated by simply summing the outputs of each block of the input. In this method,
overlapping the tail of the output from the previous block with the beginning of the
output from the present block.

Input signal:
L L L

x1(n) M-1
zeros
x21(n) M-1
zeros
Output signal: x31(n) M-1
zeros
y1(n)
Add
M-1 points y2(n)
Add
M-1 points y3(n)

Fig. 2.2. Overlap-add method.

2. Overlap-save method: Rather than sectioning the input and then calculating the output
Digital Signal Processing 43

from overlapped outputs from the individual input blocks, we will section the output
and then use whatever part of the input contributes to that output block. This method
has also been called overlap-discard because, rather than adding the overlapping output
blocks, the overlapping portion of the output blocks are discarded.

Input signal:
L L L

M-1
zeros
x1(n)
M-1 point
overlap x21(n)
M-1 point
overlap x31(n)
Output signal:
y1(n)

discard
y2(n)
M-1 points
discard
y3(n)
M-1 points
discard
M-1 points

Fig. 2.3. Overlap-save method.

Example 2.4: Consider a FIR filter with impulse response, h(n) = {3, 2, 1, 1}. If the input
is x(n) = {1, 2, 3, 3, 2, 1, −1, −2, −3, 5, 6, −1, 2, 0, 2, 1}. Find the output using overlap-add
method assuming the length of block as 7.

 Solution:

h(n) = {3, 2, 1, 1}; M = 4


x(n) = {1, 2, 3, 3, 2, 1, −1, −2, −3, 5, 6, −1, 2, 0, 2, 1}. since block length is 7. ie., N = 7
N =M +L−1⇒7=4+L−1⇒L=4
h(n) = {3, 2, 1, 1, 0, 0, 0}
44 Module-2

x1 (n) = {1, 2, 3, 3, 0, 0, 0} ; y1 (n) = x1 (n) ⊗7 h(n)


x2 (n) = {2, 1, −1, −2, 0, 0, 0}; y2 (n) = x2 (n) ⊗7 h(n)
x3 (n) = {−3, 5, 6, −1, 0, 0, 0}; y3 (n) = x3 (n) ⊗7 h(n)
x4 (n) = {2, 0, 2, 1, 0, 0, 0} ; y4 (n) = x4 (n) ⊗7 h(n)

1 0 0 0 3 3 2 3 3
2 1 0 0 0 3 3 2 8
3 2 1 0 0 0 3 1 14
y1 (n) = x1 (n) ⊗7 h(n) = 3 3 2 1 0 0 0 1 = 18
0 3 3 2 1 0 0 0 11
0 0 3 3 2 1 0 0 6
0 0 0 3 3 2 1 0 3

2 0 0 0 −2 −1 1 3 6
1 2 0 0 0 −2 −1 2 7
−1 1 2 0 0 0 −2 1 1
y2 (n) = x2 (n) ⊗7 h(n) = −2 −1 1 2 0 0 0 1 = −5
0 −2 −1 1 2 0 0 0 −4
0 0 −2 −1 1 2 0 0 −3
0 0 0 −2 −1 1 2 0 −2

−3 0 0 0 −1 6 5 3 −9
5 −3 0 0 0 −1 6 2 9
6 5 −3 0 0 0 −1 1 25
y3 (n) = x3 (n) ⊗7 h(n) = −1 6 5 −3 0 0 0 1 = 11
0 −1 6 5 −3 0 0 0 9
0 0 −1 6 5 −3 0 0 5
0 0 0 −1 6 5 −3 0 −1
Digital Signal Processing 45

2 0 0 0 1 2 0 3 6
0 2 0 0 0 1 2 2 4
2 0 2 0 0 0 1 1 8
y4 (n) = x4 (n) ⊗7 h(n) = 1 2 0 2 0 0 0 1 = 9
0 1 2 0 2 0 0 0 4
0 0 1 2 0 2 0 0 3
0 0 0 1 2 0 2 0 1

y1 (n) 3 8 14 18 11 6 3
y2 (n) 6 7 1 −5 −4 −3 −2
y3 (n) −9 9 25 11 9 5 −1
y4 (n) 6 4 8 9 4 3 1
y(n) 3 8 14 18 17 13 4 −5 −13 6 23 11 15 9 7 9 4 3 1

y(n) = x(n) ∗ h(n) = {3, 8, 14, 18, 17, 13, 4, −5, −13, 6, 23, 11, 15, 9, 7, 9, 4, 3, 1}.

Example 2.5: Determine the response of an LTI system with h(n) = {1, −1, 2} for an input
x(n) = {1, 0, 1, −2, 1, 2, 3, −1, 0, 2}. Employ overlap-add method with block length, N = 4.

 Solution:

h(n) = {1, −1, 2}; M = 3


x(n) = {1, 0, 1, −2, 1, 2, 3, −1, 0, 2}. Since block length is 4. ie., N = 4
N =M +L−1⇒4=3+L−1⇒L=2
x1 (n) = {1, 0, 0, 0} ; y1 (n) = x1 (n) ⊗4 h(n)
x2 (n) = {1, −2, 0, 0}; y2 (n) = x2 (n) ⊗4 h(n)
x3 (n) = {1, 2, 0, 0} ; y3 (n) = x3 (n) ⊗4 h(n)
x4 (n) = {3, −1, 0, 0}; y4 (n) = x4 (n) ⊗4 h(n)
x5 (n) = {0, 2, 0, 0} ; y5 (n) = x5 (n) ⊗4 h(n)

1 0 0 0 1 1
0 1 0 0 −1 −1
y1 (n) = x1 (n) ⊗4 h(n) = =
0 0 1 0 2 2
0 0 0 1 0 0
46 Module-2

1 0 0 −2 1 1
−2 1 0 0 −1 −3
y2 (n) = x2 (n) ⊗4 h(n) = =
0 −2 1 0 2 4
0 0 −2 1 0 −4

1 0 0 2 1 1
2 1 0 0 −1 1
y3 (n) = x3 (n) ⊗4 h(n) = =
0 2 1 0 2 0
0 0 2 1 0 4

3 0 0 −1 1 3
−1 3 0 0 −1 −4
y4 (n) = x4 (n) ⊗4 h(n) = =
0 −1 3 0 2 7
0 0 −1 3 0 −2

0 0 0 2 1 0
2 0 0 0 −1 2
y5 (n) = x5 (n) ⊗4 h(n) = =
0 2 0 0 2 −2
0 0 2 0 0 4

y1 (n) 1 −1 2 0
y2 (n) 1 −3 4 −4
y3 (n) 1 1 0 4
y4 (n) 3 −4 7 −2
y5 (n) 0 2 −2 4
y(n) 1 −1 3 −3 5 −3 3 0 7 0 −2 4

y(n) = {1, −1, 3, −3, 5, −3, 3, 0, 7, 0, −2, 4}.

Example 2.6: Find the output of a linear filter, given the impulse response h(n) = {1, 2} and
input, x(n) = {1, 2, −1, 2, 3, −2, −3, −1, 1, 1, 2, −1} using overlap-add method.

 Solution:
h(n) = {1, 2}; M = 2
x(n) = {1, 2, −1, 2, 3, −2, −3, −1, 1, 1, 2, −1}
N =M +L−1
N = 2M = 22 = 4
Digital Signal Processing 47

N =M +L−1⇒4=2+L−1⇒L=3
h(n) = {1, 2}; M = 2
x(n) = {1, 2, −1, 2, 3, −2, −3, −1, 1, 1, 2, −1}
N =M +L−1
N = 2M = 22 = 4
N =M +L−1⇒4=2+L−1⇒L=3
x1 (n) = {1, 2, −1, 0} ; y1 (n) = x1 (n) ⊗4 h(n)
x2 (n) = {2, 3, −2, 0} ; y2 (n) = x2 (n) ⊗4 h(n)
x3 (n) = {−3, −1, 1, 0}; y3 (n) = x3 (n) ⊗4 h(n)
x4 (n) = {1, 2, −1, 0} ; y4 (n) = x4 (n) ⊗4 h(n)
h(n) = {1, 2, 0, 0}

1 0 −1 2 1 1
2 1 0 −1 2 4
y1 (n) = x1 (n) ⊗ h(n) = =
−1 2 1 0 0 3
0 −1 2 1 0 −2

2 0 −2 3 1 2
3 2 0 −2 2 7
y2 (n) = x2 (n) ⊗ h(n) = =
−2 3 2 0 0 4
0 −2 3 2 0 −4

−3 0 1 −1 1 −3
−1 −3 0 1 2 −7
y3 (n) = x3 (n) ⊗ h(n) = =
1 −1 −3 0 0 −1
0 1 −1 −3 0 2

1 0 −1 2 1 1
2 1 0 −1 2 4
y4 (n) = x4 (n) ⊗ h(n) = =
−1 2 1 0 0 3
0 −1 2 1 0 −2
48 Module-2

y1 (n) 1 4 3 −2
y2 (n) 2 7 4 −4
y3 (n) −3 −7 −1 2
y4 (n) 1 4 3 −2
y(n) 1 4 3 0 7 4 −7 −7 −1 3 4 3 −2

y(n) = x(n) ∗ h(n) = {1, 4, 3, 0, 7, 4, −7, −7, −1, 3, 4, 3, −2}.

Example 2.7: Find the output of a linear filter given the impulse response h(n) = {1, 2} and
input, x(n) = {1, 2, −1, 2, 3, −2, −3, −1, 1, 1, 2, −1} using overlap-save method.

 Solution:

h(n) = {1, 2}; M = 2


x(n) = {1, 2, −1, 2, 3, −2, −3, −1, 1, 1, 2, −1}
N =M +L−1
N = 2M = 22 = 4
N =M +L−1⇒4=2+L−1⇒L=3
h(n) = {1, 2, 0, 0}
x1 (n) = {1, 2, −1}; x2 (n) = {2, 3, −2}; x3 (n) = {−3, −1, 1}; x4 (n) = {1, 2, −1}

x1 (n) 0 1 2 −1
x2 (n) −1 2 3 −2
x3 (n) −2 −3 −1 1
x4 (n) 1 1 2 −1
x5 (n) −1 0 0 0

x1 (n) = {0, 1, 2, −1} ; y1 (n) = x1 (n) ⊗4 h(n)


x2 (n) = {−1, 2, 3, −2} ; y2 (n) = x2 (n) ⊗4 h(n)
x3 (n) = {−2, −3, −1, 1}; y3 (n) = x3 (n) ⊗4 h(n)
x4 (n) = {1, 1, 2, −1} ; y4 (n) = x4 (n) ⊗4 h(n)
x5 (n) = {−1, 0, 0, 0} ; y5 (n) = x5 (n) ⊗4 h(n)
Digital Signal Processing 49

0 −1 2 1 1 −2
H

H
1 0 −1 2 2 1
y1 (n) = x1 (n) ⊗4 h(n) = =
2 1 0 −1 0 4
−1 2 1 0 0 3

−1 −2 3 2 1 −5
H

H
2 −1 −2 3 2 0
y2 (n) = x2 (n) ⊗4 h(n) = =
3 2 −1 −2 0 7
−2 3 2 −1 0 4

−2 1 −1 −3 1 0A
−3 −2 1 −1 2 −7
y3 (n) = x3 (n) ⊗4 h(n) = =
−1 −3 −2 1 0 −7
1 −1 −3 −2 0 −1

1 −1 2 1 1 −1
H

H
1 1 −1 2 2 3
y4 (n) = x4 (n) ⊗4 h(n) = =
2 1 1 −1 0 4
−1 2 1 1 0 3

−1 0 0 0 1 −1
H

H
0 −1 0 0 2 −2
y5 (n) = x5 (n) ⊗4 h(n) = =
0 0 −1 0 0 0
0 0 0 −1 0 0

y1 (n) 1 4 3
y2 (n) 0 7 4
y3 (n) −7 −7 −1
y4 (n) 3 4 3
y5 (n) −2 0 0
y(n) 1 4 3 0 7 4 −7 −7 −1 3 4 3 −2 0 0

y(n) = x(n) ∗ h(n) = {1, 4, 3, 0, 7, 4, −7, −7, −1, 3, 4, 3, −2}

Example 2.8: Find the output of a linear filter given the impulse response h(n) = {1, 1, 1}
and input, x(n) = {3, −1, 0, 1, 3, 2, 0, 1, 2, 1} using overlap-save method.

 Solution:
50 Module-2

h(n) = {1, 1, 1}; M = 3


x(n) = {3, −1, 0, 1, 3, 2, 0, 1, 2, 1}
N =M +L−1
N = 2M = 23 = 8
N =M +L−1⇒8=3+L−1⇒L=6
x1 (n) = {3, −1, 0, 1, 3, 2}
x2 (n) = {0, 1, 2, 1, 0, 0}

x1 (n) 0 0 3 −1 0 1 3 2
x2 (n) 3 2 0 1 2 1 0 0

x1 (n) = {0, 0, 3, −1, 0, 1, 3, 2}


x2 (n) = {3, 2, 0, 1, 2, 1, 0, 0}

0 2 3 1 0 −1 3 0 1 ∗
0 0 2 3 1 0 −1 3 1 ∗
3 0 0 2 3 1 0 −1 1 3
−1 3 0 0 2 3 1 0 0 2
y1 (n) = x1 (n) ⊗8 h(n) = =
0 −1 3 0 0 2 3 1 0 2
1 0 −1 3 0 0 2 3 0 0
3 1 0 −1 3 0 0 2 0 4
2 3 1 0 −1 3 0 0 0 6

3 0 0 1 2 1 0 2 1 ∗
2 3 0 0 1 2 1 0 1 ∗
0 2 3 0 0 1 2 1 1 5
1 0 2 3 0 0 1 2 0 3
y2 (n) = x2 (n) ⊗8 h(n) = =
2 1 0 2 3 0 0 1 0 3
1 2 1 0 2 3 0 0 0 4
0 1 2 1 0 2 3 0 0 3
0 0 1 2 1 0 2 3 0 1

y(n) = {3, 2, 2, 0, 4, 6, 5, 3, 3, 4, 3, 1}.

Example 2.9: Find the output of a linear filter given the impulse response h(n) = {1, −1}
and input, x(n) = {1, 1, 1, 1, 1, 3, 1, 1, 4, 2, 1, 1, 3, 1} using overlap-save method. Use only 5
point circular convolution.
Digital Signal Processing 51

 Solution:
h(n) = {1, −1}; M = 2
x(n) = {1, 1, 1, 1, 1, 3, 1, 1, 4, 2, 1, 1, 3, 1}
N =M +L−1
N =M +L−1⇒5=2+L−1⇒L=4
x(n) = {1, 1, 1, 1 |, 1, 3, 1, 1 |, 4, 2, 1, 1 |, 3, 1}
x1 (n) = {1, 1, 1, 1}
x2 (n) = {1, 3, 1, 1}
x3 (n) = {4, 2, 1, 1}
x4 (n) = {3, 1, 0, 0}

x1 (n) 0 1 1 1 1
x2 (n) 1 1 3 1 1
x3 (n) 1 4 2 1 1
x4 (n) 1 3 1 0 0

x1 (n) = {0, 1, 1, 1, 1}
x2 (n) = {1, 1, 3, 1, 1}
x3 (n) = {1, 4, 2, 1, 1}
x4 (n) = {1, 3, 1, 0, 0}
h(n) = {1, −1, 0, 0, 0}

0 1 1 1 1 1 ∗
1 0 1 1 1 −1 1
y1 (n) = x1 (n) ⊗5 h(n) = 1 1 0 1 1 0 = 0
1 1 1 0 1 0 0
1 1 1 1 0 0 0

1 1 1 3 1 1 ∗
1 1 1 1 3 −1 0
y2 (n) = x2 (n) ⊗5 h(n) = 3 1 1 1 1 0 = 2
1 3 1 1 1 0 −2
1 1 3 1 1 0 0
52 Module-2

1 1 1 2 4 1 ∗
4 1 1 1 2 −1 3
y3 (n) = x3 (n) ⊗5 h(n) = 2 4 1 1 1 0 = −2
1 2 4 1 1 0 −1
1 1 2 4 1 0 0

1 0 0 1 3 1 ∗
3 1 0 0 1 −1 2
y4 (n) = x4 (n) ⊗5 h(n) = 1 3 1 0 0 0 = −2
0 1 3 1 0 0 −1
0 0 1 3 1 0 0

y(n) = x(n) ∗ h(n) = {1, 0, 0, 0, 0, 2, −2, 0, 3, −2, −1, 0, 2, −2, −1, 0}.

2.4 Computational Complexity of DFT & Efficient Computation of the DFT


By the definition of DFT,

N −1 N −1
2πkn
x(n)e−j
X X
X(k) = x(n)WNkn = N ; k = 0, 1, 2, . . . , N − 1
n=0 n=0

Let, N = 4.

3
X
X(k) = x(n)W4kn Multiplication Addition
n=0
3
X
k = 0; X(0) = x(n)W40×n = x(0)W40 + x(1)W40 + x(2)W40 + x(3)W40 4 3
n=0
X3
k = 1; X(1) = x(n)W41×n = x(0)W40 + x(1)W41 + x(2)W42 + x(3)W43 4 3
n=0
X3
k = 2; X(2) = x(n)W42×n = x(0)W40 + x(1)W42 + x(2)W44 + x(3)W46 4 3
n=0
X3
k = 3; X(3) = x(n)W43×n = x(0)W40 + x(1)W43 + x(2)W46 + x(3)W49 4 3
n=0
Total 16 12

Hence, for N = 4.
No. of complex computation required for X(k) is 16.
No. of complex addition required for X(k) is 12.
In general,
Digital Signal Processing 53

No. of complex computation required for X(k) is N 2 .


No. of complex addition required for X(k) is N (N − 1).

Complex multiplication:

(a + jb) × (c + jd) = (a × c) + j(a × d) + j(b × c) + j 2 (b × d)


(a + jb) × (c + jd) = (a × c) + j(a × d) + j(b × c) − (b × d)
(a + jb) × (c + jd) = (a × c) − (b × d) + j(a × d + b × c)
∴ 1 complex multiplication = 4 real multiplications + 2 real additions.
Note: subtraction is also counted as addition in signal processing.

Complex addition:

(a + jb) + (c + jd) = (a + c) + j(b + d)


∴ 1 complex addition = 2 real additions.
In summary,

Operation Number of computations


Complex multiplications N2
Complex additions N (N − 1)
Real multiplications 4N 2
Real additions 2N (N − 1) + 2N 2 = 4N 2 − 2N
Trigonometric functions 2N 2

Example 2.10: Calculate the number of complex multiplications, complex additions, real
multiplications, real additions and trigonometric functions required for computing DFT for
N = 64 using direct method.

 Solution:

Operation Number of computation


Complex multiplications N2 642 = 4096
Complex additions N (N − 1) 64(64 − 1) = 4032
54 Module-2

Operation Number of computation


Real multiplications 4N 2 4 × 642 = 16, 384
Real additions 4N 2 − 2N 4 × 642 − 2 × 64 = 16, 256
Trigonometric functions 2N 2 2 × 642 = 8, 192

2.4.1 Phase factor/twiddle factor

Twiddle factors are a set of values that is used to speed up DFT and IDFT calculations.
Twiddle factors are mathematically represented as: WN = e−j2π/N .

2.4.2 Properties of Phase factor/twiddle factor

1. Periodicity property of WN : WNk+N = WNk

j2π(k+N ) j2πk j2πN j2πk


WNk+N = e− N = e− N e− N = e− N e−j2π

e−j2π = cos 2π − j sin 2π = 1 − j × 0 = 1

j2πk
WNk+N = e− N = WNk

k+N/2
2. Symmetry property of WN : WN = −WNk

j2π k+ N
( )
k+ N 2 j2πk j2πN j2πk
WN 2
= e− N = e− N e− 2N = e− N e−jπ

e−jπ = cos π − j sin π = −1 − j × 0 = −1

k+ N j2πk j2πk
WN 2
= e− N ∗ −1 = −e− N = −WNk

3. WN2 = WN/2

j2π(2) j2π
− N/2
WN2 = e− N =e = WN/2

2.5 Fast Fourier Transform (FFT)


The DFT is one of the most powerful tools in digital signal processing. The DFT enables
us to conveniently analyze and design systems in frequency domain. We have seen that the
Digital Signal Processing 55

computational part is too long with this technique. We want to reduce that. This can be done
through FFT or fast Fourier transform. So, we can say FFT is nothing but computation of
DFT in an algorithmic format, where the computational part will be reduced. The main idea
of FFT algorithms is to decompose an N-point DFT into transformations of smaller length.
For example, if we devise a hypothetical algorithm which can decompose a 1024-point DFT
into two 512-point DFTs.

2.5.1 Radix-2 DIT-FFT Algorithm

The radix-2 decimation-in-time algorithm rearranges the DFT equation into two parts: a
sum over the even-numbered discrete-time indices n = (0, 2, 4, ..., N − 2) and a sum over the
odd-numbered indices n = (1, 3, 5, ..., N − 1).
Let x(n) be a N -point sequence where N is assumed to be power of 2. Decimate/break
the sequence into 2 sequences of length N/2, where one is even indexed values of x(n) and
other is odd indexed values of x(n). ie.,

xe (n) = x(2n); n = 0, 1, ....., N/2 − 1.


xo (n) = x(2n + 1); n = 0, 1, ....., N/2 − 1.
N
X −1
X(k) = x(n)WNkn
n=0
(N/2)−1 (N/2)−1
X X (2n+1)k
X(k) = x(2n)WN2nk + x(2n + 1)WN
n=0 n=0
(N/2)−1 (N/2)−1
X X
X(k) = x(2n)WNnk /2 + W nk x(2n + 1)WNnk /2
n=0 n=0
nk
X(k) = Xe (k) + W Xo (k); 0 ≤ k ≤ N/2 − 1

Since, Xe (k) and Xo (k) are periodic interms of k with period N/2 and so for k = N/2, ....., N −
1, the values are same as those for k = 0, 1, ..., N/2 − 1.

(k+N/2)
∴ for k ≥ N/2; WN = −WNk
We can write,
(k−N/2)
X(k) = Xe (k − N/2) − WN Xo (k − N/2); k = N/2, ..., N − 1
Let us consider N = 8
X(k) = Xe (k) + W8k Xo (k)
X(k) = Xe (k − 4) − W8k−4 Xo (k − 4)
56 Module-2

k = 0; X(0) = Xe (0) + W80 Xo (0)


k = 1; X(1) = Xe (1) + W81 Xo (1)
k = 2; X(2) = Xe (2) + W82 Xo (2)
k = 3; X(3) = Xe (3) + W83 Xo (3)
k = 4; X(4) = Xe (0) − W80 Xo (0)
k = 5; X(5) = Xe (1) − W81 Xo (1)
k = 6; X(6) = Xe (2) − W82 Xo (2)
k = 7; X(7) = Xe (3) − W83 Xo (3)
This is called a decimation in time because the time samples are rearranged in alternating
groups, and a radix-2 algorithm because there are two groups. Fig. 2.4 graphically illustrates
the DIT-FFT computation for N = 8.

x(0)
xe(0)
x(1)
xe(1)
4-point x(2)
xe(2) DFT
x(3)
xe(3)

w80 x(4)
xoe(0)
w81 x(5)
xo(1)
4-point w82
xo(2) DFT x(6)
w83
xo(3) x(7)

Fig. 2.4. Decimation in time of a length N-DFT into two length-N/2 DFTs followed by
a combining stage.

2.5.2 Radix-2 DIF-FFT Algorithm


N
X −1
We know that, X(k) = x(n)WNkn . Decimate it into 2 sequences,
n=0
Digital Signal Processing 57

N/2−1 N −1
X X
X(k) = x(n)WNkn + x(n)WNkn
n=0 n=N/2

Let m = n − N/2
n = N/2; m = N/2 − N/2 = 0
n = N − 1; m = (N − 1) − N/2 = N/2 − 1
N/2−1 N/2−1
X X k(m+N/2)
X(k) = x(n)WNkn + x(m + N/2)WN
n=0 m=0

since m is dummy variable, replace m by n


N/2−1 N/2−1
X X k(n+N/2)
X(k) = x(n)WNkn + x(n + N/2)WN
n=0 n=0
N/2−1 N/2−1
X X kN/2
X(k) = x(n)WNkn + x(n + N/2)WNkn WN
n=0 n=0
kN/2 −j2πkN/N 2 −jπ k
WN =e = (e ) = (−1)k
N/2−1 N/2−1
X X
∴ X(k) = x(n)WNkn + (−1) k
x(n + N/2)WNkn
n=0 n=0
N/2−1
X
∴ X(k) = [x(n) + (−1)k x(n + N/2)]WNkn
n=0

Let us split even and odd sequences,


N/2−1
X
X(2k) = [x(n) + (−1)2k x(n + N/2)]WN2kn
n=0
N/2−1
X (2k+1)n
X(2k + 1) = [x(n) + (−1)2k+1 x(n + N/2)]WN
n=0
2k
since, (−1) = 1 & (−1)2k+1 = −1
N/2−1
X
X(2k) = [x(n) + x(n + N/2)]WN2kn
n=0
N/2−1
X (2k+1)n
X(2k + 1) = [x(n) − x(n + N/2)]WN
n=0

Let g1 (n) = x(n) + x(n + N/2)


g2 (n) = [x(n) − x(n + N/2)]WNn
58 Module-2

N/2−1
X
kn
X(2k) = g1 (n)WN/2
n=0
N/2−1
X
kn
X(2k + 1) = g2 (n)WN/2
n=0

Let, N = 8
g1 (n) = x(n) + x(n + 4); g2 (n) = [x(n) − x(n + 4)]W8n
g1 (0) = x(0) + x(4); g2 (0) = [x(0) − x(4)]W80
g1 (1) = x(1) + x(5); g2 (1) = [x(1) − x(5)]W81
g1 (2) = x(2) + x(6); g2 (2) = [x(2) − x(6)]W82
g1 (3) = x(3) + x(7); g2 (3) = [x(3) − x(7)]W83
This is called a decimation in frequency because the frequency samples are computed sepa-
rately in alternating groups, and a radix-2 algorithm because there are two groups. Fig. 2.5
graphically illustrates this form of the DFT computation.

g1(0)
x(0) x(0)
g1(1)
x(1) w8 0
4-point x(4)
w8 1 g1(2) DFT x(2)
x(2)
w8 2 g1(3)
x(6)
x(3)
w8 3

g2(0)
x(1)
x(4) g2(1)
4-point x(5)
x(5) g2(2) DFT x(3)
x(6) g2(3)
x(7)
x(7)

Fig. 2.5. Decimation in frequency of a length N-DFT into two length-N/2 DFTs preceded
by a pre-processing stage.

Normal and Bit reversed Addressing

Bit-reversed addressing is used for simplifying and speeding-up the access to the arrays in
FFT algorithms. In bit reversed addressing, transposed the original binary bits representing
Digital Signal Processing 59

the normal index order by reversing their positions. The most significant bit becomes the
least significant bit and the least significant bit becomes the most significant bit, the next
to the most significant bit becomes the next to the least significant bit, and the next to the
least significant bit becomes the next to the most significant bit, and so on.

Normal input Bit reversed output


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

Let, N = 23 = 8. ∴ N/2 = 4 = 100. Perform the addition from left to right (−→).

• Normal input = 000; bit reversed output = 000.

• 000+(N/2)=000+100=100; bit reversed output = 100.

• 100+(N/2)=100+100=010; bit reversed output = 010.

• 010+(N/2)=010+010=110; bit reversed output = 110.

• 110+(N/2)=110+100=001; bit reversed output = 001.

• 001+(N/2)=001+100=101; bit reversed output = 101.

• 101+(N/2)=101+100=011; bit reversed output = 011.

• 011+(N/2)=011+100=111; bit reversed output = 111.

Example 2.11: Using DIF-FFT algorithm compute DFT of the sequence, x(n) =
{1, 2, −1, 2, 4, 2, −1, 2}.

 Solution:
60 Module-2

Given, x(0) = 1, x(1) = 2, x(2) = −1, x(3) = 2, x(4) = 4, x(5) = 2, x(6) = −1, x(7) = 2.

(i) N/2 twiddle factors. Here N = 8


8
∴ = 4 twiddle factors. W80 = 1; W81 = 0.707 − j0.707; W82 = −j; W83 = −0.707 − j0.707
2
(ii) Input is normal and output is bit reversed.
(iii) Butterfly operation

a c=a+b

b d=(a-b)Wnr

(iv) Number of stages = log2 N = log2 8 = log2 23 = 3 log2 2 = 3 × 1 = 3.

A = x(0) + x(4) = 5 I =A+C =3 X(0) = I + J = 11


B = x(1) + x(5) = 4 J =B+D =8 X(4) = (I − J)W80 = −5
C = x(2) + x(6) = −2 K = [A − C]W80 = 7 X(2) = K + L = 7
D = x(3) + x(7) = 4 L = [B − D]W82 =0 X(6) = (K − L)W80 = 7
E = [x(0) − x(4)]W80 = −3 M = E + G = −3 X(1) = M + N = −3
F = [x(1) − x(5)]W81 = 0 N =F +H =0 X(5) = (M − N )W80 = −3
G = [x(2) − x(6)]W82 = 0 P = [E − G]W80 = −3 X(3) = P + Q = −3
H = [x(3) − x(7)]W83 = 0 Q = [F − H]W82 = 0 X(7) = (P − Q)W80 = −3
X(k) = {11, −3, 7, −3, −5, −3, 7, −3}

Example 2.12: Obtain 8-point DFT of the sequence x(n) = {2, 1, 2, 1} using radix-2 DIF-FFT
algorithm. Show all the results along signal flow graph.

 Solution:
Given, x(0) = 2, x(1) = 1, x(2) = 2, x(3) = 1, x(4) = 0, x(5) = 0, x(6) = 0, x(7) = 0.
Digital Signal Processing 61
A I
x(0) X(0)

B J
x(1) X(4)
w80
C K
x(2) X(2)
w80
D L
x(3) X(6)
w82 w8 0
E M
x(4) X(1)
w8 0
F N
x(5) X(5)
w8 1 w8 0
G P
x(6) X(3)
w8 2 w80
H Q
x(7) X(7)
w8 3 w82 w8 0

(i) N/2 twiddle factors. Here N = 8


8
∴ = 4 twiddle factors. W80 = 1; W81 = 0.707 − j0.707; W82 = −j; W83 = −0.707 − j0.707
2
(ii) Input is normal and output is bit reversed.
(iii) Butterfly operation

a c=a+b

b d=(a-b)Wnr

(iv) Number of stages = log2 N = log2 8 = log2 23 = 3 log2 2 = 3 × 1 = 3.

A = x(0) + x(4) = 2 I =A+C =4 X(0) = I + j = 6


B = x(1) + x(5) = 1 J =B+D =2 X(4) = (l − J)W80 = 2
C = x(2) + x(6) = 2 K = [A − C]W80 = 0 X(2) = K + L = 0
D = x(3) + x(7) = 1 L = [B − D]W82 = 0 X(6) = (K − L)W80 = 0
E = [x(0) − x(4)]W80 = 2 M = E + G = 2 − 2j X(1) = M + N = 2 − j3.414
F = [x(1) − x(5)]W81 = 0.707 − j0.707 N = F + H = −j1.414 X(5) = (M − N )W80 = 2 − j0.586
G = [x(2) − x(6)]W82 = −2j P = [E − G]W80 = 2 + 2j X(3) = P + Q = 2 + j0.586
H = [x(3) − x(7)]W83 = −0.707 − j0.707 Q = [F − H]W82 = −j1.414 X(7) = (P − Q)W80 = 2 + j3.414
62 Module-2

A I
x(0) X(0)

B J
x(1) X(4)
w80
C K
x(2) X(2)
w80
D L
x(3) X(6)
w82 w8 0
E M
x(4) X(1)
w8 0
F N
x(5) X(5)
w8 1 w8 0
G P
x(6) X(3)
w8 2
w80
H Q
x(7) X(7)
w8 3 w82 w8 0

X(k) = {6, 2 − j3.414, 0, 2 + j0.586, 2, 2 − j0.586, 0, 2 + j3.414}

Example 2.13: Obtain 8-point DFT of the sequence x(n) = {1, 1, 1, 1, 0, 0, 0, 0} using radix-2
DIT-FFT algorithm. Show all the results along signal flow graph.

 Solution:
Given, x(0) = 1, x(1) = 1, x(2) = 1, x(3) = 1, x(4) = 0, x(5) = 0, x(6) = 0, x(7) = 0.

(i) N/2 twiddle factors. Here N = 8


8
∴ = 4 twiddle factors. W80 = 1; W81 = 0.707 − j0.707; W82 = −j; W83 = −0.707 − j0.707
2
(ii) Input is bit reversed and output is normal.
(iii) Butterfly operation

a c=a+Wnrb

b d=a-Wnrb

(iv) Number of stages = log2 N = log2 8 = log2 23 = 3 log2 2 = 3 × 1 = 3.


Digital Signal Processing 63

A = x(0) + W80 x(4) = 1 I = A + W80 C = 2 X(0) = I + W80 M = 4


B = x(0) − W80 x(4) = 1 J = B + W82 D = 1 − j X(1) = J + W81 N = 1 − j2.414
C = x(2) + W80 x(6) = 1 K = A − W80 C = 0 X(2) = K + W82 P = 0
D = x(2) − W80 x(6) = 1 L = B − W82 D = 1 + j X(3) = L + W83 Q = 1 − j0.414
E = x(1) + W20 x(5) = 1 M = E + W20 G = 2 X(4) = I − W20 M = 0
F = x(1) − W20 x(5) = 1 N = F + W22 H = 1 − j X(5) = J − W21 N = 1 + j0.414
G = x(3) + W20 x(7) = 1 P = E − W20 G = 0 X(6) = K − W82 P = 0
H = x(3) − W80 x(7) = 1 Q = F − W22 H = 1 + j X(7) = L − W83 Q = 1 + j2.414

A I
x(0) X(0)

B J
x(4) X(1)
w80
C K
x(2) X(2)
w8 0
D L
x(6) X(3)
w80 w8 2
E M
x(1) X(4)
w80
F N
x(5) X(5)
w80 w81
G P
x(3) X(6)
w80 w82
H Q
x(7) X(7)
w80 w82 w83

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

Example 2.14: Obtain 8-point DFT of the sequence x(n) = {1, 1, 0, 0, −1, −1, 0, 0} using
radix-2 DIT-FFT algorithm. Show all the results along signal flow graph.

 Solution:
Given, x(0) = 1, x(1) = 1, x(2) = 0, x(3) = 0, x(4) = −1, x(5) = −1, x(6) = 0, x(7) = 0.

(i) N/2 twiddle factors. Here N = 8


8
∴ = 4 twiddle factors. W80 = 1; W81 = 0.707 − j0.707; W82 = −j; W83 = −0.707 − j0.707
2
(ii) Input is bit reversed and output is normal.
(iii) Butterfly operation
64 Module-2

a c=a+Wnrb

b d=a-Wnrb

(iv) Number of stages = log2 N = log2 8 = log2 23 = 3 log2 2 = 3 × 1 = 3.

A I
x(0) X(0)

B J
x(4) X(1)
w80
C K
x(2) X(2)
w8 0
D L
x(6) X(3)
w80 w8 2

E M
x(1) X(4)
w80
F N
x(5) X(5)
w80 w81
G P
x(3) X(6)
w80 w82
H Q
x(7) X(7)
w80 w82 w83

A = x(0) + W20 x(4) = 0 I = A + W20 C = 0 X(0) = I + W20 M = 0


B = x(0) − W80 x(4) = 2 J = B + W82 D = 2 X(1) = J + W81 N = 3.414 − j1.414
C = x(2) + W80 x(6) = 0 K = A − W80 C = 0 X(2) = K + W82 P = 0
D = x(2) − W80 x(6) = 0 L = B − W82 D = 2 X(3) = L + W82 Q = 0.586 − j1.414
E = x(1) + W20 x(5) = 0 M = E + W20 G = 0 X(4) = I − W20 M = 0
F = x(1) − W20 x(5) = 2 N = F + W22 H = 2 X(5) = J − W21 N = 0.586 + j1.414
G = x(3) + W20 x(7) = 0 P = E − W80 G = 0 X(6) = K − W82 P = 0
H = x(3) − W80 x(7) = 0 Q = F − W82 H = 2 X(7) = L − W83 Q = 3.414 + j1.414

X(k) = {0, 3.414 − j1.414, 0, 0.586 − j1.414, 0, 0.586 + j1.414, 0, 3.414 + j1.414}.

Example 2.15: What is the speed improvement factor in calculating 64-point DFT of a
sequence using direct computation and FFT algorithm? Also mention the number of real
registers required.

 Solution:
Direct computation:
Complex multiplication = N 2 = 4096.
Digital Signal Processing 65

Complex addition = N (N − 1) = 4032

FFT algorithm:
N
Complex multiplication = 2 log2 N = 192
Complex addition = N log2 N = 384

N2 4096
Speed improvement factor = N
log2 N
= 192 = 21.33
2

Number of real registers required for FFT:


Registers required for real part; N = 64
Registers required for imaginary part; N = 64
Registers required for twiddle factor; N = 64
Total registers required = 3N = 64 × 3 = 192.

Example 2.16: Calculate the IDFT of X(k) = {0, 2.8284 − j2.8284, 0, 0, 0, 0, 0, 2.8284 +
j2.8284} using inverse radix-2 DIT-FFT algorithm.

 Solution:
Given, X(0) = 0, X(1) = 2.8284 − j2.8284, X(2) = 0, X(3) = 0, X(4) = 0, X(5) =
0, X(6) = 0, X(7) = 2.8284 + j2.8284.

(i) N/2 twiddle factors. Here N = 8


8
∴ = 4 twiddle factors. W8−0 = 1; W8−1 = 0.707 + j0.707; W8−2 = j; W8−3 = −0.707 + j0.707
2
(ii) Input is normal and output is bit reversed.
(iii) Butterfly operation

a c=a+b

b d=(a-b)Wn-r

(iv) Number of stages = log2 N = log2 8 = log2 23 = 3 log2 2 = 3 × 1 = 3.


66 Module-2

1
A = X(0) + X(4) = 0 I =A+C =0 x(0) = 8
(I + J) = 0.707
B = X(1) + X(5) = 2.8284 − j2.8284 J = B + D = 5.6568 x(4) = 1
8
(I − J)W8−0 = −0.707
C = X(2) + X(6) = 0 K = [A − C]W8−0 = 0 x(2) = 1
8
(K + L) = 0.707
D = X(3) + X(7) = 2.8284 + j2.8284 L = [B − D]W8−2 = 5.6568 x(6) = 1
8
(K − L)W8−0 = −0.707
E = [X(0) − X(4)]W8−0 = 0 M =E+G=0 x(1) = 1
8
(M + N ) = 1
F = [X(1) − X(5)]W8−1 = 4 N =F +H =8 x(5) = 1
8
(M − N )W8−0 = −1
G = [X(2) − X(6)]W8−2 = 0 P = [E − G]W8−0 = 0 x(3) = 1
8
(P + Q) = 0
H = [X(3) − X(7)]W8−3 = 4 Q = [F − H]W8−2 = 0 x(7) = 1
8
(P − Q)W8−0 = 0

A I 1/8 x(0)
X(0)
B J 1/8 x(4)
X(1)
w8-0
C K 1/8 x(2)
X(2)
w8-0
D L 1/8 x(6)
X(3)
w8-2 w8-0
E M 1/8 x(1)
X(4)
w8-0
F N 1/8 x(5)
X(5)
w8-1 w8-0
G P 1/8 x(3)
X(6)
w8-2 w8-0
H Q 1/8 x(7)
X(7)
w8-3 w8-2 w8-0

x(n) = {0.707, 1, 0.707, 0, −0.707, −1, −0.707, 0}.

Example 2.17: Compute the IDFT of the sequence X(k) = {0, 2−j4.8284, 0, 2+j0.8284, 0, 2−
j0.8284, 0, 2 + j4.8284} using DIF-FFT algorithm.

 Solution:
Given, X(0) = 0, X(1) = 2 − j4.8284, X(2) = 0, X(3) = 2 + j0.8284, X(4) = 0, X(5) =
2 − j0.8284, X(6) = 0, X(7) = 2 + j4.8284.

(i) N/2 twiddle factors. Here N = 8


8
∴ = 4 twiddle factors. W8−0 = 1; W8−1 = 0.707 + j0.707; W8−2 = j; W8−3 = −0.707 + j0.707
2
(ii) Input is bit reversed and output is normal.
(iii) Butterfly operation
Digital Signal Processing 67

(iii) Butterfly operation

a c=a+Wn-rb

b d=a-Wn-rb

(iv) Number of stages = log2 N = log2 8 = log2 23 = 3 log2 2 = 3 × 1 = 3.

A I 1/8 x(0)
X(0)

B J 1/8 x(1)
X(4)
-0
w8
C K 1/8 x(2)
X(2)
w8-0
D L 1/8 x(3)
X(6)
w8-0 w8-2
E M 1/8 x(4)
X(1)
w8-0
F N 1/8 x(5)
X(5)
w8 -0
w8-1
G P 1/8 x(6)
X(3)
w8-0 w8-2
H Q 1/8 x(7)
X(7)
w8-0 w8-2 w8-3

A = X(0) + W8−0 X(4) = 4 I = A + W8−0 C = 4 I + W2−0 M = 1


1

x(0) = 8
B = X(0) − W8−0 X(4) = 4 J = B + W8−2 D = 4 J + W8−1 N = 1
1

x(1) = 8
= X(2) + W8−0 X(6) = 0 K = A − W8−0 C = 4 K + W8−2 P = 1
1

C x(2) = 8
= X(2) − W8−0 X(6) = 0 L = B − W8−2 D = 4 L + W8−3 Q = 1
1

D x(3) = 8
= X(1) + W8−0 X(5) = 2 − j2 M = E + W8−0 G = 4 I − W8−0 M = 0
1

E x(4) = 8
= X(1) − W8−0 X(5) = −j2.828 N = F + W8−2 H = 2.828 − j2.828 J − W8−1 N = 0
1

F x(5) = 8
= X(3) + W8−0 X(7) = 2 + 2j P = E − W8−0 G = −4j K − W8−2 P = 0
1

G x(6) = 8
= X(3) − W8−0 X(7) = −j2.828 Q = F − W8−2 H = −2.828 − j2.828 −3
1

H x(7) = 8
L − W8 Q = 0

x(n) = {1, 1, 1, 1, 0, 0, 0, 0}.

Example 2.18: If x(n) = {1, 2, 0, 1} and y(n) = {1, 3, 3, 1} obtain z(n) = x(n) ⊗4 y(n) using
DIT-FFT algorithm.

 Solution:
68 Module-2
A
x(0) X(0)

B
x(2) X(1)
w40
C
x(1) X(2)
w40
D
x(3) X(3)
w40 w41

A
y(0) Y(0)

B
y(2) Y(1)
w40
C
y(1) Y(2)
w40
D
y(3) Y(3)
w40 w41

A 1/4
Z(0) z(0)

B 1/4
Z(1) z(2)
-0
w4
C 1/4
Z(2) z(1)
w4-0
D 1/4
Z(3) z(3)
w4-1 w4-0

(i) N/2 twiddle factors. Here N = 4


(ii) Number of stages = log2 N = log2 4 = log2 22 = 2 log2 2 = 2 × 1 = 2.
(iii) X(k) :

A = x(0) + W40 x(2) = 1 X(0) = A + W40 C = 4


B = x(0) − W40 x(2) = 1 X(1) = B + W41 D = 1 − j
C = x(1) + W40 x(3) = 3 X(2) = A − W40 C = −2
D = x(1) − W40 x(3) = 1 X(3) = B − W41 D = 1 + j

(iv) Y (k) :
Digital Signal Processing 69

A = y(0) + W40 y(2) = 4 Y (0) = A + W40 C = 8


B = y(0) − W40 y(2) = −2 Y (1) = B + W41 D = −2 − 2j
C = y(1) + W40 y(3) = 4 Y (2) = A − W40 C = 0
D = y(1) − W40 y(3) = 2 Y (3) = B − W41 D = −2 + 2j
(v) Z(k) = X(k) × Y (k) = {32, −4, 0, −4}. (vi) z(n) :

A = Z(0) + Z(2) = 32 z(0) = 14 [A + B] = 6


B = Z(1) + Z(3) = −8 z(2) = 14 [A − B]W4−0 = 10
C = [Z(0) − Z(2)]W4−0 = 32 z(1) = 14 [C + D] = 8
D = [Z(1) − Z(3)]W4−1 = 0 z(3) = 14 [C − D]W4−0 = 8

z(n) = x(n) ⊗4 y(n) = {6, 8, 10, 8}.

Example 2.19: If x(n) = {1, 1, 1, 1} and y(n) = {1, 0, 1, 0} obtain z(n) = x(n) ⊗4 y(n) using
DIF-FFT algorithm.

 Solution:

(i) N/2 twiddle factors. Here N = 4


(ii) Number of stages = log2 N = log2 4 = log2 22 = 2 log2 2 = 2 × 1 = 2.
(iii) X(k) :
A = x(0) + x(2) = 2 X(0) = [A + B] = 4
B = x(1) + x(3) = 2 X(2) = [A − B]W40 = 0
C = [x(0) − x(2)]W40 = 0 X(1) = [C + D] = 0
D = [x(1) − x(3)]W41 = 0 X(3) = [C − D]W40 = 0
(iv) Y (k) :

A = y(0) + y(2) = 2 Y (0) = [A + B] = 2


B = y(1) + y(3) = 0 Y (2) = [A − B]W40 = 2
C = [y(0) − y(2)]W40 = 0 Y (1) = [C + D] = 0
D = [y(1) − y(3)]W41 = 0 Y (3) = [C − D]W40 = 0
70 Module-2

(v) Z(k) = X(k) × Y (k) = {8, 0, 0, 0}.


(vi) z(n) :
A = Z(0) + W4−0 Z(2) = 8 z(0) = 14 [A + W4−0 C] = 2
B = Z(0) − W4−0 Z(2) = 8 z(1) = 14 [B + W4−1 D] = 2
C = Z(1) + W4−0 Z(3) = 0 z(2) = 14 [C + W4−0 D] = 2
D = Z(1) − W4−0 Z(3) = 0 z(3) = 14 [C − W4−1 D] = 2

A
x(0) X(0)

B
x(1) X(2)
w40
C
x(2) X(1)
w40 w40
D
x(3) X(3)
w41

A
y(0) Y(0)

B
y(1) Y(2)
w40
C
y(2) Y(1)
w40 w40
D
y(3) Y(3)
w41

Z(0)
A 1/4
z(0)

B 1/4
Z(2) z(1)
w4-0

Z(1)
C 1/4 z(2)
w4-0

Z(3)
D 1/4 z(3)
w4-0 -1
w4

z(n) = x(n) ⊗4 y(n) = {2, 2, 2, 2}.


Digital Signal Processing 71

Example 2.20: Let x(n) = {1, 1/2, 1/4, 1/8} and y(n) = {1, 1, 1, 1}. Compute the DFT
of x(n) by the decimation in time FFT algorithm and that of y(n) by the decimation in
frequency FFT algorithm. Using the above results, evaluate the circular convolution of x(n)
and y(n).

 Solution:

(i) N/2 twiddle factors. Here N = 4


(ii) Number of stages = log2 N = log2 4 = log2 22 = 2 log2 2 = 2 × 1 = 2.

(iii) X(k) :

5 15
A = x(0) + W40 x(2) = 4 X(0) = A + W40 C = 8
3 3
B = x(0) − W40 x(2) = 4 X(1) = B + W41 D = 4 + j 38
5 5
C = x(1) + W40 x(3) = 8 X(2) = A − W40 C = 8
3 3
D = x(1) − W40 x(3) = 8 X(3) = B − W41 D = 4 − j 38

(iv) Y (k) :

A = y(0) + y(2) = 2 Y (0) = [A + B] = 4


B = y(1) + y(3) = 2 Y (2) = [A − B]W40 = 0
C = [y(0) − y(2)]W40 = 0 Y (1) = [C + D] = 0
D = [y(1) − y(3)]W41 = 0 Y (3) = [C − D]W40 = 0

(v) Z(k) = X(k) × Y (k) = {15/2, 0, 0, 0}.


(vi) z(n) :

15
A = Z(0) + Z(2) = 2 z(0) = 14 [A + B] = 15
8
B = Z(1) + Z(3) = 0 z(2) = 14 [A − B]W4−0 = 15
8
C = [Z(0) − Z(2)]W4−0 = 15
2 z(1) = 14 [C + D] = 15
8
D = [Z(1) − Z(3)]W4−1 = 0 z(3) = 14 [C − D]W4−0 = 15
8

z(n) = x(n) ⊗4 y(n) = {15/8, 15/8, 15/8, 15/8}.


72 Module-2

A
x(0) X(0)

B
x(2) X(1)
w40
C
x(1) X(2)
w40
D
x(3) X(3)
w40 w41

A
y(0) Y(0)

B
y(1) Y(2)
w40
C
y(2) Y(1)
w40 w40
D
y(3) Y(3)
w41

A 1/4
Z(0) z(0)

B 1/4
Z(1) z(2)
-0
w4
C 1/4
Z(2) z(1)
w4-0
D 1/4
Z(3) z(3)
-0
w4-1 w4

Example 2.21: Using DIF-FFT algorithm compute DFT of the sequence, x(n) =
{1, 2, −1, 2, 4, 2, −1, 2}. If y(n) = x(−n) without performing FFT, find Y (k) using X(k).

 Solution:
Given, x(0) = 1, x(1) = 2, x(2) = −1, x(3) = 2, x(4) = 4, x(5) = 2, x(6) = −1, x(7) = 2.
Digital Signal Processing 73

A = x(0) + x(4) = 5 I =A+C =3 X(0) = I + J = 11


B = x(1) + x(5) = 4 J =B+D =8 X(4) = (I − J)W80 = −5
C = x(2) + x(6) = −2 K = [A − C]W80 = 7 X(2) = K + L = 7
D = x(3) + x(7) = 4 L = [B − D]W82 =0 X(6) = (K − L)W80 = 7
E = [x(0) − x(4)]W80 = −3 M = E + G = −3 X(1) = M + N = −3
F = [x(1) − x(5)]W81 = 0 N =F +H =0 X(5) = (M − N )W80 = −3
G = [x(2) − x(6)]W82 = 0 P = [E − G]W80 = −3 X(3) = P + Q = −3
H = [x(3) − x(7)]W83 = 0 Q = [F − H]W82 = 0 X(7) = (P − Q)W80 = −3

A I
x(0) X(0)

B J
x(1) X(4)
w80
C K
x(2) X(2)
w80
D L
x(3) X(6)
w82 w8 0
E M
x(4) X(1)
0
w8
F N
x(5) X(5)
w8 1 w8 0
G P
x(6) X(3)
w8 2
w80
H Q
x(7) X(7)
w8 3
w82 w8 0

11

-3 -3

7 7 X(k)
X((-k))8
-3 -3
-5

X(k) = {11, −3, 7, −3, −5, −3, 7, −3}.


To obtain the DFT of y(n) = x(−n)
x(−n) is basically circularly folded sequence.
∴ y(n) = x((−n))N
74 Module-2

Using the circular time reversal property of DFT


DF T
x((−n))N −→ X((−k))N

∴ Y (k) = X((−k))N = {11, −3, 7, −3, −5, −3, 7, −3}.

Example 2.22: First five points of eight point DFT of a real valued sequence is given by,
X(k) = {0, 2 + 2j, −4j, 2 − 2j, 0}. Determine the remaining points. Hence find the sequence
x(n) using DIF-FFT algorithm.

 Solution:
Given, X(k) = {0, 2 + 2j, −4j, 2 − 2j, 0}
X(0) = 0, X(1) = 2 + 2j, X(2) = −4j, X(3) = 2 − 2j, X(4) = 0.

X(5) = X(3)∗ = 2 + 2j
X(6) = X(2)∗ = 4j
X(7) = X(1)∗ = 2 − 2j
X(k) = {0, 2 + 2j, −4j, 2 − 2j, 0, 2 + 2j, 4j, 2 − 2j}.

*
X(1) X(3) X(4) X(5) X(7)
X(0) X(2) X(6)

*
*

X(0) = 0, X(1) = 2 + 2j, X(2) = −4j, X(3) = 2 − 2j, X(4) = 0, X(5) = 2 + 2j, X(6) =
4j, X(7) = 2 − 2j.

(i) N/2 twiddle factors. Here N = 8


8
∴ = 4 twiddle factors. W8−0 = 1; W8−1 = 0.707 + j0.707; W8−2 = j; W8−3 = −0.707 + j0.707
2
(ii) Input is bit reversed and output is normal.
(iii) Butterfly operation
Digital Signal Processing 75
A I 1/8 x(0)
X(0)

B J 1/8 x(1)
X(4)
-0
w8
C K 1/8 x(2)
X(2)
w8-0
D L 1/8 x(3)
X(6)
w8-0 w8-2
E M 1/8 x(4)
X(1)
w8-0
F N 1/8 x(5)
X(5)
w8 -0
w8-1
G P 1/8 x(6)
X(3)
w8-0 w8-2
H Q 1/8 x(7)
X(7)
w8-0 w8-2 w8-3

a c=a+Wn-rb

b d=a-Wn-rb

(iv) Number of stages = log2 N = log2 8 = log2 23 = 3 log2 2 = 3 × 1 = 3.

A = X(0) + W8−0 X(4) = 0 I = A + W8−0 C = 0 I + W8−0 M = 1


1

x(0) = 8
B = X(0) − W8−0 X(4) = 0 J = B + W8−2 D = 8 J + W8−1 N = 1
1

x(1) = 8
= X(2) + W8−0 X(6) = 0 K = A − W8−0 C = 0 K + W8−2 P = −1
1

C x(2) = 8
= X(2) − W8−0 X(6) = −8j L = B − W2−2 D = −8 L + W8−3 Q = −1
1

D x(3) = 8
= X(1) + W8−0 X(5) = 4 + 4j M = E + W8−0 G = 8 I − W8−0 M = −1
1

E x(4) = 8
= X(1) − W8−0 X(5) = 0 N = F + W8−2 H = 0 J − W8−1 N = 1
1

F x(5) = 8
= X(3) + W8−0 X(7) = 4 − 4j P = E − W8−0 G = 8j K − W8−2 P = 1
1

G x(6) = 8
= X(3) − W8−0 X(7) = 0 Q = F − W8−2 H = 0 −3
1

H x(7) = 8
L − W8 Q = −1

x(n) = {1, 1, −1, −1, −1, 1, 1, −1}.

Example 2.23: Bring out differences between linear convolution and circular convolution.

 Solution:
76 Module-2

Linear convolution Circular convolution


(i) length of sequences may not be equal length of sequences must be equal
(ii) Resultant sequence: N = N1 + N2 − 1 Resultant sequence: N = N1 = N2
(iii) Shift is linear Shift is circular
(iv) Aliasing is not present Aliasing is present

X N
X −1
(v) y(n) = x(n)h(n − k) y(n) = x(n)h(n − k)
n=−∞ k=0

Example 2.23: Bring out differences between DIT-FFT and DIF-FFT.

 Solution:

DIT-FFT DIF-FFT
(i) Reducing samples in time do- Reducing samples in fre-
main quency domain
(ii) Input is bit reversed while the Input is in natural order while
output is in normal order the output is bit reversed.
(iii) Splits the two DFTs into even Splits the two DFTs into first
and odd indexed input sam- half and last half of the input
ples samples
(iv) Multiplication is done before Multiplication is done after
addition addition
(v) Butterflies are defined on the Butterflies are defined on the
last pass of FFT first pass of FFT

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy