Linear Filtering Methods Based On The DFT
Linear Filtering Methods Based On The DFT
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
L=4,M=3,N=L+M-1=6
Eight point DFT of x(n) 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}
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
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
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
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
X k x n e
1
x n
X k W
N
N 1
N 1
WN
n 0
N 1
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
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
Nr
Sequences
; n 0,1,
1
2
;
n
0
,
1
,
f1(n) =x[2n]
(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
N
1
2
n 0
N
1
2
n 0
X k F1 k WNk F2 k ; k 0, N 1 (2)
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
N
1
4
v11(n) =f1(2n)
; 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
N
1
4
n 0
N
1
4
2 n 0
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
nk
n 0
N
1
4
n 0
N
1
4
nk
nk
n 0
nk
N=8,
N2
Three Stages
--->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]
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 1
V12 0
V12 1
V21 0
V21 1
V22 0
V12 1
W80 e
2 ( 0 )
8
F1 1
F1 2
F1 3
N
8
F2 0
F2 1
F2 2
k 1; F 2 1 V21 1 W V 1 V21 1 W V 1
1
4 22
2
8 22
F2 3
W8 e
2 ( 0 )
8
W8 e
2 ( 2 )
8
1
e
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)
DIT
DIF
Problems
x(n)={1,-1,-1,-1,1,1,1,-1}
First Stage
V11 0
V11 1
V12 0
V12 1
V21 0
V21 1
V22 0
V12 1
W80 e
2 ( 0 )
8
Second Stage
F1 0
F1 1
F1 2
F1 3
F2 0
F2 1
F2 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 2 F1 2 W82 F2 2 2 j 2
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
Inputx( n)
Linear
Filter
h( n)
y (n) Output or
Response
2 Algorithm
Step 3:conjugate of result of step 2
Step 4: The result of Step 3 Divided by N, we get
y(n).
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