67% found this document useful (3 votes)
4K views50 pages

Linear Filtering Methods Based On The DFT

The document discusses linear filtering methods based on the discrete Fourier transform (DFT). It introduces how the DFT can be used to perform linear filtering in the frequency domain by representing signals and filters in the frequency domain using the DFT and inverse DFT. It describes the use of circular convolution properties to efficiently compute the output of a linear filter. It also presents methods for filtering long sequences, such as overlap-save and overlap-add, to address limitations of block-based filtering. The document concludes by mentioning how the fast Fourier transform (FFT) algorithm improves the efficiency of computing the DFT.

Uploaded by

lavanyachezhiyan
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
67% found this document useful (3 votes)
4K views50 pages

Linear Filtering Methods Based On The DFT

The document discusses linear filtering methods based on the discrete Fourier transform (DFT). It introduces how the DFT can be used to perform linear filtering in the frequency domain by representing signals and filters in the frequency domain using the DFT and inverse DFT. It describes the use of circular convolution properties to efficiently compute the output of a linear filter. It also presents methods for filtering long sequences, such as overlap-save and overlap-add, to address limitations of block-based filtering. The document concludes by mentioning how the fast Fourier transform (FFT) algorithm improves the efficiency of computing the DFT.

Uploaded by

lavanyachezhiyan
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1/ 50

Linear filtering methods

based on the DFT


DFT provides a discrete frequency
representation of a finite duration
sequence in the frequency domain.
Computational tool for linear
system analysis, especially for linear
filtering.
DFT can be used to perform linear
filtering in the frequency domain.

Linear filtering methods based


on the DFT
1.Use of the DFT in Linear
Filtering
2.Filtering of long data
sequence
Overlap-save method
Overlap-add method

Use of the DFT in Linear


Filtering
Our objective is to determine the output of
a linear filter to a given input sequence.

Inputx( n)

Linear
Filter
h( n)

Linear Convolution
By using DFT and IDFT
Circular Convolution

y (n) Output or
Response

Linear Convolution
A sequence x(n) of length L filtered
by an FIR filter h(n) of length M
y( n )

M 1

h( n ) x ( n k )

k 0

Example x(n) =[1, 2, 2, 1] , h(n) =[1, 2, 3]


L=4,M=3
x(n)=[1 ,2,2,1] ,h(n)=[1, 2,3]
The length of sequence y(n) is N=L+M-1=6
y(n)={1,4,9,11,8,3}

DFT and TDFT


Therefore ,a DFT of size N L+M-1 is
required to represent y(n) in the
frequency domain.
Using the
Y (k ) DFT
H (k ) Xnotation
(k ), k 0,1,.........( N 1)
X(k) and H(k) are the DFT (with zero
padding) of x(n) and h(n),
respectively.
y (n) IDFT (Y (k )
Performing the inverse DFT of Y(K)

L=4,M=3,N=L+M-1=6
Eight point DFT of x(n) is

X(K)= {6,1.707 - 4.121j, -1 j,0.2929 - j0.121, 0,0.292 + j0.121,


-1+j,1.707 + j4.121}

Eight point DFT of h(n) is

H(K)={6,2.414 - j4.414, -2-j2,-0.4142+ j1.585,2,-0.414 -j 1.585,2+j2,2.414 + j4.4142}


Y(k)=X(k).H(K)={36,-14.0-j17.48,j4,0.07+j0.515,0,0.07-j0.515,-j4,14.07+j17.48}

Eight point IDFT of Y(K) is

Circular Convolution
Example x(n) =[1, 2, 2, 1] , h(n) =[1, 2,
3]
L=4,M=3
The length of sequence y(n) is N=L+M1=6
Example x(n)=[1 ,2,2,1,0 ,0] ,h(n)=[1,
2,3,0,0 0]
y(n)={1,4,9,11,8,3}

Filtering of Long Data


Sequences
In practical applications involving linear
filtering of signals, the input sequence
x(n) is often a very long sequence.
Real-time signal processing applications
concerned with signal monitoring and
analysis.
Overlap-save method
Overlap-add method

Filtering of Long Data


Sequences
When the DFT is used to implement linear
filtering, a signal is processed in blocks.
Due to the real-time requirement (low
delay) and the limitation of physical
memory, the size of the block can not be
arbitrarily large.
The length of the FIR filter is M and the
length of on block of data is L (L>M)
Each time a block of data of length L+M-1
is filtered by using the DFT method.

Overlap-Add Method

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

Overlap-Save Method:
N 1
x 3 (m) x1 (n) x 2 (n) x1 (n)x 2 ((n m)) N
Let L=5,M=3,N=L+M-1=7
n 0
x1(n)={0,0,3,-1,0,1},
x3(n)={0,1,2,1,0,0}
N 1
x2(n)={0,1,3,2,0,1}
y1 (m) x1 (n) h(n) x1 (n)h((n m)) N
N
Perform y1(n)=x1(n)
h(n)
n 0
N 1

y2(n)=x2(n)N
y3(n)=x3(n)N

y2 (m) x 2 (n) h(n) x 2 (n)h((n m)) N


h(n)
n 0

N 1

h(n)
y3 (m) x 3 (n) h(n) x 3 (n)h((n m)) N
n 0

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

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

Overlap-Add Method:
N 1
x 3 (m) x1 (n) x 2 (n) x1 (n)x 2 ((n m)) N
Let L=5,M=3,N=L+M-1=7
n 0
x1(n)={3,-1,0,1,0,0},
x3(n)={2,1,0,0,0,0}
N 1
x2(n)={3,2,0,1,0,0}
y1 (m) x1 (n) h(n) x1 (n)h((n m)) N
N
Perform y1(n)=x1(n)
h(n)
n 0
N 1

y2(n)=x2(n)N
y3(n)=x3(n)N

y2 (m) x 2 (n) h(n) x 2 (n)h((n m)) N


h(n)
n 0

N 1

h(n)
y3 (m) x 3 (n) h(n) x 3 (n)h((n m)) N
n 0

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

x(n)

DFT

X(k)

IDFT

x(n)

Properties of DFT
Circular Convolution
x 3 (m) x1 (n) x 2 (n)

N 1

x1 (n)x 2 ((n m)) N DFT X3 (K) X1 (K)X 2 (K)

n 0
Linear Filtering Methods
Based on the DFT
1.Use of the DFT in Linear Filtering
By using DFT and IDFT
Linear Convolution
x(n)

X(k) H(K)

Y(K)

X(K).H(K)

H(K)
Circular Convolution
2.Filtering of Long Data Sequence
Overlap-save method
Overlap-add method
DFT

IDFT

y(n

Fast Fourier Transform


A large amount of work has been devoted
to reducing the computation time of a DFT.
This has led to efficient algorithms which
are known as the Fast Fourier Transform
(FFT) algorithms.
Decimation In Time(DIT) Radix-2 Algorithm
Decimation In Frequency(DIF) Radix-2
Algorithm

Fast Fourier Transform(FFT)


X k x n W

X k x n e
1

x n
X k W

N
N 1

N 1

WN

n 0

N 1

WN (TwiddleFac tor (or ) PhaseFactor )

e
k

WN

2
nk
N

n 0

2
j
N

N
2

N
2

2
2 N
k j
N
N 2

2
k
j
N

2
2 N
k j
N 2
N 22

nk
N

2
k
N 2

2
k
N

n 0

WNk , Symmetry Pr operty

W Nk , Periodicity Pr operty

N-Point
DFT

nk
N

DFT

FFT

N(N-1)
complex +

N2 complex

N/2 log2(N)
complex
.

N log2(N)
complex
+.

56

64

12

24

16

240

256

32

64

32

992

1024

80

160

64

4032

4096

192

384

DIT Radix-2 FFT Algorithm


Let us consider the computation of the N-Point
DFT
m

Nr

,r-Radix, m- No.of Stages

First Step: x[n] = x[0], x[1], , x[N-1]


Split the N-point data sequences into two N/2point
data sequences f1(n) and f2(n)
Lets divide the sequence x[n] into even and odd
N

Sequences
; n 0,1,
1
2

;
n

0
,
1
,

f2(n) =x[2n+1] = x[1], x[3], , x[N-1]


2

f1(n) =x[2n]

= x[0], x[2], , x[N-2]

(1)

N 1

X k x nWNnk ; 0 k N 1
n 0

X k

N
1
2

N
1
2

n 0

n 0
2
j
nk
N 2

N-point DFT

2 n 1 k
2 nk

x
2
n
W

x
2
n

1
W

N
N

WN2 nk e

2
2 nk
N

W Nnk
2

WN 2 n 1 k WNk W Nnk
N
1
2

N
1
2

X k x 2nW Nnk WNk x 2n 1WNnk


n 0

N
1
2

n 0

N
1
2

f1 (n)W Nnk WNk f 2 (n)WNnk


n 0

n 0

X k F1 k WNk F2 k ; k 0, N 1 (2)

Where F1(k) and F2N/2-point


(k)
DFTs

F1 k
F2 k

N
1
2

n 0

N
1
2

n 0

f1 ( n)W Nnk
2

f 2 ( n)W Nnk
2

kN /2
k
W

W
N
Since F1(k+N/2)= F1(k) and F2(k+N/2)=
F2(k), N

X k F1 k W F2 k ; k 0,
1 (3.1)
2

k
X k F1 k WN F2 k ; k 0,
1 (3.2)
2

k
N

Second Step: Split the N/2-point data


sequences into two N/4-point sequences

N
1
4

v11(n) =f1(2n)

v12(n) =f1(2n+1)--------------- (4.1)

; n 0,1,

; n 0,1,

1
4

v21(n) =f2(2n)

v21(n) =f2(2n+1)----------------(4.2)

N
1
2

F1 k f1 (n)WNnk
n 0

N
1
4

N
1
4

f1 (2n)W N2 nk f1 (2n 1)WN( 2 n1) k


n 0

N
1
4

n 0

N
1
4

v11 (n)WNnk WNk v12 ( n)W Nnk V11 k WNkV12 k (5)


n 0

2 n 0

F 1 k V11 k W NkV12 k ; k 0,1,..........., ( N


4

1)

N
k
F k
V11 k W N V12 k (6.1)
4
2
1
N
k
;
k

0
,
1
,.........
..,
(
1)
F 2 k V21 k W N V22 k
4
2

N
k


F k

V
k

21
N V22 k (6.2)
4
2
2
Where V11(k),V12(k),V21(k) and V22(k)
N/4 point DFT of the sequences v11(n),v12(n),v21(n)
N
and v22(n)N 1
1

V11 k v11 (n)W N ;V12 k v12 (n)W N


4

nk

n 0

N
1
4

n 0

N
1
4

nk

V21 k v21 ( n)W N ;V22 k v22 ( n)W N


n 0

nk

n 0

nk

N=8,

N2

Four 2-point(N/4) DFTs


8-point (N)DFT

Three Stages

--->Two 4-point(N/2) DFTs

v11(0) = f1(0) = x(0)


v11() = f1(2) = x(2)

--->One

v11(n) =f1(2n)
v12(n) =f1(2n+1)
v21(n) =f2(2n)
v21(n) =f2(2n+1) ; n=0,1,(N/4-1)
f1(n) =x[2n]

v12(0) = f1(1) = x(4)

Bit Re versal Shuffling ofData


v12(1) = f1(3) = x(6)
x 0 x 000 x 000 x 0
v21(0) = f2(0) = x(1)
x1 x 001 x100 x 4
x 2 x 010 x 010 x 2
v21() = f2(2) = x(3)
x 3 x 011 x110 x 6
v22(0) = f2(1) = x(5)
x 4 x100 x 001 x1
x 5 x101 x101 x 3
v22(1) = f2(3) = x(7)
x 6 x110 x 011 x 5
x 7 x111 x111 x 7

f2(n) =x[2n+1]

; n=0,1,(N/2-1)

First
Stage-Four
2-point(N/4) DFTs
N
8
1
1

V11 k

nk
nk
nk
v
(
n
)
W

v
(
n
)
W

v
(
n
)
W
11
11
11
N
8
2
n 0

n 0

V11 0

n 0

v11 (0)W2( 0 ) k v11 (1)W2(1) k

V11 1

k 0;V11 0 v11 (0)W2( 0 ) 0 v11 (1)W2(1) 0

V12 0

v11 (0) W20 v11 (1) x(0) W80 x( 4)

k 1;V11 1 v11 (0)W2( 0 )1 v11 (1)W2(1)1

V12 1

v11 (0) v11 (1)W21 x (0) W80 x ( 4)

V12 0 x( 2) W80 x(6)

V21 0

V12 1 x( 2) W80 x(6)

V21 1

V21 0 x (1) W80 x (5)

V22 0

V21 1 x (1) W80 x (5)

V12 1

V22 0 x(3) W x (7)


0
8

V22 1 x(3) W x (7)


0
8

W80 e

2 ( 0 )
8

Second Stage-Two 4-point(N/2) DFTs


F1 0

F 1 k V11 k WNkV12 k V11 k W8kV12 k


2

F1 1

k 0; F 1 0 V11 0 W40V12 0 V11 0 W80V12 0

F1 2

k 1; F 1 1 V11 1 W41V12 1 V11 1 W82V12 1

F1 3

N
8

F k V11 k WNkV12 k F k V11 k W8kV12 k


4
4
2
2
1
1
k 0; F 1 2 V11 0 W40V12 k V11 0 W80V12 k

F2 0

k 1; F 1 3 V11 1 W41V12 1 V11 0 W82V12 k

F2 1

k 0; F 2 0 V21 0 W40V22 0 V21 0 W80V22 0

F2 2

k 1; F 2 1 V21 1 W V 1 V21 1 W V 1
1
4 22

2
8 22

k 0; F 2 2 V21 0 W40V22 0 V21 0 W80V22 0


k 1; F 2 3 V21 1 W41V22 1 V21 1 W82V22 1

F2 3

W8 e

2 ( 0 )
8

W8 e

2 ( 2 )
8

1
e

Third Stage-One 8-point(N) DFT


X k F1 k WNk F2 k
k 0; X 0 F1 0 W80 F2 0
k 1; X 1 F1 1 W81 F2 1
k 2; X 2 F1 2 W82 F2 2
k 3; X 3 F1 3 W83 F2 3

N
k
X k

W
F2 k

1
N
2

k 0; X 4 F1 0 W80 F2 0
k 1; X 5 F1 1 W81 F2 1

k 2; X 6 F1 2 W82 F2 2 W

k 3; X 7 F1 3 W8 F2 3
3

W8 e
1

2 ( 0 )
8

2 (1 )
8

1
e

W8 j;W8 e
2

0707 j 0.707
2 ( 3)
8

3
4

0707 j 0.707

1st stage

x(0)
x(4)

W80

W =1

x(5)

W 81
-1

X(3)

-1
W 80

0
8

1
8

-1
W 82
-1
W80

W81
-1

-1
-1

W80

x(3)
x(7)

X(2)

-1
W80

X(0)
X(1)

-1

x(1)
0
8

3rd stage

W80

x(2)
x(6)

2nd stage

-1
W 83

-1

-1

X(4)
X(5)
X(6)
X(7)

Decimation In Frequency(DIF) Radix-2


Algorithm
Frequency Domain sequence is
decimated
Butterfly Diagram

Decimation In Frequency(DIF) Radix-2


Algorithm

DIT

DIF

Time Domain Sequence


Frequency Domain
decimated
Sequence
decimated
Input Sequence is bit
Normal order
Reversal order
Output sequence is
Bit-reversal
order
Normal order
Phase factor is Multiplied
After subtraction
Before addition & subtraction

Problems
x(n)={1,-1,-1,-1,1,1,1,-1}

First Stage
V11 0

V11 (0) x(0) W80 x( 4) 1 1.1 2

V11 1

V12 0 x (2) W80 x(6) 1 1.1 0

V12 0

V11 1 x(0) W80 x( 4) 1 1.1 0

V12 1 x( 2) W80 x(6) 1 1.1 2

V12 1

V21 1 x(1) W80 x(5) 1 1.1 2

V21 0

V21 0 x(1) W80 x(5) 1 1.1 0

V22 0 x (3) W80 x(7) 1 1.( 1) 2

V21 1

V22 1 x (3) W80 x(7) 1 1.( 1) 0

V22 0
V12 1

W80 e

2 ( 0 )
8

Second Stage
F1 0
F1 1

F 1 0 V11 0 W80V12 0 2 1.0 2

F1 2

F 1 1 V11 1 W8 V12 1 0 ( j )(2) 2 j


2

F 1 2 V11 0 W80V12 k 2 1.0 2

F1 3

F 2 0 V21 0 W8 V22 0 0 1.(2) 2

F2 0

F 1 3 V11 0 W82V12 k 0 ( j )(2) 2 j


0

F 2 1 V21 1 W82V22 1 2 ( j ).0 2

F2 1

F 2 2 V21 0 W80V22 0 0 1(2) 2

F2 2

F 2 3 V21 1 W82V22 1 2 ( j ).0 2

F2 3

W8 e

2 ( 0 )
8

W8 e

2 ( 2 )
8

1
e

Third Stage
X 0 F1 0 W80 F2 0 2 1.(2) 0

X 1 F1 1 W81 F2 1 2 j (0.707 j 0.707)(2)


1.414 j 3.414

X 2 F1 2 W82 F2 2 2 j 2

X 3 F1 3 W83 F2 3 1.414 j 0.585


X 4 F1 0 W80 F2 0 4

X 5 F1 1 W81 F2 1 1.414 j 0.585


X 6 F1 2 W82 F2 2 2 j 2

X 7 F1 3 W83 F2 3 1.4142 j 3.414


W8 e
0

W8 e
1

2 ( 0 )
8

2 (1 )
8

1
e

W8 j;W8 e
2

0707 j 0.707
2 ( 3)
8

3
4

0707 j 0.707

Application of FFT Algorithm


Linear Filtering
Correlation
Spectrum Analysis

Use Of FFT in Linear


Filtering

Let h(n).0nM-1,be the sample response


of the FIR filter
x(n)-Input data Sequence

Inputx( n)

Linear
Filter
h( n)

y (n) Output or
Response

The block size of the FFT Algorithm is N


N=L+M-1 and L is the number of new data
samples being processed by the filter.
N is a power ofN
2 . 23

1. The N-point DFT of h(n),which is padded by L-1


zeros, is denoted as H(K) using either DIT or DIF
algorithm
2. The N-point DFT of x(n), is denoted as X(K) using
either DIT or DIF algorithm.
3. Multiply X(k) and H(K), Y(k)=X(k).H(K)
4. The inverse DFT can be computed by use of an
FFT algorithm
Step 1: Conjugate of Y(K)
*
N 1
1
*
nk
Step 2: DFT of Y*(k) usingy(either
DIT
or
DIF
n ) Y ( k )WN radixN n 0

2 Algorithm
Step 3:conjugate of result of step 2
Step 4: The result of Step 3 Divided by N, we get
y(n).

Determine the response of LTI system when the


input sequence x(n)={-1,1,2,1,-1} by radix-2 DIT
FFT. The impulse response of the systems is h(n)={1,1,1,-1}
L=5,M=4,N=L+M-1=8
x(n)= {-1,1,2,1,-1,0,0,0}
h(n)={-1,1,1,-1,0,0,0,0}
Determine X(K) using DIT or DIF algorithm
X(K)={ 2,- 3.414j,-4,0.585j,-2,-0.5858j,-4,3.414j
Determine H(K) using DIT or DIF algorithm
H(K)={ 0,-1- 0.414j,0,-1-2.414j,-4,-1+2.414j,0,-1+0.414j}
Y(k)={0,-1.413+3.414j,0,1.412-j0.585,8,1.12+0.585j,0,-1.4133.414j}
Y*(k)={0,-1.413-3.414j,0,1.412+j0.585,8,1.12-0.585j,0,1.413+3.414j}
DFT of Y*(k) using Either DIT or DIF
The result of previous step divide by N=8
y(n)={1,-2,0,-1,1,0,2,-1}

Discrete Cosine
Transform(DCT)
Used for Speech and Image
compression
N 1

1
V(k) 2 x(n)cos n k , 0 k N 1
Forward DCT

n 0

Inverse DCT
N 1

1 V0


1
x(n)
V(k)cos n k , 0 n N 1
N 2
N
2

k 0

You might also like