FIR and IIR Filter Asdsa
FIR and IIR Filter Asdsa
FIR and IIR Filter Asdsa
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
1
z
=
=
1 2
'( ) ( )
c
k
H H j k
T T
t
e e
=
(
=
(
=
=
(
=
(
1
( ) ( )
k
N
s t
c k
k
h t A e u t
=
=
1
( ) ( )
k
N
s nT
k
k
h n A e u n
=
=
1
1
( )
1
k
N
k
s T
k
A
H z
e z
=
=
' e
e
e
' e
' e e ~
-
e
' e
/ T t
/ T t
Feb.2008 DISP Lab 25
IIR Filter Design by Bilinear
transformation method
The desired transformation to is
now obtained by inverting
to produce
And setting , which yields
1
2
' tanh ( )
2
sT
s
T
=
2 '
tanh( )
2
s T
s
T
=
s z
1
' ( ) ln s z
T
=
2 ln
tanh( )
2
z
s
T
=
1
1
2 1
( )
1
z
T z
=
+
Re(Z)
Im(Z)
1
S domain Z domain
1
2
1
2
T
s
z
T
s
+
=
je
o
Feb.2008 DISP Lab 26
IIR Filter Design by Bilinear
transformation method
The discrete-time filter design is
obtained from the continuous-time
design by means of the bilinear
transformation
Unlike the impulse invariant
transformation, the bilinear
transformation is one-to-one, and
invertible.
1 1
(2/ )(1 )/(1 )
( ) ( ) |
c
s T z z
H z H s
= +
=
Feb.2008 DISP Lab 27
FIR Filter Design by Window
function technique
Simplest FIR the filter design is
window function technique
A supposition ideal frequency
response may express
where
( ) [ ]
j j n
d d
n
H e h n e
e e
=
=
1
[ ] ( )
2
j j n
d d
h n H e e d
t
e e
t
e
t
=
}
Feb.2008 DISP Lab 28
FIR Filter Design by Window
function technique
To get this kind of systematic causal
FIR to be approximate, the most
direct method intercepts its ideal
impulse response!
[ ] [ ] [ ]
d
h n w n h n =
( ) ( ) ( )
d
H W H e e e = -
Feb.2008 DISP Lab 29
FIR Filter Design by Window
function technique
Truncation of the Fourier series
produces the familiar Gibbs
phenomenon
It will be manifested in ,
especially if is discontinuous.
( ) H e
( )
d
H e
Feb.2008 DISP Lab 30
FIR Filter Design by Window
function technique
1.Rectangular window
2.Triangular window (Bartett window)
1, 0
[ ]
0,
n M
w n
otherwise
s s
2
, 0
2
2
[ ] 2 ,
2
0,
n M
n
M
n M
w n n M
M
otherwise
s s
= < s
(
=
2
0.54 0.46cos , 0
[ ]
0,
n
n M
w n
M
otherwise
t
s s
+ s s
k
A [ / 2] M
0,1,..., n M =
Feb.2008 DISP Lab 39
FIR Filter Design by Frequency
sampling technique
It can be rewritten as
where and
Therefore, it may write
where
1
/ 2 /
0
/ 2
( )
N
j k N j kn N
k
k
k N
h n A e e
t t
=
=
=
0,1,..., 1 n N =
1 N M = +
k N k
A A
=
/ 2 /
( )
j k N j kn N
k k
h n A e e
t t
=
1
0
/ 2
( ) ( )
N
k
k
k N
h n h n
=
=
=
0,1,..., 1 n N =
Feb.2008 DISP Lab 40
FIR Filter Design by Frequency
sampling technique
with corresponding transform
where
Hence
which has a linear phase
1
0
/ 2
( ) ( )
N
k
k
k N
H z H z
=
=
=
/
2 / 1
(1 )
( )
1
j k N N
k
k
j k N
A e z
H z
e z
t
t
' ( 1)/ 2
sin / 2
( )
sin[( / / 2)]
j T N
k k
TN
H A e
k N T
e
e
e
t e
=
k
N A
/
k s
k N e e = 2 /
s
T e t =
Feb.2008 DISP Lab 42
FIR Filter Design by Frequency
sampling technique
The only nonzero contribution to
at is from , and hence
that
Therefore, by specifying the DFT
samples of the desired magnitude
response at the frequencies ,
and setting
'( ) H e
k
e e =
'
( )
k
H e
'( )
k k
H N A e =
'
( )
d
H e
k
e
'
( ) /
k d k
A H N e =
Feb.2008 DISP Lab 43
FIR Filter Design by Frequency
sampling technique
We produce a filter design from
equation (5.1) for which
The desired and actual magnitude
responses are equal at the N
frequencies
'
'( ) ( )
k d k
H H e e =
k
e
Feb.2008 DISP Lab 44
FIR Filter Design by Frequency
sampling technique
In between these frequencies, is
interpolated as the sum of the
responses , and its magnitude
does not, equal that of
'( ) H e
'
( )
k
H e
'
( )
d
H e
Feb.2008 DISP Lab 45
FIR Filter Design by Frequency
sampling technique
Example: For an ideal lowpass filter
from , we would
choose
The frequency samples are
indeed equal to the desired
'
1, 0,1,...,
( )
0, 1,...,[ / 2]
d k
k P
H
k P M
e
=
=
= +
'
( ) /
k d k
A H N e =
( 1) / ( 1), 0,1,...,
0, 1,...,[ / 2]
k
k
M k P
A
k P M
+ =
=
= +
'
( )
k
H e
'
( )
d k
H e
Feb.2008 DISP Lab 46
FIR Filter Design by Frequency
sampling technique
The response is very similar to the
result form using the rectangular
window, and the stopband is similarly
disappointing.
We can try to search for the optimum
value of the transition sample would
quickly lead us to a value of
approximately ,
k p =
0.38( 1) /( 1)
p
p
A M = +
Feb.2008 DISP Lab 47
FIR Filter Design by MSE
: The spectrum of the filter we
obtain
: The spectrum of the desired
filter
MSE=
( ) H f
( )
d
H f
( ) ( )
}
2 /
2 /
2
1
s
s
f
f
d s
df f H f H f
0 0.1 0.2 0.3 0.4 0.5
-0.5
0
0.5
1
1.5
Feb.2008 DISP Lab 48
FIR Filter Design by MSE
Larger MSE, but smaller maximal
error
Smaller MSE, but larger maximal
error
0 0.1 0.2 0.3 0.4
-0.5
0
0.5
1
1.5
0 0.1 0.2 0.3 0.4
-0.5
0
0.5
H(F)
H(F) - H (F)
d
0 0.1 0.2 0.3 0.4
-0.5
0
0.5
1
1.5
0 0.1 0.2 0.3 0.4
-0.5
0
0.5
H(F)
H(F) - H (F)
d
Feb.2008 DISP Lab 49
FIR Filter Design by MSE
1.
( ) ( ) ( ) ( )
} }
= =
2 / 1
2 / 1
2
2 /
2 /
2
1
dF F H F R df f H f R f MSE
d
f
f
d s
s
s
( ) ( ) dF F H F n n s
d
k
n
}
=
=
2 / 1
2 / 1
2
0
| | 2 cos ] [ t
( ) ( ) ( ) ( ) dF F H F n n s F H F n n s
d
k
n
d
k
n
}
= =
|
|
.
|
\
|
|
|
.
|
\
|
=
2 / 1
2 / 1
0 0
2 cos ] [ 2 cos ] [ t t
( ) ( )
1/ 2
1/ 2
0 0
[ ]cos 2 [ ]cos 2
k k
n
s n n F s F dF
t
t t t t
= =
=
}
( ) ( ) ( )
1/ 2 1/ 2
2
1/ 2 1/ 2
0
2 [ ]cos 2
k
d d
n
s n n F H F dF H F dF t
=
+
} }
Feb.2008 DISP Lab 50
FIR Filter Design by MSE
2. when n = t,
when n = t, n = 0,
when n = t, n = 0,
3. The formula can be repressed as:
( ) ( ) 0 2 cos 2 cos
2 / 1
2 / 1
=
}
dF F F n t t t
( ) ( ) 2 / 1 2 cos 2 cos
2 / 1
2 / 1
=
}
dF F F n t t t
( ) ( ) 1 2 cos 2 cos
2 / 1
2 / 1
=
}
dF F F n t t t
( ) ( ) ( )dF F H dF F H F n n s n s s MSE
d d
k
n
k
n
} }
= =
+ + =
2 / 1
2 / 1
2
2 / 1
2 / 1
0 1
2 2
2 cos ] [ 2 2 / ] [ ] 0 [ t
Feb.2008 DISP Lab 51
FIR Filter Design by MSE
4. Doing the partial differentiation:
5. Minimize MSE: for all ns
( )
}
=
c
c 2 / 1
2 / 1
2 ] 0 [ 2
] 0 [
dF F H s
s
MSE
d
( ) ( )
}
=
c
c 2 / 1
2 / 1
2 cos 2 ] [
] [
dF F H F n n s
n s
MSE
d
t
0
] [
=
c
c
n s
MSE
( )
}
=
2 / 1
2 / 1
] 0 [ dF F H s
d
( ) ( )
}
=
2 / 1
2 / 1
2 cos 2 ] [ dF F H F n n s
d
t
[ ] [0]
[ ] [ ] / 2 for n=1,2,...,k
[ ] [ ] / 2 for n=1,2,...,k
[ ] 0 for n<0 and n N
h k s
h k n s n
h k n s n
h n
=
+ =
=
= >
Feb.2008 DISP Lab 52
Conclusions
FIR advantage:
1. Finite impulse response
2. It is easy to optimalize
3. Linear phase
4. Stable
FIR disadvantage:
1. It is hard to implementation than IIR
Feb.2008 DISP Lab 53
Conclusions
IIR advantage:
1. It is easy to design
2. It is easy to implementation
IIR disadvantage:
1. Infinite impulse response
2. It is hard to optimalize than FIR
3. Non-stable
Feb.2008 DISP Lab 54
References
[1]B. Jackson, Digital Filters and Signal
Processing, Kluwer Academic Publishers 1986
[2]Dr. DePiero, Filter Design by Frequency
Sampling, CalPoly State University
[3]W.James MacLean, FIR Filter Design
Using Frequency Sampling
[4],,2005
[5]Maurice G.Bellanger, Adaptive Digital
Filters second edition, Marcel dekker 2001
Feb.2008 DISP Lab 55
References
[6] Lawrence R. Rabiner, Linear Program
Design of Finite Impulse Response Digital
Filters, IEEE 1972
[7] Terrence J mc Creary, On Frequency
Sampling Digital Filters, IEEE 1972