0% found this document useful (0 votes)
63 views29 pages

MM 2

Uploaded by

sowmyag137
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)
63 views29 pages

MM 2

Uploaded by

sowmyag137
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/ 29

Digital Signal Processing 17EE63

DIGITAL SIGNAL PROCESSING

MODULE 2:
FAST FOURIER TRANSFORMS ALGORITHMS: Introduction, decimation in time
algorithm, first decomposition, number of computations, continuation of decomposition,
Number of multiplications, computational efficiency, decimation in frequency algorithms,
algorithm, inverse decimation in time and inverse decimation in frequency
algorithms,
decomposition for a composite number N=9.

Department of EEE, GMIT Page 1


Availaible at: VTU HUB (Android App)
Digital Signal Processing 17EE63

FAST FOURIER TRANSFORMS (FFT) ALOGORITHMS

CONTENTS:-

1. FAST-FOURIER-TRANSFORM (FFT) ALGORITHMS

2. DIRECT COMPUTATION OF DFT,

3. NEED FOR EFFICIENT COMPUTATION OF THE DFT (FFT ALGORITHMS).

RECOMMENDED READINGS

1. DIGITAL SIGNAL PROCESSING – PRINCIPLES ALGORITHMS & APPLICATIONS, PROAKIS &

MONALAKIS, PEARSON EDUCATION, 4TH EDITION, NEW DELHI, 2007.

2. DISCRETE TIME SIGNAL PROCESSING, OPPENHEIM & SCHAFFER, PHI, 2003.

3. DIGITAL SIGNAL PROCESSING, S. K. MITRA, TATA MC-GRAW HILL, 2ND EDITION, 2004.

Department of EEE, GMIT Page 2

Availaible at: VTU HUB (Android App)


Digital Signal Processing 17EE63

FAST-FOURIER-TRANSFORM (FFT) ALGORITHMS

3.1 Direct Computation of DFT


The problem:
Given signal samples: x[0], . . . , x[N - 1] (some of which may be zero), develop a procedure
to compute

for k = 0, . . . , N - 1 where

We would like the procedure to be fast, simple, and accurate. Fast is the most important, so we
will sacrifice simplicity for speed, hopefully with minimal loss of accuracy

3.2 Need for efficient computation of DFT (FFT Algorithms)

Let us start with the simple way. Assume that has been precompiled and stored in a

table for the N of interest. How big should the table be? is periodic in m with period N,
so we just need to tabulate the N values:

(Possibly even less since Sin is just Cos shifted by a quarter periods, so we could save just Cos
when N is a multiple of 4.)
Why tabulate? To avoid repeated function calls to Cos and sin when computing the DFT. Now
we can compute each X[k] directly from the formula as follows

For each value of k, there are N complex multiplications, and (N-1) complex additions. There
are N values of k, so the total number of complex operations is

Department of EEE, GMIT Page 3

Availaible at: VTU HUB (Android App)


Digital Signal Processing 17EE63

Complex multiplies require 4 real multiplies and 2 real additions, whereas complex additions
require just 2 real additions N2 complex multiplies are the primary concern.
N2 increases rapidly with N, so how can we reduce the amount of computation? By exploiting
the following properties of W:

The first and third properties hold for even N, i.e., when 2 is one of the prime factors of N.
There are related properties for other prime factors of N.

Divide and conquer approach

We have seen in the preceding sections that the DFT is a very computationally
intensive operation. In 1965, Cooley and Tukey published an algorithm that could be used to
compute the DFT much more efficiently. Various forms of their algorithm, which came to be
known as the Fast Fourier Transform (FFT), had actually been developed much earlier by
other mathematicians (even dating back to Gauss). It was their paper, however, which
stimulated a revolution in the field of signal processing.

It is important to keep in mind at the outset that the FFT is not a new transform. It is
simply a very efficient way to compute an existing transform, namely the DFT. As we saw, a
straight forward implementation of the DFT can be computationally expensive because the
number of multiplies grows as the square of the input length (i.e. N2 for an N point DFT). The
FFT reduces this computation using two simple but important concepts. The first concept,
known as divide-and-conquer, splits the problem into two smaller problems.
The second concept, known as recursion, applies this divide-and-conquer method
repeatedly until the problem is solved.

Department of EEE, GMIT Page 4

Availaible at: VTU HUB (Android App)


Digital Signal Processing 17EE63

Recommended Questions with solutions

1. A designer has available a number of eight point FFT chips. Show explicity how he

should interconnect three such chips in order to compute a 24-point DFT.

Solution:-

2. Let x(n) be a real valued N-point (N=2) sequence. Develop a method to compute
An N-Point DFT X1(k), which contains only the odd harmonics by using only a
Real N/2 points DFT.

Solution:-

Department of EEE, GMIT Page 5

Availaible at: VTU HUB (Android App)


Digital Signal Processing 17EE63

3. The Z-Transform of the Sequence x(n) = u(n) –u(n-7) is sampled at five points on

The unit circle as follows. X(k) = X(z) = ej2πk/5 k= 0,1,2,3,4

Solution:-

Department of EEE, GMIT Page 6

Availaible at: VTU HUB (Android App)


Digital Signal Processing 17EE63

FAST FOURIER TRANSFORMS (FFT) ALOGORITHMS

CONTENTS:-

1. RADIX-2 FFT ALGORITHM FOR THE COMPUTATION OF DFT AND IDFT

2. DECIMATION-IN-TIME AND DECIMATION-IN-FREQUENCY ALGORITHMS.

3. GOERTZEL ALGORITHM,

4. CHIRP-Z TRANSFORM

RECOMMENDED READINGS

1. DIGITAL SIGNAL PROCESSING – PRINCIPLES ALGORITHMS & APPLICATIONS, PROAKIS &

MONALAKIS, PEARSON EDUCATION, 4TH EDITION, NEW DELHI, 2007.

2. DISCRETE TIME SIGNAL PROCESSING, OPPENHEIM & SCHAFFER, PHI, 2003.

3. DIGITAL SIGNAL PROCESSING, S. K. MITRA, TATA MC-GRAW HILL, 2ND EDITION, 2004.

Department of EEE, GMIT Page 7

Availaible at: VTU HUB (Android App)


Digital Signal Processing 17EE63

RADIX-2 FFT ALGORITHM FOR THE COMPUTATION OF DFT AND


IDFT
4.1 Introduction:
Standard frequency analysis requires transforming time-domain signal to frequency
domain and studying Spectrum of the signal. This is done through DFT computation. N-point
DFT computation results in N frequency components. We know that DFT computation
through FFT requires N/2 log2N complex multiplications and N log2N additions. In certain
applications not all N frequency components need to be computed (an application will be
discussed). If the desired number of values of the DFT is less than 2 log2N than direct
computation of the desired values is more efficient that FFT based computation.
4.2 Radix-2 FFT
Useful when N is a power of 2: N = rv for integers r and v. ‘r’ is called the radix, which
comes from the Latin word meaning .a root, and has the same origins as the word radish.
When N is a power of r = 2, this is called radix-2, and the natural .divide and conquer
approach. is to split the sequence into two sequences of length N=2. This is a very clever trick
that goes back many years.
4.2.1 Decimation in time

Fig 4.1 First step in Decimation-in-time domain Algorithm

Department of EEE, GMIT Page 8

Availaible at: VTU HUB (Android App)


Digital Signal Processing 17EE63

Department of EEE, GMIT Page 9


Availaible at: VTU HUB (Android App)
4.2.2 Decimation-in-frequency Domain

Another important radix-2 FFT algorithm, called decimation-in-frequency algorithm is


obtained by using divide-and-conquer approach with the choice of M=2 and L= N/2.This
choice of data implies a column-wise storage of the input data sequence. To derive the
algorithm, we begin by splitting the DFT formula into two summations, one of which involves
the sum over the first N/2 data points and the second sum involves the last N/2 data points.
Thus we obtain

Now, let us split X(k) into the even and odd-numbered samples. Thus we obtain

Department of EEE, GMIT


Availaible at: VTU HUB (Android App)
Fig 4.2 Shuffling of Data and Bit reversal

The computation of the sequences g1 (n) and g2 (n) and subsequent use of these
sequences to compute the N/2-point DFTs depicted in fig we observe that the basic
computation in this figure involves the butterfly operation.

Availaible at: VTU HUB (Android App)


The computation procedure can be repeated through decimation of the N/2-point DFTs,
X(2k) and X(2k+1). The entire process involves v = log2 N of decimation, where each stage
involves N/2 butterflies of the type shown in figure 4.3.

Fig 4.3 First step in Decimation-in-time domain Algorithm

Availaible at: VTU HUB (Android App)


Fig 4.4 N=8 point Decimation-in-frequency domain Algorithm
4.2 Example: DTMF – Dual Tone Multi frequency
This is known as touch-tone/speed/electronic dialing, pressing of each button generates a
unique set of two-tone signals, called DTMF signals. These signals are processed at exchange
to identify the number pressed by determining the two associated tone frequencies. Seven
frequencies are used to code the 10 decimal digits and two special characters (4x3 array)

Availaible at: VTU HUB (Android App)


In this application frequency analysis requires determination of possible seven (eight)
DTMF fundamental tones and their respective second harmonics .For an 8 kHz sampling freq,
the best value of the DFT length N to detect the eight fundamental DTMF tones has been
found to be 205 .Not all 205 freq components are needed here, instead only those
corresponding to key frequencies are required. FFT algorithm is not effective and efficient in
this application. The direct computation of the DFT which is more effective in this application
is formulated as a linear filtering operation on the input data sequence.

This algorithm is known as Goertzel Algorithm

This algorithm exploits periodicity property of the phase factor. Consider the DFT definition
N 1
X (k )   x(n)W
N (1)
nk
n0
 kN
W N
Since is equal to 1, multiplying both sides of the equation by this results in;
N 1 N 1
 kN mk
(k ) WN
X  x( m)W N
  x (m )W k ( N m)
N (2)
m0 m0

yk (n)  x(n)  hk (n)


This is in the form of a convolution
N 1
yk (n)   x(m)WN kk (3)
( nk m)
m0

Where yk(n) is the out put of a filter which has impulse response of hk(n) and input x(n).

The output of the filter at n = N yields the value of the DFT at the freq ωk = 2πk/N

The filter has frequency response given by


1
Hk ( z)  (6)
1  WN k z 1

The above form of filter response shows it has a pole on the unit circle at the frequency ωk =
2πk/N.

Entire DFT can be computed by passing the block of input data into a parallel bank of N
single-pole filters (resonators)

Availaible at: VTU HUB (Android App)


The above form of filter response shows it has a pole on the unit circle at the frequency ωk =
2πk/N.

Entire DFT can be computed by passing the block of input data into a parallel bank of N
single-pole filters (resonators)

1.3 Difference Equation implementation of filter:

From the frequency response of the filter (eq 6) we can write the following difference
equation relating input and output;
Y ( z) 1
H k ( z)  k   k 1
X ( z) 1  WN z
k
y (n)  W  y (n  1)  x(n) y k (1)  0 (7)
k N k

The desired output is X(k) = yk(n) for k = 0,1,…N-1.

The phase factor appearing in the difference equation can be computed once and stored.

The form shown in eq (7) requires complex multiplications which can be avoided doing
suitable modifications (divide and multiply by 1  WNk z 1 ). Then frequency response of the
filter can be alternatively expressed as
1W N z
k 1
Hk ( z)  (8)
1  2 cos(2
2
k / N ) z 1  z

This is second –order realization of the filter (observe the denominator now is a second-order
expression). The direct form realization of the above is given by
vk (n)  2 cos(2k / N )vk (n 1)  vk (n  2)  (9)
x(n)
yk (n)  vk (n)  WkN vk (n 1) vk (1)  vk (2)  0 (10)

Availaible at: VTU HUB (Android App)


The recursive
relation in (9) is iterated for n = 0,1,……N, but the equation in (10) is computed only once at
time n =N. Each iteration requires one real multiplication and two additions. Thus, for a real
input sequence x(n) this algorithm requires (N+1) real multiplications to yield X(k) and X(N-
k) (this is due to symmetry). Going through the Goertzel algorithm it is clear that this
algorithm is useful only when M out of N DFT values need to be computed where M≤ 2log2N,
Otherwise, the FFT algorithm is more efficient method. The utility of the algorithm completely
depends on the application and number of frequency components we are looking for.

4.2. Chirp z- Transform

4.2.1 Introduction:

Computation of DFT is equivalent to samples of the z-transform of a finite-length


sequence at equally spaced points around the unit circle. The spacing between the samples is
given by 2π/N. The efficient computation of DFT through FFT requires N to be a highly
composite number which is a constraint. Many a times we may need samples of z-transform
on contours other than unit circle or we my require dense set of frequency samples over a
small region of unit circle. To understand these let us look in to the following situations:

1. Obtain samples of z-transform on a circle of radius ‘a’ which is concentric to unit circle
The possible solution is to multiply the input sequence by a-n
2. 128 samples needed between frequencies ω = -π/8 to +π/8 from a 128 point sequence
From the given specifications we see that the spacing between the frequency samples is
π/512 or 2π/1024. In order to achieve this freq resolution we take 1024- point FFT of
the given 128-point seq by appending the sequence with 896 zeros. Since we need

Availaible at: VTU HUB (Android App)


only 128 frequencies out of 1024 there will be big wastage of computations in this
scheme.

For the above two problems Chirp z-transform is the alternative.

Chirp z- transform is defined as:


N 1
X ( )   x(n) kz k  0,1,......L (11)
zk k n 1
n0

Availaible at: VTU HUB (Android App)


Note that,

a. if R0< 1 the points fall on a contour that spirals toward the origin

b. If R0 > 1 the contour spirals away from the origin

c. If R0= 1 the contour is a circular arc of radius

d.If r0=1 and R0=1 the contour is an arc of the unit circle.

(Additionally this contour allows one to compute the freq content of the sequence x(n) at
dense set of L frequencies in the range covered by the arc without having to compute a large
DFT (i.e., a DFT of the sequence x(n) padded with many zeros to obtain the desired resolution
in freq.))

e. If r0= R0=1 and θ0=0 Φ0=2π/N and L = N the contour is the entire unit circle similar to the
standard DFT. These conditions are shown in the following diagram.

Availaible at: VTU HUB (Android App)


Substituting the value of zk in the expression of X(zk)
N 1 N 1
X ( zk )  x(n) zk  x(n)(r0e j0 )nW nk
n0  n
(13)
 n0

where W  R0 e (14)
j0

4.2.2 Expressing computation of X(zk) as linear filtering operation:


By substitution of
1 2 2 2
nk  (n  k  (k  n) (15)
)
2
we can express X(zk) as

X (zk )  W  k
2
/2
y(k )  y(k ) / k  0,1,..........L (16)
h(k ) 1
Where
2 j 0  n n2 /
n /2
h(n)  W g(n)  x(n)(r0 e ) W
N 1
y(k )   g (n)h(k  (17)
n)
n0
both g(n) and h(n) are complex valued sequences

4.2.3 Why it is called Chirp z-transform?

If R0 =1, then sequence h(n) has the form of complex exponential with argument ωn =

Availaible at: VTU HUB (Android App)


n2Φ0/2 = (n Φ0/2) n. The quantity (n Φ0/2) represents the freq of the complex exponential

Availaible at: VTU HUB (Android App)


signal, which increases linearly with time. Such signals are used in radar systems are called
chirp signals. Hence the name chirp z-transform.

4.2.4 How to Evaluate linear convolution of eq (17)


1. Can be done efficiently with FFT
2. The two sequences involved are g(n) and h(n). g(n) is finite length seq of length N and
h(n) is of infinite duration, but fortunately only a portion of h(n) is required to compute
L values of X(z), hence FFT could be still be used.
3. Since convolution is via FFT, it is circular convolution of the N-point seq g(n) with an
M- point section of h(n) where M > N

4. The concepts used in overlap –save method can be used


5. While circular convolution is used to compute linear convolution of two sequences we
know the initial N-1 points contain aliasing and the remaining points are identical to
the result that would be obtained from a linear convolution of h(n) and g(n), In view of
this the DFT size selected is M = L+N-1 which would yield L valid points and N-1
points corrupted by aliasing. The section of h(n) considered is for –(N-1) ≤ n≤ (L-1)
yielding total length M as defined
6. The portion of h(n) can be defined in many ways, one such way is,

h1(n) = h(n-N+1) n = 0,1,…..M-1


7. Compute H1(k) and G(k) to obtain

Y1(k) = G(K)H1(k)
8. Application of IDFT will give y1(n), for

Availaible at: VTU HUB (Android App)


n =0,1,…M-1. The starting N-1 are discarded and desired values are y1(n) for

N-1 ≤n ≤ M-1 which corresponds to the range 0 ≤n ≤ L-1 i.e.,

y(n)= y1(n+N-1) n=0,1,2,…..L-1


9. Alternatively h2(n) can be defined as
h2 (n)  h(n) 0nL1
 h(n  ( N  L  LnM 1
1))
10. Compute Y2(k) = G(K)H2(k), The desired values of y2(n) are in the range

0 ≤n ≤L-1 i.e.,

y(n) = y2(n) n=0,1,….L-1


11. Finally, the complex values X(zk) are computed by dividing y(k) by h(k)
For k =0,1,……L-1

4.3 Computational complexity


In general the computational complexity of CZT is of the order of M log2M complex
multiplications. This should be compared with N.L which is required for direct evaluation.
If L is small direct evaluation is more efficient otherwise if L is large then CZT is more
efficient.

4.3.1 Advantages of CZT

a. Not necessary to have N =L

b.Neither N or L need to be highly composite

c.The samples of Z transform are taken on a more general contour that includes the unit
circle as a special case.

4.4 Example to understand utility of CZT algorithm in freq analysis

(ref: DSP by Oppenheim Schaffer)

CZT is used in this application to sharpen the resonances by evaluating the z-transform
off the unit circle. Signal to be analyzed is a synthetic speech signal generated by exciting a
five-pole system with a periodic impulse train. The system was simulated to correspond to a
sampling freq. of 10 kHz. The poles are located at center freqs of 270,2290,3010,3500 & 4500
Hz with bandwidth of 30, 50, 60,87 & 140 Hz respectively.

Availaible at: VTU HUB (Android App)


Solution: Observe the pole-zero plots and corresponding magnitude frequency response for
different choices of |w|. The following observations are in order:

• The first two spectra correspond to spiral contours outside the unit circle with a resulting
broadening of the resonance peaks
• |w| = 1 corresponds to evaluating z-transform on the unit circle
• The last two choices correspond to spiral contours which spirals inside the unit circle and
close to the pole locations resulting in a sharpening of resonance peaks.

Availaible at: VTU HUB (Android App)


4.5 Implementation of CZT in hardware to compute the DFT signals
The block schematic of the CZT hardware is shown in down figure. DFT computation
requires r0 =R0 =1, θ0 = 0 Φ0 = 2π/N and L = N.

The cosine and sine sequences in h(n) needed for pre multiplication and post multiplication are
usually stored in a ROM. If only magnitude of DFT is desired, the post multiplications are
unnecessary,

In this case |X(zk)| = |y(k)| k =0,1,….N-1

Availaible at: VTU HUB (Android App)


Recommended Questions with solutions

1. Draw the flow graph for the decimation in frequency (DIF) SRFFT algorithm for
N=16. What is the number of nontrivial multiplications?

Solution :- There are 20 real , non trial multiplications

Figure 4.1 DIF Algorithm for N=16

Availaible at: VTU HUB (Android App)


2. Explain how the DFT can be used to compute N equispaced samples of the Z-
transform, of an N-point sequence, on a circle of radius r.

Solution:-

Q3.

Solution:-

Availaible at: VTU HUB (Android App)


4. Develop a radix-3 decimation-in-time FFT algorithm for N=3 and draw the corres
Ponding flow graph for N=9. What is the number of required complex
multiplications? Can the operations be performed in place.

Solution:-

5. Determine the system function H(z) and the Difference equation for the system
That uses the geortzel algorithm to compute the DFT value X(N-k).
Solution:-

Availaible at: VTU HUB (Android App)


This can be viewed as the convolution of the N-length sequence x(n) with implulse
response of a linear filter

Availaible at: VTU HUB (Android App)


Digital Signal Processing 17EE63

Availaible at: VTU HUB (Android App)

You might also like