Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
76 views

FFT Module

This document discusses the radix-2 FFT algorithm for computing the discrete Fourier transform (DFT) and inverse DFT. It specifically addresses: 1) The radix-2 FFT algorithm is useful when N is a power of 2, allowing the sequence to be split into two sequences of length N/2 through a "divide and conquer" approach. 2) The algorithm can be implemented using either a decimation-in-time or decimation-in-frequency approach. 3) An example application is given for DTMF tone detection, where direct computation of the DFT using the Goertzel algorithm is more efficient than the FFT for determining the 8 fundamental tones from a signal

Uploaded by

Ramya C.N.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

FFT Module

This document discusses the radix-2 FFT algorithm for computing the discrete Fourier transform (DFT) and inverse DFT. It specifically addresses: 1) The radix-2 FFT algorithm is useful when N is a power of 2, allowing the sequence to be split into two sequences of length N/2 through a "divide and conquer" approach. 2) The algorithm can be implemented using either a decimation-in-time or decimation-in-frequency approach. 3) An example application is given for DTMF tone detection, where direct computation of the DFT using the Goertzel algorithm is more efficient than the FFT for determining the 8 fundamental tones from a signal

Uploaded by

Ramya C.N.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Smartworld.

asia 1

Digital Signal Processing 10EC52

UNIT 4
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

Dept., of ECE/SJBIT Page 36


Smartworld.asia 2

Digital Signal Processing 10EC52

Dept., of ECE/SJBIT Page 37


Smartworld.asia 3

Digital Signal Processing 10EC52

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

Dept., of ECE/SJBIT Page 38


Smartworld.asia 4

Digital Signal Processing 10EC52

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.

Dept., of ECE/SJBIT Page 39


Smartworld.asia 5

Digital Signal Processing 10EC52

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

Dept., of ECE/SJBIT Page 40


Smartworld.asia 6

Digital Signal Processing 10EC52

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)

Dept., of ECE/SJBIT Page 41


Smartworld.asia 7

Digital Signal Processing 10EC52

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)WNnk (1)
n 0

WN kN
Since is equal to 1, multiplying both sides of the equation by this results in;
N 1 N 1
X (k )  WN kN  x(m)WNmk   x(m)WN k ( N  m ) (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 ( n  m ) (3)
m 0

hk (n)  WN kn u (n) (4)

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
H k ( 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)

Dept., of ECE/SJBIT Page 42


Smartworld.asia 8

Digital Signal Processing 10EC52

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;

Yk ( z ) 1
H k ( z)  
X ( z ) 1  WN k z 1
y k (n)  WN k y k (n  1)  x(n) y k (1)  0 (7)

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  WNk z 1
H k ( z)  (8)
1  2 cos(2k / N ) z 1  z 2

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)  x(n) (9)


yk (n)  vk (n)  W v (n  1)
k
N k vk (1)  vk (2)  0 (10)

Dept., of ECE/SJBIT Page 43


Smartworld.asia 9

Digital Signal Processing 10EC52

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

Dept., of ECE/SJBIT Page 44


Smartworld.asia 10

Digital Signal Processing 10EC52

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
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 ( z k )   x(n) z k n k  0,1,......L  1 (11)
n 0

Where zk is a generalized contour. Zk is the set of points in the z-plane falling on an arc which
begins at some point z0 and spirals either in toward the origin or out away from the origin such
that the points {zk}are defined as,

z k  r0 e j 0 ( R0 e j0 ) k k  0,1,....L  1 (12)

Dept., of ECE/SJBIT Page 45


Smartworld.asia 11

Digital Signal Processing 10EC52

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.

Dept., of ECE/SJBIT Page 46


Smartworld.asia 12

Digital Signal Processing 10EC52

Substituting the value of zk in the expression of X(zk)


N 1 N 1
X ( z k )   x(n) z k n   x(n)( r0 e j 0 )  nW  nk (13)
n 0 n 0

where W  R0 e j0 (14)

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

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

X ( zk )  W  k y(k )  y(k ) / h(k ) k  0,1,..........L  1


2
/2
(16)
Where

h(n)  W n g (n)  x(n)( r0e j0 )  n W  n


2 2
/2 /2

N 1
y ( k )   g ( n) h( k  n) (17)
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 =
n2Φ0/2 = (n Φ0/2) n. The quantity (n Φ0/2) represents the freq of the complex exponential

Dept., of ECE/SJBIT Page 47


Smartworld.asia 13

Digital Signal Processing 10EC52

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,

Dept., of ECE/SJBIT Page 48


Smartworld.asia 14

Digital Signal Processing 10EC52

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

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  1)) L  n  M 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
Dept., of ECE/SJBIT Page 49
Smartworld.asia 15

Digital Signal Processing 10EC52

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.

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.

Dept., of ECE/SJBIT Page 50


Smartworld.asia 16

Digital Signal Processing 10EC52

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

Dept., of ECE/SJBIT Page 51


Smartworld.asia 17

Digital Signal Processing 10EC52

Recommended Questions with solutions

Question 1

Solution:-

Dept., of ECE/SJBIT Page 52


Smartworld.asia 18

Digital Signal Processing 10EC52

Question 2

Solution :- There are 20 real , non trial multiplications

Figure 4.1 DIF Algorithm for N=16

Dept., of ECE/SJBIT Page 53


Smartworld.asia 19

Digital Signal Processing 10EC52

Question 3

Solution:-

Question 4

Solution:-

Dept., of ECE/SJBIT Page 54


Smartworld.asia 20

Digital Signal Processing 10EC52

Question 5

Solution:-

Question 6

Solution:-

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

Dept., of ECE/SJBIT Page 55


Smartworld.asia 21

Digital Signal Processing 10EC52

Dept., of ECE/SJBIT Page 56


Smartworld.asia 22

Digital Signal Processing 10EC52

UNIT 5

IIR FILTER DESIGN

CONTENTS:-

IIR FILTER DESIGN: CHARACTERISTICS OF COMMONLY USED ANALOG FILTERS –


BUTTERWORTH AND CHEBYSHEVE FILTERS, ANALOG TO ANALOG FREQUENCY

TRANSFORMATIONS. 6 HRS

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.

Dept., of ECE/SJBIT Page 57

You might also like