1
Copyright © 2005, S. K. Mitra
Spectral Transformations of Spectral Transformations of
IIR Digital Filters IIR Digital Filters
• Objective-Transform a given lowpass digital transfer function to another digital transfer function that could be a lowpass, highpass, bandpass or bandstop filter
• has been used to denote the unit delay in the prototype lowpass filter and to denote the unit delay in the transformed filter to avoid confusion
) (z GL
ˆ) (z GD
ˆ−1
z
−1
z
) (z GL
ˆ) (z GD
2
Copyright © 2005, S. K. Mitra
Spectral Transformations of Spectral Transformations of
IIR Digital Filters IIR Digital Filters
• Unit circles in z- and -planes defined by ,
• Transformation from z-domain to -domain given by
• Then
zˆ
zˆ
=ejω
z zˆ=ejωˆ
ˆ) (z F z=
)}
ˆ ( { ) ˆ
(z G F z GD = L
3
Copyright © 2005, S. K. Mitra
Spectral Transformations of Spectral Transformations of
IIR Digital Filters IIR Digital Filters
• From , thus , hence
• Recall that a stable allpass functionA(z) satisfies the condition
ˆ) (z F
z= z= F(zˆ)
⎪⎩
⎪⎨
⎧
<
<
=
=
>
>
1 if , 1
1 if , 1
1 if , 1 ˆ) (
z z z z
F
4
Copyright © 2005, S. K. Mitra
Spectral Transformations of Spectral Transformations of
IIR Digital Filters IIR Digital Filters
• Therefore must be a stable allpass function whose general form is
⎪⎩
⎪⎨
⎧
<
>
=
=
>
<
1 if , 1
1 if , 1
1 if , 1 ) (
z z z z
A
ˆ) ( / 1 F z
1 ˆ ,
1 ˆ ˆ)
( 1
1
* ⎟⎟⎠ α <
⎜⎜ ⎞
⎝
⎛ α
− α
± −
= ∏
= l
l l
L l
z z z
F
5
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Lowpass Lowpass Spectral Transformation Spectral Transformation
• To transform a lowpass filter with a cutoff frequency to another lowpass filter
with a cutoff frequency , the transformation is
where αis a function of the two specified cutoff frequencies
) (z GL
ˆ) (z GD
ωc
ωˆc
α
−α
= −
− =
z z z
z F
ˆ 1 ˆ ˆ) (
1 1
6
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Lowpass Lowpass Spectral Transformation Spectral Transformation
• On the unit circle we have
• From the above we get
• Taking the ratios of the above two expressions
ω
− ω ω −
−
α
− −α
= ˆ ˆ
1 j
j j
e e e
) 2 / ˆ 1 tan(
) 1 2 /
tan( ⎟ ω
⎠
⎜ ⎞
⎝
⎛ −+αα
= ω
ω
− ω
− ω
− ω ω −
−
α
⋅ − α
± α =
− α
= ˆ− ˆ ˆ ˆ
1 ) 1 1 ( 1 1
1 j
j j
j j
e e e
e m e m m
7
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Lowpass Lowpass Spectral Transformation Spectral Transformation
• Solving we get
• Example-Consider the lowpass digital filter
which has a passband from dcto with a 0.5dB ripple
• Redesign the above filter to move the passband edge to
( )
(
( ˆ )/2)
sin
2 / ˆ ) ( sin
c c
c c+ω ω
ω
−
= ω α
) 3917 . 0 6763 . 0 1 )(
2593 . 0 1 (
) 1 ( 0662 . ) 0
( 1 1 2
3 1
−
−
−
−
+
−
−
= +
z z
z z z
GL
π 25 . 0
π 35 .
0 8
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Lowpass Lowpass Spectral Transformation Spectral Transformation
• Here
• Hence, the desired lowpass transfer function is 1934
. ) 0 3 . 0 sin(
) 05 . 0
sin( =−
π
− π
= α
1 1 1
ˆ 1934 . 0 1
1934 . 0
) ˆ
( ) ˆ (
−
− −
+
= +
=
z z z
L
D z G z
G
0 0.2 0.4 0.6 0.8 1
-40 -30 -20 -10 0
ω/π
Gain, dB G
L(z) G D(z)
9
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Lowpass Lowpass Spectral Transformation Spectral Transformation
• The lowpass-to-lowpass transformation
can also be used as highpass-to-highpass, bandpass-to-bandpassand bandstop-to- bandstoptransformations
α
−α
= −
− =
z z z
z F
ˆ ˆ 1 ˆ) (
1 1
10
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Highpass Highpass Spectral Transformation Spectral Transformation
• Desired transformation
• The transformation parameter is given by
where is the cutoff frequency of the lowpass filter and is the cutoff frequency of the desired highpass filter
1 1 1
1 ˆ ˆ
−
− −
α +
α
− +
= z z z
( )
(
( ˆ )/2)
cos
2 / ) ˆ ( cos
c c
c c
ω
− ω
ω +
− ω
= α
α
ωc
ωˆc
11
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass -to - to- -Highpass Highpass Spectral Transformation Spectral Transformation
• Example-Transform the lowpass filter
• with a passband edge at to a highpass filter with a passband edge at
• Here
• The desired transformation is
) 3917 . 0 6763 . 0 1 )(
2593 . 0 1 (
) 1 ( 0662 . ) 0
( 1 1 2
3 1
−
−
−
−
+
−
−
= +
z z
z z z
GL
π 25 .
0 0.55π 3468 . 0 ) 15 . 0 cos(
/ ) 4 . 0
cos( π π =−
−
= α
1 1
1
3468ˆ . 0 1
3468 . ˆ 0
−
− −
−
− −
= z
z z
12
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Highpass Highpass Spectral Transformation Spectral Transformation
• The desired highpass filter is
1 1 1
ˆ 3468 . 0 1
3468 . ˆ 0
) ( ) ˆ (
−
− −
−
− −
= =
z z z
D z G z
G
0 0.2π 0.4π 0.6π 0.8π π
−80
−60
−40
−20 0
Normalized frequency
Gain, dB
13
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Highpass Highpass Spectral Transformation Spectral Transformation
• The lowpass-to-highpasstransformation can also be used to transform a highpassfilter with a cutoff at to a lowpassfilter with a cutoff at
and transform a bandpassfilter with a center frequency at to a bandstopfilter with a center frequency at
ωc
ωˆc
ωˆo
ωo
14
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Bandpass Bandpass Spectral Transformation Spectral Transformation
• Desired transformation
ˆ 1 1 ˆ 2
1 1
1 ˆ 1 1 ˆ 2
1 2
1 2
1
+ + β
− αβ + β
−
β β+
− +β + β
− αβ
−
= − −
−
−
−
z z
z z
z
15
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Bandpass Bandpass Spectral Transformation Spectral Transformation
• The parameters and are given by
where is the cutoff frequency of the lowpass filter, and and are the desired upper and lower cutoff frequencies of the bandpass filter
α β
(
(ˆ ˆ )/2)
tan( /2)cot ωc2−ωc1 ωc
= β
( )
(
(ˆ ˆ )/2)
cos
2 / ) ˆ ˆ ( cos
1 2
1 2
c c
c c
ω
− ω
ω +
= ω α
ωc
ˆc1
ω ωˆc2
16
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Bandpass Bandpass Spectral Transformation Spectral Transformation
• Special Case-The transformation can be simplified if
• Then the transformation reduces to
where with denoting the desired center frequency of the bandpass filter
1
2 ˆ
ˆc c
c=ω −ω ω
ωo
=
α cosˆ ωˆo
1 1 1 1
1 ˆ
ˆ ˆ −
− −
−
α
− α
− −
= z
z z z
17
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Bandstop Bandstop Spectral Transformation Spectral Transformation
• Desired transformation
ˆ 1 1 ˆ 2 1 1
1 ˆ 1 1 ˆ 2
1 2
1 2
1
+ + + −
− +
+ −
− +
= − −
−
−
−
z z
z z
z
β αβ β
β β
β β
αβ
18
Copyright © 2005, S. K. Mitra
Lowpass
Lowpass- -to to- -Bandstop Bandstop Spectral Transformation Spectral Transformation
• The parameters and are given by
where is the cutoff frequency of the lowpass filter, and and are the desired upper and lower cutoff frequencies of the bandstop filter
ωc
α β
ˆc1
ω ωˆc2
( )
(
(ˆ ˆ )/2)
cos
2 / ) ˆ ˆ ( cos
1 2
1 2
c c
c c −ω ω
ω +
= ω α
(
(ˆ ˆ )/2)
tan( /2) tan ωc2−ωc1 ωc= β
19
Copyright © 2005, S. K. Mitra
Generation of
Generation of Allpass Allpass Function Using MATLAB Function Using MATLAB
• The allpass function needed for the spectral transformation from a specified lowpass transfer function to a desired highpassor bandpassor bandstoptransfer function can be generated using MATLAB
20
Copyright © 2005, S. K. Mitra
Generation of
Generation of Allpass Allpass Function Using MATLAB Function Using MATLAB
• Lowpass-to-Highpass Transformation
• Basic form:
[AllpassNum,AllpassDen] = allpasslp2hp(wold,wnew) where woldis the specified angular bandedge frequency of the original lowpass filter, and wnewis the desired angular bandedge frequency of the highpass filter
21
Copyright © 2005, S. K. Mitra
Generation of
Generation of Allpass Allpass Function Using MATLAB Function Using MATLAB
• Lowpass-to-Bandpass Transformation
• Basic form:
[AllpassNum,AllpassDen] = allpasslp2bp(wold,wnew) where woldis the specified angular bandedge frequency of the original lowpass filter, and wnewis the desired angular bandedge frequency of thebandpassfilter
22
Copyright © 2005, S. K. Mitra
Generation of
Generation of Allpass Allpass Function Using MATLAB Function Using MATLAB
• Lowpass-to-Bandstop Transformation
• Basic form:
[AllpassNum,AllpassDen] = allpasslp2bs(wold,wnew) where woldis the specified angular bandedge frequency of the original lowpass filter, and wnewis the desired angular bandedge frequency of the bandstopfilter
23
Copyright © 2005, S. K. Mitra
Generation of
Generation of Allpass Allpass Function Using MATLAB Function Using MATLAB
• Lowpass-to-Highpass Example – wold= 0.25π, wnew= 0.55π
• The MATLAB statement [APnum, APden]
= allpasslp2hp(0.25, 0.55) yields the mapping
1 3468 0
3468 0
1 1 1
+
− +
→ − − −
−
z z z
. .
24
Copyright © 2005, S. K. Mitra
Spectral Transformation Spectral Transformation
Using MATLAB Using MATLAB
• The pertinent M-files areiirlp2lp, iirlp2hp,iirlp2bp, andiirlp2bs
• Lowpass-to-Highpass Example –
Passband edge wold=0.25π
Desired passband edge of highpass filter wnew=0.55π
3 2
1
3 1
1015 0 5669 0 9353 0 1
1 066 0
−
−
−
−
− +
−
= +
z z
z z z
GLP
. .
.
) ( ) .
(
25
Copyright © 2005, S. K. Mitra
Spectral Transformation Spectral Transformation
Using MATLAB Using MATLAB
• The MATLAB code fragments used are
b = 0.066*[1 3 3 1];
a = [1.00 -0.9353 0.5669 -0.1015];
[num,den,APnum,APden]
= iirlp2hp(b,a,0.25,0.55);
• The desired highpassfilter obtained is
3 2
1
3 1
0329 0 3661 0 3521 0 1
1 218 0
−
−
−
−
− +
−
= −
z z
z z z
GHP
. .
.
) ( ) .
(
26
Copyright © 2005, S. K. Mitra
IIR Digital Filter Design Using IIR Digital Filter Design Using
MATLAB MATLAB
• Order Estimation-
• For IIR filter design using bilinear transformation, MATLAB statements to determine the order and bandedge are:
[N, Wn] = buttord(Wp, Ws, Rp, Rs);
[N, Wn] = cheb1ord(Wp, Ws, Rp, Rs);
[N, Wn] = cheb2ord(Wp, Ws, Rp, Rs);
[N, Wn] = ellipord(Wp, Ws, Rp, Rs);
27
Copyright © 2005, S. K. Mitra
IIR Digital Filter Design Using IIR Digital Filter Design Using
MATLAB MATLAB
• Example-Determine the minimum order of a Type 2 Chebyshev digital highpass filter with the following specifications:
kHz, kHz, kHz, dB, dB
• Here, ,
• Using the statement
[N, Wn] = cheb2ord(0.5, 0.3, 1, 40);
we get N = 5 and Wn = 0.3224
=1
Fp Fs=0.6 FT =4
=1
αp αs=40 5 . 0 4 / 1 2
Wp= × = Ws=2×0.6/4=0.3
28
Copyright © 2005, S. K. Mitra
IIR Digital Filter Design Using IIR Digital Filter Design Using
MATLAB MATLAB
• Filter Design-
• For IIR filter design using bilinear
transformation, MATLAB statements to use are:
[b, a] = butter(N, Wn) [b, a] = cheby1(N, Rp, Wn) [b, a] = cheby2(N, Rs, Wn) [b, a] = ellip(N, Rp, Rs, Wn)
29
Copyright © 2005, S. K. Mitra
IIR Digital Filter Design Using IIR Digital Filter Design Using
MATLAB MATLAB
• The form of transfer function obtained is
• The frequency response can be computed using the M-filefreqz(b, a, w)wherewis a set of specified angular frequencies
• It generates a set of complex frequency response samples from which magnitude and/or phase response samples cn be computed
N N
z N a z
a
z N b z
b b z A
z z B
G − −
−
−
+ + + +
+ + +
= +
= 1 (2) ( 1)
) 1 ( )
2 ( ) 1 ( ) (
) ) (
( 1
1
L L
30
Copyright © 2005, S. K. Mitra
IIR Digital Filter Design Using IIR Digital Filter Design Using
MATLAB MATLAB
• Example-Design an elliptic IIR lowpass filter with the specifications: kHz,
kHz, kHz, dB, dB
• Here, ,
• Code fragments used are:
[N,Wn] = ellipord(0.4, 0.5, 0.5, 40);
[b, a] = ellip(N, 0.5, 40, Wn);
8 .
=0 Fp
=1
Fs FT =4 αp=0.5
=40 αs
π
= π
=
ωp 2 Fp/FT 0.4 ωs =2πFs/FT=0.5π
31
Copyright © 2005, S. K. Mitra
IIR Digital Filter Design Using IIR Digital Filter Design Using
MATLAB MATLAB
• Gain response plot is shown below:
0 0.2 0.4 0.6 0.8 1
-60 -40 -20 0
ω/π
Gain, dB
Elliptic IIR Lowpass Filter
0 0.1 0.2 0.3 0.4
-0.5 -0.4 -0.3 -0.2 -0.1 0
ω/π
Gain, dB
Passband Details
32
Copyright © 2005, S. K. Mitra
Computer
Computer -Aided Design of - Aided Design of IIR Digital Filter IIR Digital Filter
• The IIR filter design algorithms discussed so far are used in applications requiring filters with a frequency-selective magnitude response having either a lowpass or a highpass or a bandpass or a bandstop characteristics
• Designing IIR filters with other types of frequency responses usually involve the use of some type of iterative optimization techniques that are used to minimize the error between the desired response and that of the computer-generated filter
33
Copyright © 2005, S. K. Mitra
Computer
Computer- -Aided Design of Aided Design of IIR Digital Filter IIR Digital Filter
• Basic Idea -
• Let denote the frequency response of the computer generated transfer function H(z)
• Let denote the desired frequency response
• Objective is to design H(z)so that approximates in some sense
) (ejω H
) (ejω D
) (ejω H )
(ejω D
34
Copyright © 2005, S. K. Mitra
Computer
Computer -Aided Design of - Aided Design of IIR Digital Filter IIR Digital Filter
• Usually the difference between and specified as a weighted error
function E(ω)
is minimized for all values of ωover closed subintervals of
where is some user-specified positive weighting function
) (ejω H )
(ejω D
)]
( ) ( )[
( )
(ω =W ejω H ejω −D ejω E
π
≤ ω
≤ 0 ) (ejω W
35
Copyright © 2005, S. K. Mitra
Computer
Computer- -Aided Design of Aided Design of IIR Digital Filter IIR Digital Filter
• A commonly used approximation measure, called Chebyshevor minimax criterion, is to minimize the peak absolute valueof E(ω) given by
where Ris the set of disjoint frequency bands in the range , on which the desired frequency response is defined
π
≤ ω 0≤
) (
max ω
= ε ω∈ E
R
36
Copyright © 2005, S. K. Mitra
Computer
Computer -Aided Design of - Aided Design of IIR Digital Filter IIR Digital Filter
• In filtering applications, Ris composed of the desired passbands and stopbands of the filter to be designed
• For example, for a lowpass filterdesign, R is the disjoint union of the frequency ranges
and , where and are, respectively, the passbandand stopband edges
] ,
[0 ωp [0,ωs] ωp ωs
37
Copyright © 2005, S. K. Mitra
Computer
Computer- -Aided Design of Aided Design of IIR Digital Filter IIR Digital Filter
• Another approximation measure, called the least-p criterion, is to minimize the integral of the p-th power of E(ω):
over the specified frequency range Rwith p a positive integer
ω
−
= ε ∫
∈ ω
ω ω
ω H e D e d
e
W p
R
j j
j )[ ( ) ( )]
(
38
Copyright © 2005, S. K. Mitra
Computer
Computer -Aided Design of - Aided Design of IIR Digital Filter IIR Digital Filter
• The least-squares criterionobtained withp= 2 is often used for simplicity
• It can be shown that as , theleast p-th solutionapproaches theminimax solution
• In practice, the integral error measure is approximated by a finite sum given by
where , , is a suitably chosen dense grid of digital angular frequencies
K p i
j j
j i i i
e D e H e
∑W
=
ω ω
ω −
= ε
1
)]
( ) ( )[
(
∞
→ p
ωi 1≤i≤K
39
Copyright © 2005, S. K. Mitra
Group Delay Equalization of Group Delay Equalization of
IIR Digital Filter IIR Digital Filter
• For a distortion-free transmission of an input signal in a prescribed frequency range through a digital filter, the transfer function of the filter should exhibit a unity
magnitude responseand a linear-phase response, i.e., a constant group delay, in the frequency band of interest
40
Copyright © 2005, S. K. Mitra
Group Delay Equalization of Group Delay Equalization of
IIR Digital Filter IIR Digital Filter
• The IIR digital filter design methods discussed so far lead to transfer functions with nonlinear phase responses
• Thus, to arrive at a frequency selective IIR digital filter with a constant group delay, a practical approach is to cascade the IIR digital filter meeting the magnitude response specifications with an allpass filter so that the overall group delay is a constant group delay in the band of interest
41
Copyright © 2005, S. K. Mitra
Group Delay Equalization of Group Delay Equalization of
IIR Digital Filter IIR Digital Filter
• The allpass delay equalizer is usually designed using a computer-aided optimization method
• We outline one such method next
• LetH(z) be the transfer function of the IIR digital filter with a group delay given by
(ω) τH
42
Copyright © 2005, S. K. Mitra
Group Delay Equalization of Group Delay Equalization of
IIR Digital Filter IIR Digital Filter
• Objective is to design a stable allpass section with a transfer function
with a group delay and cascade it with the IIR digital filterH(z) such that the overall group delay is a constant
H(z) A(z)
∏= − −
−
−
⎟⎟
⎠
⎞
⎜⎜
⎝
⎛
+ +
+
= M +
z d z d
z z d z d
A
1 2
1 2 1
2 1 1
2
l 1 l l
l l
, ,
,
) ,
(
(ω) τA
) ( ) ( )
(ω =τ ω +τ ω
τ H A
43
Copyright © 2005, S. K. Mitra
Group Delay Equalization of Group Delay Equalization of
IIR Digital Filter IIR Digital Filter
• Moreover, to guarantee stability we need to ensure that
• The allpass delay equalizer design problem can be formulated as a minimax optimization problem in which we minimize the peak absolute value of the error
τo
− ω τ
= ω) ( ) E(
l l
l , ,
, , 1 2
2 1 d 1 d
d ≤ < +
44
Copyright © 2005, S. K. Mitra
Group Delay Equalization of Group Delay Equalization of
IIR Digital Filter IIR Digital Filter
• The adjustable parameters are the desired delay and the coefficients , of the allpass filter
• The M-file iirgrpdelaycan be used to design the allpass delay equalizer
l 1,
d d2,l τo
45
Copyright © 2005, S. K. Mitra
Group Delay Equalization of Group Delay Equalization of
IIR Digital Filter IIR Digital Filter
• Example–We design an 8-th order allpass equalizer to equalize the group delay of a 4-th order elliptic lowpass filter with a passband edgeat 0.3π, passband rippleof 1 dBand a minimum stopband attenuationof 30 dBusingProgram 9_4.m
• The group delays of the lowpass filter and the overall cascade are shown on the next slide
46
Copyright © 2005, S. K. Mitra
Group Delay Equalization of Group Delay Equalization of
IIR Digital Filter IIR Digital Filter
0 0.2 0.4 0.6 0.8 1
0 5 10 15 20 25 30
ω/π
Group delay, samples
Group Delay Equalized Filter
0 0.2 0.4 0.6 0.8 1
0 5 10 15
ω/π
Group delay, samples
Original Filter
It can be shown that the designed allpass filter is stable