0% found this document useful (0 votes)
23 views57 pages

Efficient Computation of DFT - 14 - 16

The document discusses the importance of efficient Discrete Fourier Transform (DFT) calculations in digital signal processing applications, including filtering and spectrum analysis. It introduces Fast Fourier Transform (FFT) techniques, particularly the Radix-2 algorithm, which reduces computational complexity significantly compared to direct DFT calculations. Additionally, it covers various methods for implementing FFT, including the use of divide and conquer strategies and the handling of complex data sequences.

Uploaded by

Aditya Kora
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)
23 views57 pages

Efficient Computation of DFT - 14 - 16

The document discusses the importance of efficient Discrete Fourier Transform (DFT) calculations in digital signal processing applications, including filtering and spectrum analysis. It introduces Fast Fourier Transform (FFT) techniques, particularly the Radix-2 algorithm, which reduces computational complexity significantly compared to direct DFT calculations. Additionally, it covers various methods for implementing FFT, including the use of divide and conquer strategies and the handling of complex data sequences.

Uploaded by

Aditya Kora
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/ 57

Department of Electronics and Communication

Engineering

Digital Signal Processing

ECN-312

DFT and its efficient


calculation algorithms
Need for efficient Discrete Fourier
Transform
DFT plays an important role in many applications of DSP:
• Linear Filtering
• Multi-rate Systems
• Correlation analysis
• Spectrum analysis

Studied till now:


1. DFT and IDFT calculations
2. DFT and IDFT properties
Filtering of long data sequences
• Overlap-save method
• Overlap-add method
Fast Fourier Transform
DFT and IDFT have very similar operations:

DFT

IDFT

x(n) is assumed to be complex


Recap: No. of complex multiplications for each data: N
No. of complex additions for each data: N-1
Fast Fourier Transform
Computationally efficient techniques to
calculate DFT:

1. Fast Fourier transforms:


Divide and Conquer technique. DFT of size N
is broken into smaller DFTs. N should be
power of 2 or 4.

1. Linear filtering approach:


(a) Goertzel algorithm
(b) Chirp-Z algorithm
Fast Fourier Transform
Fast Fourier transform takes advantage of
following two properties :

Divide and conquer approach:


Computation of N-point DFT, where

If N is prime number, we can use zero-padding


for achieving factorization!
Fast Fourier Transform
Fast Fourier Transform
Arrangement-1
Fast Fourier Transform
Arrangement-2
Fast Fourier Transform
DFT values can also be stored in similar setting.

Row-wise
Column-wise
Lets assume we are using row-wise storage for X
but column-wise operation on x:
Fast Fourier Transform

Above expression contains calculations of two


DFTs of length M and L!
Fast Fourier Transform
1. M-point DFT for each row l=0 to L-1.

2. Compute a new rectangular array:

3. L-point DFTs
Complexity computation
Step-1:
Addition:
Multiplications:
Step-2: Multiplications:
Step-3:

Originally,
Calculate for N=100.
L=4 M=25!
Fast Fourier Transform
When N is highly composite:

Above decomposition can be repeated v-1 times.


Usage of divide and Conquer scheme:
Radix-N method

Radix-2 algorithm:
Lets consider apply the divide and conquer technique

,
Radix-2 FFT Technique
Radix-2 FFT Technique

Periodicity property!!
Radix-2 FFT Technique

Complex Multiplication:
Radix-2 FFT Technique
Radix-2 FFT Technique
Radix-2 FFT Technique

Calculate total no. of complex multiplications:


Similar reduction can be performed
Radix-2 FFT Technique
Total number of multiplications reduce to

Example of 8-point FFT!


Reduction in complexity for Radix-2
No. of
algorithm
computation complex Complex complex Complex
points multiplication additions Total multiplication additions Total A/B
N N^2 N^2-N A (N/2)log2(N) (N)log2(N) B
8 64 56 120 12.00 24.00 36.00 3.33
16 256 240 496 32.00 64.00 96.00 5.17
32 1024 992 2016 80.00 160.00 240.00 8.40
64 4096 4032 8128 192.00 384.00 576.00 14.11
128 16384 16256 32640 448.00 896.00 1344.00 24.29
256 65536 65280 130816 1024.00 2048.00 3072.00 42.58
512 262144 261632 523776 2304.00 4608.00 6912.00 75.78
1024 1048576 1047552 2096128 5120.00 10240.00 15360.00 136.47
2048 4194304 4192256 8386560 11264.00 22528.00 33792.00 248.18
4096 16777216 16773120 33550336 24576.00 49152.00 73728.00 455.06
8192 67108864 67100672 134209536 53248.00 106496.00 159744.00 840.15
16384 268435456 268419072 536854528 114688.00 229376.00 344064.00 1560.33
4-point DFT
 X( 0)  1 1 1   x( 0) 
1
    
 X( 1)   1 j 1 j   x( 1) 
 
 X( 2)   1 1 1 1   x( 2) 
  1 j  
 X( 3)   1  j   x( 3) 
Can be, by interchanging col. 2 and 3, seen as

 X( 0)   1 1 1 1   x( 0) 
     
 X( 1)   1 1  j j   x( 2) 
 
 X( 2)   1 1 1 1   x( 1) 
   1 1 j  j   x( 3) 
 X( 3)     
4-point DFT
 X( 0)   1 1 1 1   x( 0) 
     
 X( 1)   1 1  j j   x( 2) 
 
 X( 2)   1 1 1 1   x( 1) 
   1 1 j  j   x( 3) 
 X( 3)     
The system matrix is rewritten as

 X( 0)   1 0 1  1
0 1 0 0   x( 0) 
     
 X( 1)    0 1 0 j   1 1 0 0   x( 2) 
 
 X( 2)   1 0 1 0   0 0 1 1   x( 1) 
 X( 3)   0   
   1 0 j  0 0 1 1   x( 3) 
 X( 0)   1 0 1 0 1 1   x( 0) 
0 0
     
 X( 1)    0 1 0 j   1 1 0 0   x( 2) 
  First stage of
 X( 2)   1 0 1 0   0 0 1 1   x( 1)  realization
 X( 3)   0   
   1 0 j  0 0 1 1   x( 3) 

 x( 0)  x( 2)  1 1   x( 0) 
0 0
    
Second  x( 0)  x( 2)   1 1 0 0   x( 2) 
stage  
 x( 1)  x( 3)  0 0 1 1   x( 1) 
 x( 1)  0  
  x( 3)   0 1 1   x( 3) 

 X( 0)  1 0 1   x( 0)
0  x( 2) 
     
 X( 1)   0 1 0  j   x( 0)  x( 2) 
 
 X( 2)  1 0 1 0   x( 1)  x( 3) 
  0   
 X( 3)   1 0 j   x( 1)  x( 3) 
Decimation of 4 point DFT into 2xradix-2

x0 x0+x2 X[0]

x2 xo -x2 X[1]
-1

x1+x3 X[2]
x1 Wo
w1 W 2

x1-x3 X[3]
x3
W 3
-1

• The values of
W40= 1; W42 = -1; W41= -j; and W 43 = j
N=8-point radix-2 DIT-FFT:
N/4 point DFT N/2 point DFT N-point DFT

x[0] X[0]

x[4] X[1]
-1

x[2] X[2]
-1

x[6] X[3]
-1
w2 -1

x[1] X[4]
-1

X[5]
x[5] w1 -1
-1

x[3] w2 X[6]
-1 -1

x[7] w3 X[7]
-1 w2 -1 -1
Radix-2 FFT Technique
Radix-2 FFT Technique
For N=16, (one representation)
For N=16, (one representation)
For 16-point! Can you guess the butterfly
diagram
-1

[4] -1
[12] -1 -1
-1

-1 -1

[6] -1 -1

[14] -1 -1 -1

[1] -1

[9] -1
-1
-1 -1

-1 -1
-1
[3] -1 -1

[11] -1 -1 -1

-1 -1 -1

-1 -1
-1 -1
Radix-2 FFT Technique
Try yourself!

Application of FFT Algorithm


*FFT is proposed for complex calculations even if data is
real!
Why?

*Second step will include multiplication with phase factor,


which will make data complex!
* Utilizing FFTs capability to handle complex
calculations, we can exploit it to simply long real valued
sequences or two real valued sequences!
Application of FFT Algorithm
Application of FFT Algorithm

Complexity is half of what is required for full


sequence + one extra addition and subtraction!!
DFT Properties (recap)
Example
x1=[1 2 3 4],
fft(x1)=[10.0000 + 0.0000i -2.0000 + 2.0000i -2.0000 + 0.0000i -2.0000 - 2.0000i]
x2=[1 2 1 2]
fft(x2) = [6 0 -2 0] Two 4-point DFTs
X=x1+j*x2=[1 + 1i, 2 + 2i, 3+ 1i , 4 + 2.0000i]
z=fft(X)=[10.0000 + 6.0000i, -2.0000 + 2.0000i, -2.0000 - 2.0000i, -2.0000 - 2.0000i]
dft_x1=
One 4-point DFT
for i=0:3
kk=mod((4-i),4)
dft_x1(i+1)=0.5*(z(i+1)+conj(z(kk+1)))
End [10.0000 + 0.0000i -2.0000 + 2.0000i -2.0000 + 0.0000i -2.0000 - 2.0000i]
dft_x2=
for i=0:3
kk=mod((4-i),4)
dft_x2(i+1)=-0.5j*(z(i+1)-conj(z(kk+1)))
End
[6 0 -2 0]
Application of FFT Algorithm for 2N-point real
sequence
Application of FFT Algorithm for 2N-point
real sequence

X X
2 2
X X

k
W
2N
k
W
2N
Example
xx=[1 1 2 2 3 1 4 2]
fft(xx)=16.0000 + 0.0000i -2.0000 + 2.0000i -2.0000 + 2.0000i -2.0000 - 2.0000i
4.0000 + 0.0000i -2.0000 + 2.0000i -2.0000 - 2.0000i -2.0000 - 2.0000i
x1=[1 2 3 4], We know their DFTs from previous example on
x2=[1 2 1 2] slide-36!
By using the expression for complete sequence:

fft(xx)=
for k=1:4
g(k)=dft_x1(k)+exp(-j*2*pi*(k-1)/8)*dft_x2(k)
g(k+4)=dft_x1(k)-exp(-j*2*pi*(k-1)/8)*dft_x2(k)
end

=16.0000 + 0.0000i -2.0000 + 2.0000i -2.0000 + 2.0000i -2.0000 - 2.0000i


4.0000 + 0.0000i -2.0000 + 2.0000i -2.0000 - 2.0000i -2.0000 - 2.0000i
Linear Filtering Approach
FFT technique computation
complexity for Radix-2 :

• In some applications, only selected values of DFT is


required!
• When desired value of DFT is less than ,
direct DFT computation may be more beneficial.

Two methods based on linear filtering:


1. Goertzel Method
2. Chirp-Z method
Goertzel Method

Why?
DFT term
Can be seen as convolution equation as follows:

With impulse response:

Required DFT from filter:


At frequency
Goertzel Method
System transfer function in Z-domain:

*Entire DFT can be calculated by sending the data via N-


single pole filters!
*Each filter has pole at corresponding frequency.
Instead if using convolution form, we can also use
difference equation:
Goertzel Method
Alternative method:
• Complex domain calculation can be avoided by using
pair of complex-conjugate poles!
• Such an two pole filter can be given by following
equation:

• Corresponding difference equation can be given by:


Goertzel Method

Each iteration requires


one multiplications and
two additions!
Total multiplications
required N+1.

• Recursive relation is iterated for , but


only value at n=N is stored!
Goertzel Method

Each iteration requires


one multiplications and
two additions!
Total multiplications
required N+1.
Method is attractive when DFT is
calculated for
• Recursive relation is iterated for , but
only value at n=N is stored!
Chirp-Z
• DFT of N-point data sequence can be seen as z-
transform of x(n) at N equally spaced points on unit
circle.
• It is also seen as equally spaced samples of Fourier
transforms:
• Here, we will consider other contours including unit
circle.

equally spaced points on circle.


Chirp-Z

Example: Suppose
Which starts on a point:

Then it spirals away:


Chirp-Z

, Contour is an arc of unity circle!


Chirp-Z
Lets impose new condition in z-transform :

Substituting new condition in Z-transform :


Chirp-Z
• Lets define a new sequence:

Can be seen as convolution of g(n) and h(n), where:


Chirp-Z

Frequency of signal which increases linearly with time.


Such signals are used in Radar and called Chirp signal, hence the
name Chirp-z algorithm.
Linear convolution above can be done efficiently using FFT
algorithm.
Chirp-Z
Lets calculate convolution in frequency domain:
Circular
Convolution:
Revise your
Lets select the DFT size as: concepts on linear
and circular
convolution
Required length of

Which will be length of linear convolution:


Chirp-Z

Alternative method:
Chirp-Z

Complexity:
M=

IF L is very small, direct transform is better!


For the computation of DFT:
Chirp-Z
Chirp-Z

You might also like