Professional Documents
Culture Documents
1
Lecture 10: LTI IIR design: Analog to
Digital and spectral transformations
Instructor:
Dr. Gleb V. Tcheslavski
Contact: gleb@ee.lamar.edu
Office Hours: Room 2030
Class web site:
http://ee.lamar.edu/gleb/dsp/in
dex.htm
Lets go! Army will make a human out of you.
ELEN 5346/4304 DSP and Filter Design Fall 2008
2
Preliminary considerations
Techniques for analog filter design are well developed, so it is quite natural to
start designing a digital filter from an analog prototype.
An analog LTI system is stable if all poles of its transfer function H(s) lie in
the left half of the s-plane. Therefore:
1) The jO axis of the s-plane should map into the unit circle in the z-plane.
2) The left half of the s-plane should map into the inside of the unit circle in
the z-plane to convert a stable analog filter to a stable digital filter.
A linear phase filter must have a transfer function satisfying:
1
( ) ( )
N
H z z H z
= (10.2.1)
However, in this case, filter would have a reciprocal pole outside the UC and,
therefore, would be unstable. A causal and stable IIR filter cannot have linear
phase.
As a result, when designing IIR filters, only the magnitude response is
specified.
ELEN 5346/4304 DSP and Filter Design Fall 2008
3
Approximation of derivatives
If the analog filter is specified by the LCC Differential Equation:
0 0
( ) ( )
k k
N M
k k
k k
k k
d y t d x t
dt dt
o |
= =
=
(10.3.1)
the following approximation for the derivative can be used:
( )
1
( )
( )
n n
t nT
y nT y nT T
y y dy t
dt T T
=
= =
Where T is the sampling period.
The system function of an analog differentiator:
The system function of a digital differentiator:
( ) H s s =
1
1
( )
z
H z
T
=
(10.3.2)
(10.3.3)
(10.3.4)
ELEN 5346/4304 DSP and Filter Design Fall 2008
4
Approximation of derivatives
Therefore, the frequency-domain equivalent for (10.3.2) is:
1
1 z
s
T
=
Similarly, the k
th
derivative can be expressed as:
(10.4.1)
1
1
k
k
z
s
T
| |
=
|
\ .
The system transfer function for the digital IIR filter can be approximated as:
1
1 ( ) ( ) z
a
s
T
H z H s
=
=
1
1
z
sT
=
Equivalently:
(10.4.2)
(10.4.3)
(10.4.4)
ELEN 5346/4304 DSP and Filter Design Fall 2008
5
Approximation of derivatives
However, it can be shown that this method is
suitable for a quite limited class of filters due
to its mapping property:
There is an attempt to overcome this limitation
by using an alternative mapping:
1
( ) 1
L
nT kT nT kT
k
k
t nT
y y dy t
dt T T
o
+
=
=
=
Therefore:
( )
1
1
L
k k
k
k
s z z
T
=
=
poles
coefficients in the partial
fraction expansion
(10.6.2)
Periodical sampling will lead to:
1
1
( ) ( )
i
N
t
l i
L
i
h t Ae u t
o
=
=
1
( )
i
N
Tn
n l i n
i
g h nT Ae u
o
=
=
(10.6.3)
(10.6.4)
ELEN 5346/4304 DSP and Filter Design Fall 2008
7
Impulse invariance
The resulting digital filter will be:
( )
0 0 1
1
1 0
( )
i i
N
nT n n
n i
n
N
n
i
i n n i
T
h z e H z A e z A z
o o
= =
= = =
| |
= = =
|
\ .
(10.7.1)
The inner sum converges since o
i
< 0
( )
1
1
0
1
1
i
i
n
T
T
n
e z
e z
o
o
=
=
Therefore:
1
1
( )
1
i
N
i
T
i
A
H z
e z
o
=
=
| |
=
|
+
\ .
This transform is a one-to-one mapping; that is, it maps a single point in the s-
plane to a unique point in the z-plane, and vice versa. The digital transfer function:
1
1
2 1
1
( ) ( ) z
a
s
T
z
G z H s
| |
= |
|
+
\ .
=
(10.8.1)
(10.8.2)
ELEN 5346/4304 DSP and Filter Design Fall 2008
9
Bilinear transform
( )
( )
0
1 1 1
1
2 2 2 2
1
1 1 1
2 2 2 2
s j
sT T T T
j j
jx
z
sT T T T
jx
j j
o o
o
o
c
o
c
o
| |
= + O <
O
+ + + O + +
+
= = = =
O
+
+ O
We can derive from (10.8.1) that
(10.9.1)
In this situation: 1 z BIBO <
Similarly, when o > 0, |z| > 1; therefore, the mapping is correct.
ELEN 5346/4304 DSP and Filter Design Fall 2008
10
Bilinear transform
j
z e
e
= When :
( )
( )
( )
2 2
2
1
1
2 2
2
2 1 2 1 2
1 1
2 sin 2
2 2
tan 2
2cos 2
j
j j
j
j
j
j j
e e e
z e
s
T z T e T
e e e
j
j j
T T
e
e e
e
e e
e e
e
e
e
(
| |
= = =
|
+ +
\ .
( +
= = = O
Therefore:
tan
2 2
T e O
=
Analog freq. Digital freq.
(10.10.1)
(10.10.2)
(10.10.3)
s s
p p
e
e
O
=
O
We can notice that therefore, a
frequency warping (10.10.3) is needed.
ELEN 5346/4304 DSP and Filter Design Fall 2008
11
Bilinear transform
The BT destroys the phase response of an
analog filter but preserves linear magnitude.
analog
digital
Therefore, to design a digital filter meeting the
given specs for the magnitude response, we
need to:
1) prewarp the critical bandage frequencies
(e
p
and e
s
) to find their analog equivalents
(O
p
and O
s
) using (10.10.3);
2) design the analog prototype using the
prewarped critical frequencies;
3) apply the BT to obtain the desired digital
transfer function.
Note: o
p,a
= o
p,d
, o
s,a
= o
s,d.
(10.11.1)
BT is very good for LPF, HPF, BPF, BSF piecewise constant magnitude filters.
BT maps the point s = into the point z = -1.
ELEN 5346/4304 DSP and Filter Design Fall 2008
12
Bilinear transform zero/pole
conversion
Assuming that the analog zeros and poles are known: i.e. the analog transfer
function is in the form:
Applying the BT:
( )
( )
( )
1
1
M
m
m
a N
k
k
s
H s k
s
o
=
=
[
[
( )
( )
( )
( )
1
1
1 1
1
1
1
2
1
2
2
1
2
2
1
2
M
M
m
m
N M
m m
m
a N
N
N M
k
k
k
k k
T
z
T
T
H z k z
T
T T
z
T
o
o
o
=
=
=
=
| | +
\ .
= +
| | +
\ .
[
[
[
[
Constant: new gain factor
N-M zeros at z = -1
(from zeros at )
New poles
New zeros
(10.12.1)
(10.12.2)
ELEN 5346/4304 DSP and Filter Design Fall 2008
13
Bilinear transform zero/pole
conversion
Therefore:
( )
( )
1
1
2
2
M
m
m
d a N
N M
k
k
T
k k
T T
o
[
[
Digital gain:
Digital poles:
Digital zeros:
Need to add N-M zeros at z = -1:
2
2
m
m
m
T
z
T
o
o
+
=
2
2
k
k
k
T
p
T
+
=
(10.13.1)
(10.13.2)
(10.13.3)
ELEN 5346/4304 DSP and Filter Design Fall 2008
14
Theoretical Example
( )
c
c
H s
s
O
=
+ O
Example 10.1: Design a single-pole digital LPF with a 3-dB bandwidth of 0.2t,
by use of the BT applied to the analog filter with the 3-dB bandwidth :
c
O
Using the frequency warping: ( )
2 2 0.65
tan tan 0.1
2
c
c
T T T
e
t
| |
O = = =
|
\ .
0.65 0.65
( )
0.65 0.65
T
H s
s T sT
= =
+ +
The analog filter:
Applying BT:
( )
1
1 1 1 1
1 1
0.245 1
0.65 0.325
( )
1 1 0.325 0.325 1 0.509
2 0.65
1 1
z
H z
z z z z
z z
+
= = =
+ +
+
+ +
Which leads to:
( )
0.245 1
( )
1 0.509
j
j
j
e
H e
e
e
e
e
+
=
(10.14.1)
(10.14.2)
(10.14.3)
(10.14.4)
(10.14.5)
ELEN 5346/4304 DSP and Filter Design Fall 2008
15
Practical Example
Example 10.2: Design a digital LPF starting from the elliptic prototype. The
specs for the digital filter are:
1000 ; 1500 ; 10
2 2
1 0.3 ; 50
p
s
p st s
p s
f Hz f Hz f kHz
dB dB
e
e
t t
o o
= = = = =
= =
4
1 10
s
T f s
= = Note:
The critical frequencies normalized for T = 1:
2 0.2 ; 2 0.3 ; 1.5
p
st s
p s
s s p
f
f
f f
e
e t t e t t
e
= = = = =
1. Frequency pre-warping (for T = 1):
2
tan 0.6498 ; 1.01905 ; 1.568
2
s
p s
p
rad s rad s
T
e O
O = O = O = =
O
ELEN 5346/4304 DSP and Filter Design Fall 2008
16
Practical Example
2. Table lookup (software):
For the specs (actually, slightly higher than given ones):
1 0.28 ; 50.1 ; 5; 1.566
p s s p
dB dB N o o = = = O O =
we find the poles and zeros for O
p
= 1 rad/s:
1,2
3,4
5
1,2
3,4
0.09699 1.0300
0.33390 0.7177
0.49519
1.6170
2.4377
j
j
j
j
o
o
=
=
=
=
=
-3 -2 -1 0 1 2 3
-2
-1
0
1
2
Real Part
I
m
a
g
i
n
a
r
y
P
a
r
t
Slightly
different
from
Matlab
Stable all poles are in the left half of the plane.
ELEN 5346/4304 DSP and Filter Design Fall 2008
17
Practical Example
3. De-normalize the analog design:
Multiply zeros and poles by O
p
:
1,2 1,2 3,4 3,4 5 5
1,2 1,2 3,4 3,4
0.0630 0.6694; 0.2170 0.4664; 0.3216
1.0508; 1.5842
p p p
p p
j j
j j
o o o o
= O = = O = = O =
= O = = O =
4. BT transform of poles and zeros:
2
2
k
k
k
T
p
T
+
=
2
2
m
m
m
T
z
T
o
o
+
=
1,2
3,4
5
1,2
3,4
0.7542 0.5692
0.7278 0.3635
0.7228
0.5673 0.8235
0.2289 0.9734
p j
p j
p
z j
z j
=
=
=
=
=
-1 -0.5 0 0.5 1
-1
-0.5
0
0.5
1
Real Part
I
m
a
g
i
n
a
r
y
P
a
r
t
Since N-M = 1, we must add one zero:
5
1 z =
ELEN 5346/4304 DSP and Filter Design Fall 2008
18
Practical Example
5. Verification
Need to check whether specs are satisfied.
Yes: we are done! No: start over (perhaps,
a higher order of the
prototype will help)
In general (especially, for more complicated filters), multiple iterations may be
needed to satisfy specifications (meet or exceed them).
ELEN 5346/4304 DSP and Filter Design Fall 2008
19
Frequency (spectral) transformation
It is often needed to modify the characteristics of existing digital filter to meet
new specs without starting the design from scratch.
Frequency transformation can convert digital LPF to either another LPF, or HPF,
or BPF, or BSF. The transformation involves replacing the variable z by a rational
function F(), while satisfying the following conditions to preserve BIBO:
1 1 z z
> >
= =
< <
Note: F(z) is an allpass filter:
1 *
1 1 1
1
1
( ) ( )
1
L
l
l
l
z
z F z z F z z
z
o
o
= = =
[
1
l
o < Here to ensure that a stable filter is transferred to another stable filter.
(10.19.1)
(10.19.2)
ELEN 5346/4304 DSP and Filter Design Fall 2008
20
Frequency (spectral) transformation
1. LPF to LPF:
( )
1
1
1
1
1
1 z
F z
z
z
z
z
o
o
o
o
= = =
1
j
j
j
e
e
e
e
e
e
o
o
= = =
sin
2
sin
2
e e
o
e e
| |
|
\ .
=
+
| |
|
\ .
We can relate ANY frequency component of the new LPF to the frequency
component of the prototype LPF.
(10.20.3)
(10.20.4)
ELEN 5346/4304 DSP and Filter Design Fall 2008
21
Frequency (spectral) transformation
sin
2
sin
2
c c
c c
e e
o
e e
| |
|
\ .
=
+
| |
|
\ .
Usually:
From (10.20.2):
( )( )
2
2 2
1
2
1
1 1
j j
j j j
j
j
j j
e e
e e e
e
e
e e
e e
e e e
e
e
e e
o o
o o o
o
o o
+ +
+ + +
= = =
+
+ +
2
1
2
1 sin
tan
2 1 cos
o e
e
o o e
| |
(
| =
|
( + +
\ .
Clearly:
s s
p p
e e
e e
=
(10.21.1)
(10.21.2)
(10.21.3)
(10.21.4)
ELEN 5346/4304 DSP and Filter Design Fall 2008
22
Frequency (spectral) transformation
Example of mapping:
-3 -2 -1 0 1 2 3
-3
-2
-1
0
1
2
3
e/t
e
"
/
t
o = 0
o = 0.6
o = -0.9
e
e
c
-e
c
e
c
e
c
e
Note: the gain in unchanged
ELEN 5346/4304 DSP and Filter Design Fall 2008
23
Frequency (spectral) transformation
2. LPF to HPF:
( )
1 1
1 1
1 1
1
1 z
F z
z
z
z
z
o o
o o
+
+
= = =
+
1
j
j
j
e
e
e
e
e
e
o
o
+
=
+
(10.23.1)
(10.23.2)
j j j
e e e
e e e
o o
+ =
cos
2
co
2
1
s
j j
j j
e e
e e
e e
e e
e e
o
e e
=
| |
|
\ .
=
+
| |
|
+
\ .
2
1
2
1 sin
tan
2 1 cos
o e
e
o o e
| |
(
| =
|
( +
\ .
(10.23.3)
(10.23.4)
(10.23.5)
ELEN 5346/4304 DSP and Filter Design Fall 2008
24
Frequency (spectral) transformation
Example of mapping:
-3 -2 -1 0 1 2 3
-3
-2
-1
0
1
2
3
e/t
e
"
/
t
o = 0
o = 0.6
o = -0.9
e
e
c
-e
c
e
c
e
c
e
ELEN 5346/4304 DSP and Filter Design Fall 2008
25
Frequency (spectral) transformation
3. LPF to BPF (filter order will be doubled):
2 1
1
2 1
1
2
1 1
1 2
1
1 1
z z
z
z z
o| |
| |
| o|
| |
+
+ +
=
+
+ +
2 1
2 1
cos
2
cos
2
c c
c c
e e
o
e e
+
| |
|
\ .
=
| |
|
\ .
2 1
cotan tan
2 2
c c c
e e e
|
| | | |
=
| |
\ . \ .
(10.25.1)
(10.25.2)
(10.25.3)
Here and are new upper and lower cutoff frequencies.
2 c
e
1 c
e
ELEN 5346/4304 DSP and Filter Design Fall 2008
26
Frequency (spectral) transformation
A special case: bandwidth preserving
2 1 c c c
e e e =
Therefore:
2 1 1
1 1
1 1
1 1
z z z
z z
z z
o o
o o
| |
= =
|
+
\ .
1 | =
and:
(10.26.1)
(10.26.2)
(10.26.3)
ELEN 5346/4304 DSP and Filter Design Fall 2008
27
4. LPF to BSF (filter order will be doubled):
2 1
1
2 1
1
2
1 1
1 2
1
1 1
z z
z
z z
o |
| |
| o
| |
+
+ +
=
+
+ +
2 1
2 1
cos
2
cos
2
c c
c c
e e
o
e e
+
| |
|
\ .
=
| |
|
\ .
Frequency (spectral) transformation
2 1
tan tan
2 2
c c c
e e e
|
| | | |
=
| |
\ . \ .
(10.27.1)
(10.27.2)
(10.27.3)
ELEN 5346/4304 DSP and Filter Design Fall 2008
28
Spectral transformation: Example
Example 10.3: Design a BW preserving BPF from the LP prototype:
1
1
1 1
( )
1 0.9 0.9
z z
G z
z z
+ +
= =
-1 -0.5 0 0.5 1
-1
-0.5
0
0.5
1
Real Part
I
m
a
g
i
n
a
r
y
P
a
r
t
( )
0
1
2
( ) 20 26
1 0.9
j
z e
G z dB
= =
= = ~
| |
=
|
\ .
Assuming - this is where we map DC.
( )
0 0 0 0 0
0
1 cos
j j j j j
e e e e e
e e e e e
o o o o o e
= = =
0
0.4 e t =
0.309016994 o =
1
1 1 1
1
( )
1
z
z F z z
z
o
o
| |
= =
|
\ .
1
1 1
1 ( )
( )
( ) 1
z z z
F z
z z z
o o
o o
= =
In a general case, both o and | can be found from (10.27.2) and (10.27.2).
ELEN 5346/4304 DSP and Filter Design Fall 2008
30
Spectral transformation: Example
Method 1:
1
1
1
( ) ( )
1 0.9
LP BP
z
G z G z
z
+
=
( )( )
( )( )
1
1
1 1 2 1
1
1 1 1 1 2
1
1
2
1 2
1
1 1
1
( )
1 1 0.9 0.9
1 0.9
1
1
1 1.9 0.9
BP
z
z
z z z z
z
G z
z z z z z
z
z
z
z z
o
o o o
o
o o o o
o
o
| |
+
|
+
\ .
= =
| | +
\ .
=
+
Method 2: SFG replacement
ELEN 5346/4304 DSP and Filter Design Fall 2008
31
Spectral transformation: Example
Method 3 (preferred):
Zeros:
1 2
2
,
2
( )
( ) 1 1
1
1 1
k k
z z
z F z z z z
z
z z
o
o o
o
= = + = +
= =
Poles:
2
2
2
1 2
2
, 2 1 ,
( )
( )
1
1.9 0.9 0
0.2936 0
1.9 1.9 4 0
.902
.9
2
1
k k
p p
p F p p p p
p
p
p
p
p j
o
o o
o
o
o o
= 0.9 = 0.90.9 = +
+ =
= =
Therefore: { }
2 2
1 2 1 2
1 1
( ) 1
1 1.9 0.9 1 0.5871 0.9
BP
z z
G z k k
z z z z o
+ +
= = = =
+ +
Gain factor
The new gain can be determined experimentally