0% found this document useful (0 votes)
31 views25 pages

12 Frequency Analysis 08-05-2023

The document discusses the Fast Fourier Transform algorithm and how it can be used to efficiently compute the Discrete Fourier Transform of a sequence. It describes how the FFT splits the DFT calculation into smaller subproblems using decimation in time and decimation in frequency approaches. Examples are provided to illustrate the FFT calculation on sample input sequences.

Uploaded by

Siva
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)
31 views25 pages

12 Frequency Analysis 08-05-2023

The document discusses the Fast Fourier Transform algorithm and how it can be used to efficiently compute the Discrete Fourier Transform of a sequence. It describes how the FFT splits the DFT calculation into smaller subproblems using decimation in time and decimation in frequency approaches. Examples are provided to illustrate the FFT calculation on sample input sequences.

Uploaded by

Siva
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/ 25

Digital Signal Processing

(EEE301)
Dr. P. Geethanjali
Fast Fourier Transform Algorithm
• Consider DTFT

• Basic idea is to split the sum into 2 subsequences of length N/2 and continue all
the way down until you have N/2 subsequences of length 2

Log2(8)

N
Decimation in Time
In this method we split x (n) into the even indexed x (2m) and the odd indexed x
(2m + 1) each N/2 long. DFT can be expressed as:

N / 2 1 N / 2 1
2 mk k ( 2 m 1)
X (k )  
m0
x ( 2 m )W N   x ( 2 m  1)W
m0
N

N / 2 1 N / 2 1
X (k )   x ( 2 m )W mk
W k
 x ( 2 m  1)W km (1)
N /2 N N /2
m 0 m0

K = 0,1,2,3,4,……………..,N-1

We have used the fact

WN2 mk  e  j 2 mk 2 / N  e  j 2mk /( N / 2 )  WNmk/ 2


Decimation in Time
Define new functions as
G (K) is a DFT for the even samples of x (n), or
N / 2 1
mk
G (k )   x(2m)W
m0
N /2 k  0,1,2,...., N / 2  1

H (K) is a DFT for the odd samples of x(n), or


N / 2 1
km
H (k )   x(2m  1)W
m0
N /2 k  0,1,2,3,..., N / 2  1

Then equation (1) for the first N/2 points can be expressed as

X (k )  G (k )  WNk H (k ) k  0,1,2,...., N / 2  1
Decimation in Time
But
WN( N / 2 k )  WNk
G (k )  G ( N / 2  k ), k  0,1,2,..., N / 2  1
H (k )  H ( k  N / 2) k  0,1,2,...., N / 2  1
Then

X ( k  N / 2 )  G ( k )  W Nk H ( k ) k  N / 2, N / 2  1,...., N

This can be expressed in the following diagram


Example
Let’s take a simple example where only two points are given n=0, n=1; N=2
N / 2 1 N / 2 1
mk k mk
X [k ]  WN / 2 x[2m] WN (
m 0
WN / 2 x[2m  1])
m0
2 mk mk
WN  WN / 2
m N / 2 m N /2 m
WN / 2  WN / 2 WN / 2  WN / 2
N
WN  e 2j  cos( 2 )  j sin( 2 )  1
N /2
WN  1

0
0.0 0
0
0.0
Same result
X [ k  0 ]  W 1 x[0] W ( W
1 1 x[1])  x[0]  x[1]
m 0 m0
0 0
0.1 1 0.1 1
X [k  1]  W x[0] W ( W1 x[1])  x[0]  W1 x[1]  x[0]  x[1]
1 1
m0 m 0
FFT Algorithms - Four point FFT
First find even and odd parts and then combine them:
Decimation in Time and Frequency

Index mapping for Fast Fourier Transform

Input Data index Index Bits Reversal Bits Output data


n index
k
0 000 000 0
1 001 100 4
2 010 010 2
3 011 110 6
4 100 001 1
5 101 101 5
6 110 011 3
7 111 111 7
8-Point DIT
Decimation in Time
G(0)
x(0) X(0)
G(1)
x(2) X(1)
4-point
DFT G(2)
x(4) X(2)
G(3)
x(6) X(3)
H(0) W 80
x(1) X(4)
-1
H(1) W81
x(3) X(5)
4-point
-1
DFT H(2) W82
x(5) X(6)
-1
H(3) W 83
x(7) X(7)
-1
Decimation in Time
x(0) 2-point X(0)
DFT
x(4) X(1)
x(2) W80
2-point X(2)
-1
DFT W82
x(6) X(3)
-1
x(1) W 80
2-point X(4)
-1
DFT W81
x(5) X(5)
-1
x(3) W80 W82
2-point X(6)
-1 -1
DFT W82 W 83
x(7) X(7)
-1 -1
Decimation in Time
x(0) X(0)
W80
x(4) X(1)
-1
W80
x(2) X(2)
-1
W80 W82
x(6) X(3)
-1 -1
W 80
x(1) X(4)
-1
W80 W81
x(5) X(5)
-1 -1
W80 W82
x(3) X(6)
-1 -1
W80 W82 W 83
x(7) X(7)
-1 -1 -1
Decimation in Time
Example Given a sequence x(n) where x(0) = 1, x(1) = 2, x(2) = 3,
x(3) = 4 and x(n) = 0 elsewhere ,find DFT for the first four points
Solution

x(0)=1 4
X(0 )= 10
W40  1 -2
x(2)=3 X(1)= -2+2j
-1
6 W40  1
x(1)=2 X(2)= -2
-1
1
W40  1 -2 W4   j
x(3)=4 X(3)= -2-2j
-1 -1
Inverse Fourier Transform
The inverse discrete Fourier can be calculated using the same method
but after changing the variable WN and multiplying the result by 1/N

Example Given a sequence X(n) given in the previous example.


Find the IFFT using decimation in time method
Solution

8 4 1/4
X(0) =10 x(0) = 1
~
W40  1 12 8 1/4
X(2) =-2 x(1) = 2
-1 ~
-4 W40  1 12 1/4
X(1) = -2+2j x(2) = 3
~ -1
W40  1 j4 W~ 1  j
X(3) = -2-2j 4 16 1/4 x(3) = 4
-1 -1
Decimation in Frequency

The discrete Fourier transform can be found using


N 1
kn
X (k )   x ( n )W
n0
N k  0 ,1, 2,....., N  1

Where N = 2, 4, 8, 16,… and

WN  e  j 2 / N
X (k ) can be expressed as
N / 2 1 N 1
kn kn
X (k )  
n0
x ( n )W N   x ( n )W
n N / 2
N

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

N / 2 1 N / 2 1
kn kN / 2 kn
X (k )  n0
x ( n )W N W N  x
n0
( n  N / 2 )W N
Decimation in Frequency

But

W N( N / 2 ) k  e 2 k ( N / 2 ) / N  e k  (  1) k

Then
N / 2 1 N / 2 1
kn k kn
X (k )  
n0
x(n)W N  (1)  x(n  N / 2)W
n0
N

If k = 2m or an even number

N / 2 1
X (2m)   x ( n )  x ( n  N / 2 ) W
n0
N
2 mn

N / 2 1
mn
X ( 2 m)   a
n0
( n )W N /2
Decimation in Frequency
Noting That
WN2 mn  e  j 2 mn2 / N  e  j 2mn /( N / 2 )  WNmn/ 2
a ( n)  x ( n )  x ( n  N / 2)
Then X(2m) is N/2-point DFT for a(n)
If k = 2m+1 (odd number) and using the same method
N / 2 1
X ( 2 m  1)   x ( n )  x ( n  N / 2) W
n 0
N
n
W N2 mn
N / 2 1
X (2m  1)   b(n)W W
n0
n
N
mn
N /2

b( n )  x ( n)  x ( n  N / 2)

X(2m+1) is N/2-point DFT for b(n)WNn


Decimation in Frequency

a(0)
x(0) X(0)
a(1)
x(1) X(2)
N/2-point
a(2) DFT
x(2) X(4)
a(3)
x(3) X(6)
b(0) W80
x(4) X(1)
-1
b(1) W81
x(5) X(3)
-1 N/2-point
b(2) W 82 DFT
x(6) X(5)
-1
b(3) W 83
x(7) X(7)
-1
Decimation in Frequency

x(0) N/4 point X(0)


DFT
x(1) X(4)
W40  W80
x(2) N/4 point X(2)
-1
1
W4  W82
DFT
x(3) X(6)
-1
W80
x(4) N/4 point X(1)
-1
W81 DFT
x(5) X(5)
-1
W82 W40  W80
x(6) X(3)
-1 -1 N/4 point
W 83 W41  W82 DFT
x(7) X(7)
-1 -1
Decimation in Frequency

x(0) X(0)
W80
x(1) X(4)
-1
W80
x(2) X(2)
-1
W82 W80
x(3) X(6)
-1 -1
W80
x(4) X(1)
-1
W81 W80
x(5) X(5)
-1 -1
2 0
W W
x(6) 8 8
X(3)
-1 -1
W 83 W82 W80
X(7)
x(7)
-1 -1 -1
Decimation in Frequency

Using the previous algorithm , the complex multiplications needed


is only 12. While using the normal DFT would require 64 complex
multiplications

In general

Complex multiplication of DFT is: N 2


Complex multiplication of FFT is (N/2) log2(N)

If N = 1024
Complex multiplication of DFT is: 1,048,576
Complex multiplication of FFT is: 5,120
Decimation in Frequency

Example Given a sequence x(n) where x(0) = 1, x(1) = 2, x(2) = 3, x(3) = 4


and x(n) = 0 elsewhere ,find DFT for the first four points
solution

4 10
x(0) =1 X(0)
6 W40  1 -2
x(1) =2 X(2)
-1
-2 W40  1 -2+2j
x(2) =3 X(1)
-1
-2 W41   j W40  1 -2-2j
x(3) =4 X(3)
-1 -1
Inverse Fourier Transform
The inverse discrete Fourier transform can be found using

N 1
1  kn
x(n) 
N
 X ( k )W
k 0
N n  0 ,1, 2,....., N  1

Which can be expressed as


N 1 ~
1 kn
x(n) 
N
 X (k ) W
k 0
N n  0 ,1, 2,....., N  1

~
where W Nkn  W N kn is called the twiddled factor

We can see that the difference between the inverse discrete Fourier and
forward Fourier transform is the twiddled factor and the division by 1/N
Inverse Fourier Transform
X(0) 1/N x(0)
~
W80 1/N x(4)
X(1)
~
-1
W80 1/N
X(2) x(2)
-1 ~ ~

X(3) W82 W80 1/N x(6)


~
-1 -1
X(4)
W80 1/N x(1)
-1 ~ ~

X(5)
W81 W80 1/N x(5)
-1 ~ ~ -1
X(6) W 8
2
W 8
0
1/N x(3)
-1 -1 ~ ~
~

X(7) W 8
3
W 8
2
W80 1/N x(7)
-1 -1 -1
Inverse Fourier Transform

Example Given a sequence X(n) given in the previous example. Find the
IFFT using decimation in frequency method
solution

8 4 1/4
X(0) =10 x(0) = 1
-4 ~
W40  1 12 1/4
X(1) = -2+2j x(2) = 3
-1
12 W~ 0  1 8
X(2) =-2 4 1/4
x(1) = 2
-1 ~
j4 ~
1
W40  1 16
X(3) = -2-2j W  j
4 1/4
x(3) = 4
-1 -1

You might also like