basic iir digital filter structures - signal and image...
TRANSCRIPT
Copyright © 2001, S. K. Mitra1
Basic IIR Digital FilterBasic IIR Digital FilterStructuresStructures
• The causal IIR digital filters we areconcerned with in this course arecharacterized by a real rational transferfunction of or, equivalently by a constantcoefficient difference equation
• From the difference equation representation,it can be seen that the realization of thecausal IIR digital filters requires some formof feedback
1−z
Copyright © 2001, S. K. Mitra2
Basic IIR Digital FilterBasic IIR Digital FilterStructuresStructures
• An N-th order IIR digital transfer function ischaracterized by 2N+1 unique coefficients,and in general, requires 2N+1 multipliersand 2N two-input adders for implementation
• Direct form IIR filters: Filter structures inwhich the multiplier coefficients areprecisely the coefficients of the transferfunction
Copyright © 2001, S. K. Mitra3
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
• Consider for simplicity a 3rd-order IIR filterwith a transfer function
• We can implement H(z) as a cascade of twofilter sections as shown on the next slide
33
22
11
33
22
110
1 −−−
−−−
++++++==
zdzdzdzpzpzpp
zDzPzH)()(
)(
Copyright © 2001, S. K. Mitra4
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
where
33
22
1101
−−− +++=== zpzpzppzPzXzWzH )()()(
)(
)(zH1 )(zH2)(zW
)(zX )(zY
33
22
11
2 111
−−− +++===
zdzdzdzDzWzYzH
)()()(
)(
Copyright © 2001, S. K. Mitra5
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
• The filter section can be seen to bean FIR filter and can be realized as shownbelow
]3[]2[]1[][][ 3210 −+−+−+= nxpnxpnxpnxpnw
)(zH1
Copyright © 2001, S. K. Mitra6
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
• The time-domain representation of isgiven by
Realization offollows from theabove equationand is shown onthe right
)(zH2
][][][][][ 321 321 −−−−−−= nydnydnydnwny)(zH2
Copyright © 2001, S. K. Mitra7
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
• A cascade of the two structures realizingand leads to the realization ofshown below and is known as the directform I structure
)(zH2
)(zH1)(zH
Copyright © 2001, S. K. Mitra8
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
• Note: The direct form I structure isnoncanonic as it employs 6 delays to realizea 3rd-order transfer function
• A transpose of the direct form I structure is shown on the rightand is called the directform I structuret
Copyright © 2001, S. K. Mitra9
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
• Various other noncanonic direct formstructures can be derived by simple blockdiagram manipulations as shown below
Copyright © 2001, S. K. Mitra10
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
• Observe in the direct form structure shownbelow, the signal variable at nodes andare the same, and hence the two top delayscan be shared
1 '1
Copyright © 2001, S. K. Mitra11
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
• Likewise, the signal variables at nodesand are the same, permitting the sharingof the middle two delays
• Following the same argument, the bottomtwo delays can be shared
• Sharing of all delays reduces the totalnumber of delays to 3 resulting in a canonicrealization shown on the next slide alongwith its transpose structure
2'2
Copyright © 2001, S. K. Mitra12
Direct Form IIR Digital FilterDirect Form IIR Digital FilterStructuresStructures
• Direct form realizations of an N-th order IIRtransfer function should be evident
Copyright © 2001, S. K. Mitra13
Cascade Form IIR DigitalCascade Form IIR DigitalFilter StructuresFilter Structures
• By expressing the numerator and thedenominator polynomials of the transferfunction as a product of polynomials oflower degree, a digital filter can be realizedas a cascade of low-order filter sections
• Consider, for example, H(z) = P(z)/D(z)expressed as
)()()()()()(
)()()(
321
321zDzDzD
zPzPzPzDzPzH ==
Copyright © 2001, S. K. Mitra14
Cascade Form IIR DigitalCascade Form IIR DigitalFilter StructuresFilter Structures
• Examples of cascade realizations obtainedby different pole-zero pairings are shownbelow
Copyright © 2001, S. K. Mitra15
Cascade Form IIR DigitalCascade Form IIR DigitalFilter StructuresFilter Structures
• Examples of cascade realizations obtainedby different ordering of sections are shownbelow
Copyright © 2001, S. K. Mitra16
Cascade Form IIR DigitalCascade Form IIR DigitalFilter StructuresFilter Structures
• There are altogether a total of 36 differentcascade realizations of
based on pole-zero-pairings and ordering• Due to finite wordlength effects, each such
cascade realization behaves differently fromothers
)()()()()()()(zDzDzD
zPzPzPzH321
221=
Copyright © 2001, S. K. Mitra17
Cascade Form IIR DigitalCascade Form IIR DigitalFilter StructuresFilter Structures
• Usually, the polynomials are factored into aproduct of 1st-order and 2nd-orderpolynomials:
• In the above, for a first-order factor
∏
++++= −−
−−
k kk
kkzzzzpzH 2
21
1
22
11
0 11
ααββ
)(
022 == kk βα
Copyright © 2001, S. K. Mitra18
Cascade Form IIR DigitalCascade Form IIR DigitalFilter StructuresFilter Structures
• Consider the 3rd-order transfer function
• One possible realization is shown below
++
= −−
−−
−
− ++
+
+2
221
12
222
112
111
111
11
11
0 zzpzH zz
zz
ααββ
αβ)(
Copyright © 2001, S. K. Mitra19
Cascade Form IIR DigitalCascade Form IIR DigitalFilter StructuresFilter Structures
• Example - Direct form II and cascade formrealizations of
are shown on the next slide
321
321
201804010203620440
−−−
−−−
−++
++=zzzzzzzH
...
...)(
= −
−
−−
−−
−++
++1
1
21
21
401508010203620440
zz
zzzz
...
...
Copyright © 2001, S. K. Mitra20
Cascade Form IIR DigitalCascade Form IIR DigitalFilter StructuresFilter Structures
Direct form II Cascade form
Copyright © 2001, S. K. Mitra21
Parallel Form IIR Digital FilterParallel Form IIR Digital FilterStructuresStructures
• A partial-fraction expansion of the transferfunction in leads to the parallel form Istructure
• Assuming simple poles, the transfer functionH(z) can be expressed as
• In the above for a real pole
∑
+= −−
−
++
+
k zzz
kk
kkzH 22
11
110
10 ααγγγ)(
012 == kk γα
1−z
Copyright © 2001, S. K. Mitra22
Parallel Form IIR Digital FilterParallel Form IIR Digital FilterStructuresStructures
• A direct partial-fraction expansion of thetransfer function in z leads to the parallelform II structure
• Assuming simple poles, the transfer functionH(z) can be expressed as
• In the above for a real pole
∑
+= −−
−−
++
+
k zzzz
kk
kkzH 22
11
22
10
10 ααδδδ)(
022 == kk δα
Copyright © 2001, S. K. Mitra23
Parallel Form IIR Digital FilterParallel Form IIR Digital FilterStructuresStructures
• The two basic parallel realizations of a 3rd-order IIR transfer function are shown below
Parallel form I Parallel form II
Copyright © 2001, S. K. Mitra24
Parallel Form IIR Digital FilterParallel Form IIR Digital FilterStructuresStructures
• Example - A partial-fraction expansion of
in yields
321
321
201804010203620440
−−−
−−−
−++
++=zzzzzzzH
...
...)(
21
1
1 508012050
4016010 −−
−
− ++
−−
−++−=
zzz
zzH
..
..
.
..)(
1−z
Copyright © 2001, S. K. Mitra25
Parallel Form IIR Digital FilterParallel Form IIR Digital FilterStructuresStructures
• The corresponding parallel form I realizationis shown below
Copyright © 2001, S. K. Mitra26
Parallel Form IIR Digital FilterParallel Form IIR Digital FilterStructuresStructures
• Likewise, a partial-fraction expansion ofH(z) in z yields
• The correspondingparallel form IIrealization is shownon the right
21
11
1
1
5080125020
401240
−−
−−
−
−
++
+
−+=
zzzz
zzzH
..
..
.
.)(
Copyright © 2001, S. K. Mitra27
Realization Using MATLABRealization Using MATLAB• The cascade form requires the factorization
of the transfer function which can bedeveloped using the M-file zp2sos
• The statement sos = zp2sos(z,p,k)generates a matrix sos containing thecoefficients of each 2nd-order section of theequivalent transfer function H(z) determinedfrom its pole-zero form
Copyright © 2001, S. K. Mitra28
Realization Using MATLABRealization Using MATLAB• sos is an matrix of the form
whose i-th row contains the coefficientsand , of the the numerator anddenominator polynomials of the i-th 2nd-order section
6×L
=
2L1L0L2L1L0L
221202221202211101211101
dddppp
dddpppdddppp
sos
}{ lip}{ lid
Copyright © 2001, S. K. Mitra29
Realization Using MATLABRealization Using MATLAB
• L denotes the number of sections• The form of the overall transfer function is
given by
• Program 6_1 can be used to factorize anFIR and an IIR transfer function
∏∏=
−−
−−
= ++++==
L
i iii
iiiL
ii zdzdd
zpzppzHzH1
22
110
22
110
1)()(
Copyright © 2001, S. K. Mitra30
Realization Using MATLABRealization Using MATLAB
• Note: An FIR transfer function can betreated as an IIR transfer function with aconstant numerator of unity and adenominator which is the polynomialdescribing the FIR transfer function
Copyright © 2001, S. K. Mitra31
Realization Using MATLABRealization Using MATLAB
• Parallel forms I and II can be developedusing the functions residuez andresidue, respectively
• Program 6_2 uses these two functions
Copyright © 2001, S. K. Mitra32
Realization of Realization of Allpass Allpass FiltersFilters• An M-th order real-coefficient allpass
transfer function is characterized byM unique coefficients as here the numeratoris the mirror-image polynomial of thedenominator
• A direct form realization of requires2M multipliers
• Objective - Develop realizations ofrequiring only M multipliers
)(zAM
)(zAM
)(zAM
Copyright © 2001, S. K. Mitra33
Realization Using MultiplierRealization Using MultiplierExtraction ApproachExtraction Approach
• Now, an arbitrary allpass transfer functioncan be expressed as a product of 2nd-orderand/or 1st-order allpass transfer functions
• We consider first the minimum multiplierrealization of a 1st-order and a 2nd-orderallpass transfer functions
Copyright © 2001, S. K. Mitra34
First-OrderFirst-Order Allpass Allpass Structures Structures• Consider first the 1st-order allpass transfer
function given by
• We shall realize the above transfer functionin the form a structure containing a singlemultiplier as shown below1d
1d1X
2X1Y
2Y
11
11
1 1)( −
−
++=
zdzdzA
Copyright © 2001, S. K. Mitra35
First-OrderFirst-Order Allpass Allpass Structures Structures
• We express the transfer functionin terms of the transfer parameters of thetwo-pair as
• A comparison of the above with
yields1
1
11
11 −
−
++=
zdzdzA )(
221
21122211111
221
1211211 111 td
ttttdttddtt
tzA−
−−=
−+= )()(
111 XYzA /)( =
1211222111
221
11 −=−−== −− ttttztzt ,,
Copyright © 2001, S. K. Mitra36
First-OrderFirst-Order Allpass Allpass Structures Structures
• Substituting and in we get
• There are 4 possible solutions to the aboveequation:Type 1A:Type 1B:
121122211 −=− tttt1
11−= zt 1
22−−= zt
22112 1 −−= ztt
11 212
121
221
11 =−=−== −−− tztztzt ,,,
121
112
122
111 11 −−−− −=+=−== ztztztzt ,,,
Copyright © 2001, S. K. Mitra37
First-OrderFirst-Order Allpass Allpass Structures Structures
• Type 1A :• Type 1B :
• We now develop the two-pair structure forthe Type 1A allpass transfer function
22112
122
111 11 −−− −==−== zttztzt ,,,
121
112
122
111 11 −−−− +=−=−== ztztztzt ,,,
t
t
Copyright © 2001, S. K. Mitra38
First-OrderFirst-Order Allpass Allpass Structures Structures
• From the transfer parameters of this allpasswe arrive at the input-output relations:
• A realization of the above two-pair issketched below
21
12 XzXY −−=
221
22
11
1 1 XYzXzXzY +=−+= −−− )(
Copyright © 2001, S. K. Mitra39
First-OrderFirst-Order Allpass Allpass Structures Structures
• By constraining the , terminal-pairwith the multiplier , we arrive at theType 1A allpass filter structure shownbelow
2X 2Y1d
Type 1A
Copyright © 2001, S. K. Mitra40
First-Order First-Order Allpass Allpass StructuresStructures• In a similar fashion, the other three single-
multiplier first-order allpass filter structurescan be developed as shown below
Type 1B Type 1A t
Type 1B t
Copyright © 2001, S. K. Mitra41
Second-OrderSecond-Order Allpass AllpassStructuresStructures
• A 2nd-order allpass transfer function ischaracterized by 2 unique coefficients
• Hence, it can be realized using only 2multipliers
• Type 2 allpass transfer function:
221
11
21121
2 1 −−
−−
++
++=
zddzdzzdddzA )(
Copyright © 2001, S. K. Mitra42
Type 2 Type 2 AllpassAllpass Structures Structures
Copyright © 2001, S. K. Mitra43
Type 3 Type 3 AllpassAllpass Structures Structures
• Type 3 allpass transfer function:
22
11
2112
3 1 −−
−−
++
++=
zdzdzzddzA )(
Copyright © 2001, S. K. Mitra44
Type 3 Type 3 AllpassAllpass Structures Structures
Copyright © 2001, S. K. Mitra45
Realization Using MultiplierRealization Using MultiplierExtraction ApproachExtraction Approach
• Example - Realize
• A 3-multiplier cascade realization of theabove allpass transfer function is shownbelow
321
321
201804014018020
3 −−−
−−−
−++
+++−=zzzzzzzA
...
...)(
)..)(.(
)..)(.(211
211
50801401805040
−−−
−−−
++−
+++−=zzzzzz
Copyright © 2001, S. K. Mitra46
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• The stability test algorithm described earlierin the course also leads to an elegantrealization of an Mth-order allpass transferfunction
• The algorithm is based on the developmentof a series of th-order allpass transferfunctions from an mth-order allpasstransfer function for
)( 1−m)(zAm 1−
)(zAm 11 ,...,, −= MMm
Copyright © 2001, S. K. Mitra47
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• Let
• We use the recursion
where• It has been shown earlier that is
stable if and only if
mm
mm
mmmmm
zdzdzdzdzzdzdzdd
m zA −−−−
−−
−−−−−
−−
+++++
+++++= )(
)(
...
...)( 1
12
21
1
11
22
11
1
11 ,...,, −= MMm],[)()(
)(zAk
kzAm
mm
mmzzA−
−− =
11
mmm dAk =∞= )(
)(zAM
12 <mk for 11 ,...,, −= MMm
Copyright © 2001, S. K. Mitra48
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• If the allpass transfer function isexpressed in the form
then the coefficients of are simplyrelated to the coefficients of through
)()(
)()(
''...'
'...'')( 1
12
21
1
121
121
11 −−−
−−−
−
−−−−−−−
++++++++
− = mm
mm
mmmm
zdzdzdzzdzdd
m zA
)(zAm 1−)(zAm
111 2 −≤≤−
−= − midddddm
immii ,'
)(zAm 1−
Copyright © 2001, S. K. Mitra49
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• To develop the realization method weexpress in terms of :
• We realize in the form shown below
)(zAm 1−)(zAm
)(zAm
)(
)()(zAzkzAzk
mmm
mmzA1
11
1
1 −−
−−
+
+=
)(zAm
)(zAm 1−1X
1Y2X
2Y
22211211tttt
Copyright © 2001, S. K. Mitra50
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• The transfer function of theconstrained two-pair can be expressed as
• Comparing the above with
we arrive at the two-pair transfer parameters
)(
)()()(
zAtzAttttt
mm
mzA122
121122211111 −
−
−
−−=
11 XYzAm /)( =
)(
)()(zAzkzAzk
mmm
mmzA1
11
1
1 −−
−−
+
+=
Copyright © 2001, S. K. Mitra51
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• Substituting and in theequation above we get
• There are a number of solutions for and
12211
−−== zktkt mm,1
21122211−−=− ztttt
122
−−= zkt mmkt =11
122112 1 −−= zktt m )(
21t12t
Copyright © 2001, S. K. Mitra52
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• Some possible solutions are given below:
11 2112
121
2211 =−=−== −− tzktzktkt mmm ,)(,,
mmmm ktzktzktkt +=−=−== −− 11 211
121
2211 ,)(,,2
2112
121
2211 11 mmmm ktzktzktkt −=−=−== −− ,,,
221
112
12211 1 mmm ktztzktkt −==−== −− ,,,
Copyright © 2001, S. K. Mitra53
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• Consider the solution
• Corresponding input-output relations are
• A direct realization of the above equationsleads to the 3-multiplier two-pair shown onthe next slide
11 2112
121
2211 =−=−== −− tzktzktkt mmm ,)(,,
212
11 1 XzkXkY mm−−−= )(
21
12 XzkXY m−−=
Copyright © 2001, S. K. Mitra54
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• The transfer parameters
lead to the 4-multiplier two-pair structureshown below
mmmm ktzktzktkt +=−=−== −− 11 211
121
2211 ,)(,,
Copyright © 2001, S. K. Mitra55
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• Likewise, the transfer parameters
lead to the 4-multiplier two-pair structureshown below
221
1212
12211 11 mmmm ktzktzktkt −=−=−== −− ,,,
Copyright © 2001, S. K. Mitra56
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• A 2-multiplier realization can be derived bymanipulating the input-output relations:
• Making use of the second equation, we canrewrite the first equation as
212
11 1 XzkXkY mm−−−= )(
21
12 XzkXY m−−=
21
21 XzYkY m−+=
Copyright © 2001, S. K. Mitra57
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• A direct realization of
lead to the 2-multiplier two-pair structure,known as the lattice structure, shown below
21
21 XzYkY m−+=
21
12 XzkXY m−−=
Copyright © 2001, S. K. Mitra58
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• Consider the two-pair described by
• Its input-output relations are given by
• Define
mmmm ktzktzktkt +=−=−== −− 11 211
121
2211 ,)(,,
21
11 1 XzkXkY mm−−+= )(
21
12 1 XzkXkY mm−−+= )(
21
11 XzXkV m )( −−=
Copyright © 2001, S. K. Mitra59
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• We can then rewrite the input-outputrelations as and
• The corresponding 1-multiplier realizationis shown below
21
11 XzVY −+= 112 VXY +=
1V
Copyright © 2001, S. K. Mitra60
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• An mth-order allpass transfer functionis then realized by constraining any one ofthe two-pairs developed earlier by the
th-order allpass transfer function)( 1−m
)(zAm
)(zAm 1−
Copyright © 2001, S. K. Mitra61
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• The process is repeated until theconstraining transfer function is
• The complete realization of based onthe extraction of the two-pair lattice isshown below
)(zAM
10 =)(zA
Copyright © 2001, S. K. Mitra62
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• It follows from our earlier discussion that is stable if the magnitudes of all
multiplier coefficients in the realization areless than 1, i.e., for
• The cascaded lattice allpass filter structurerequires 2M multipliers
• A realization with M multipliers is obtained ifinstead the single multiplier two-pair is used
1<|| mk 11 ,...,, −= MMm
)(zAM
Copyright © 2001, S. K. Mitra63
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• Example - Realize
33
22
11
321
121
1 −−−
−−−
++++++=
zdzdzdzzdzdd
321
3213 2.018.04.01
4.018.02.0)( −−−
−−−
−+++++−=
zzzzzzzA
Copyright © 2001, S. K. Mitra64
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• We first realize in the form of alattice two-pair characterized by themultiplier coefficientand constrained by a 2nd-order allpassas indicated below
)(3 zA
)(2 zA2.033 −== dk
2.03 −=k
Copyright © 2001, S. K. Mitra65
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• The allpass transfer function is of theform
• Its coefficients are given by
)(2 zA
22
11
2112
''1
''2 )(
−−
−−
++
++=zdzdzzddzA
4541667.0223
231)2.0(1
)18.0)(2.0(4.01
'1 ===
−−−−
−−
ddddd
2708333.0223
132)2.0(1
)4.0)(2.0(18.01
'2 ===
−−−−
−−
ddddd
Copyright © 2001, S. K. Mitra66
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• Next, the allpass is realized as alattice two-pair characterized by themultiplier coefficientand constrained by an allpass asindicated below
)(2 zA
)(1 zA2708333.0'
22 == dk
,2.03 −=k 2708333.02=k
Copyright © 2001, S. K. Mitra67
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• The allpass transfer function is of theform
• It coefficient is given by
)(1 zA
11
11
"1
"1 )(
−
−
+= +
zd
zdzA
3573771.02708333.14541667.0
1)(1"1 '
2
'1
2'2
'1
'2
'1 ====
+−−
dd
ddddd
Copyright © 2001, S. K. Mitra68
Realization Using Two-PairRealization Using Two-PairExtraction ApproachExtraction Approach
• Finally, the allpass is realized as alattice two-pair characterized by themultiplier coefficientand constrained by an allpass asindicated below
)(1 zA
1)(0 =zA3573771.0"
11 == dk
,2.03 −=k,2708333.02 =k 3573771.01 =k
)(2 zA )(1 zA
)(3 zA
Copyright © 2001, S. K. Mitra69
Cascaded Lattice RealizationCascaded Lattice RealizationUsing MATLABUsing MATLAB
• The M-file poly2rc can be used to realizean allpass transfer function in the cascadedlattice form
• To this end Program 6_3 can be employed