Digital Filter Structures - The Catholic University of...
Transcript of Digital Filter Structures - The Catholic University of...
1Copyright © 2001, S. K. Mitra
Digital Filter StructuresDigital Filter Structures
• The convolution sum description of an LTIdiscrete-time system can, in principle, beused to implement the system
• For an IIR finite-dimensional system thisapproach is not practical as here the impulseresponse is of infinite length
• However, a direct implementation of the IIRfinite-dimensional system is practical
2Copyright © 2001, S. K. Mitra
Digital Filter StructuresDigital Filter Structures
• Here the input-output relation involves afinite sum of products:
• On the other hand, an FIR system can beimplemented using the convolution sumwhich is a finite sum of products:
∑∑ == −+−−= Mk k
Nk k knxpknydny 01 ][][][
∑ = −= Nk knxkhny 0 ][][][
3Copyright © 2001, S. K. Mitra
Digital Filter StructuresDigital Filter Structures
• The actual implementation of an LTI digitalfilter can be either in software or hardwareform, depending on applications
• In either case, the signal variables and thefilter coefficients cannot be representedwith finite precision
4Copyright © 2001, S. K. Mitra
Digital Filter StructuresDigital Filter Structures• However, a direct implementation of a digital
filter based on either the difference equationor the finite convolution sum may notprovide satisfactory performance due to thefinite precision arithmetic
• It is thus of practical interest to developalternate realizations and choose the structurethat provides satisfactory performance underfinite precision arithmetic
5Copyright © 2001, S. K. Mitra
Digital Filter StructuresDigital Filter Structures• A structural representation using
interconnected basic building blocks is thefirst step in the hardware or softwareimplementation of an LTI digital filter
• The structural representation provides thekey relations between some pertinentinternal variables with the input and outputthat in turn provides the key to theimplementation
6Copyright © 2001, S. K. Mitra
Block Diagram RepresentationBlock Diagram Representation
• In the time domain, the input-outputrelations of an LTI digital filter is given bythe convolution sum
or, by the linear constant coefficientdifference equation
∑∑ == −+−−= Mk k
Nk k knxpknydny 01 ][][][
∑∞−∞= −= k knxkhny ][][][
7Copyright © 2001, S. K. Mitra
Block Diagram RepresentationBlock Diagram Representation• For the implementation of an LTI digital
filter, the input-output relationship must bedescribed by a valid computational algorithm
• To illustrate what we mean by acomputational algorithm, consider the causalfirst-order LTI digital filter shown below
8Copyright © 2001, S. K. Mitra
Block Diagram RepresentationBlock Diagram Representation
• The filter is described by the differenceequation
• Using the above equation we can computey[n] for knowing the initial condition
and the input x[n] for :
]1[][]1[][ 101 −++−−= nxpnxpnydny
0≥n1−≥n]1[−y
9Copyright © 2001, S. K. Mitra
Block Diagram RepresentationBlock Diagram Representation
• We can continue this calculation for anyvalue of the time index n we desire
]1[]0[]1[]0[ 101 −++−−= xpxpydy]0[]1[]0[]1[ 101 xpxpydy ++−=]1[]2[]1[]2[ 101 xpxpydy ++−= ..
.
..
.
10Copyright © 2001, S. K. Mitra
Block Diagram RepresentationBlock Diagram Representation• Each step of the calculation requires a
knowledge of the previously calculatedvalue of the output sample (delayed value ofthe output), the present value of the inputsample, and the previous value of the inputsample (delayed value of the input)
• As a result, the first-order differenceequation can be interpreted as a validcomputational algorithm
11Copyright © 2001, S. K. Mitra
Basic Building BlocksBasic Building Blocks• The computational algorithm of an LTI
digital filter can be convenientlyrepresented in block diagram form using thebasic building blocks shown below
x[n] y[n]
w[n]
+ Ax[n] y[n]
y[n]1−zx[n]x[n] x[n]
x[n]
Adder
Unit delay
Multiplier
Pick-off node
12Copyright © 2001, S. K. Mitra
Basic Building BlocksBasic Building Blocks
Advantages of block diagram representation• (1) Easy to write down the computational
algorithm by inspection• (2) Easy to analyze the block diagram to
determine the explicit relation between theoutput and input
13Copyright © 2001, S. K. Mitra
Basic Building BlocksBasic Building Blocks
• (3) Easy to manipulate a block diagram toderive other “equivalent” block diagramsyielding different computational algorithms
• (4) Easy to determine the hardwarerequirements
• (5) Easier to develop block diagramrepresentations from the transfer functiondirectly
14Copyright © 2001, S. K. Mitra
Analysis of Block DiagramsAnalysis of Block Diagrams• Carried out by writing down the expressions
for the output signals of each adder as a sumof its input signals, and developing a set ofequations relating the filter input and outputsignals in terms of all internal signals
• Eliminating the unwanted internal variablesthen results in the expression for the outputsignal as a function of the input signal andthe filter parameters that are the multipliercoefficients
15Copyright © 2001, S. K. Mitra
Analysis of Block DiagramsAnalysis of Block Diagrams• Example - Consider the single-loop feedback
structure shown below
• The output E(z) of the adder is
• But from the figure)()()()( 2 zYzGzXzE +=
)()()( 1 zEzGzY =
16Copyright © 2001, S. K. Mitra
Analysis of Block DiagramsAnalysis of Block Diagrams
• Eliminating E(z) from the previous twoequations we arrive at
which leads to)()()()]()(1[ 121 zXzGzYzGzG =−
)()(1)(
)()()(
21
1zGzG
zGzXzYzH
−==
17Copyright © 2001, S. K. Mitra
Analysis of Block DiagramsAnalysis of Block Diagrams
• Example - Analyze the cascaded latticestructure shown below where the z-dependence of signal variables are notshown for brevity
18Copyright © 2001, S. K. Mitra
Analysis of Block DiagramsAnalysis of Block Diagrams
• The output signals of the four adders aregiven by
• From the figure we observe
21 SXW α−=112 SWW δ−=
213 WSW ε+=
21 SWY γ+β=
31
2 WzS −=2
11 WzS −=
19Copyright © 2001, S. K. Mitra
Analysis of Block DiagramsAnalysis of Block Diagrams• Substituting the last two relations in the first
four equations we get
• From the second equation we get and from the third
equation we get
31
1 WzXW −α−=2
112 WzWW −δ−=
221
3 WWzW ε+= −
31
1 WzWY −γ+β=
)1/( 112
−δ+= zWW2
13 )( WzW −+ε=
20Copyright © 2001, S. K. Mitra
Analysis of Block DiagramsAnalysis of Block Diagrams
• Combining the last two equations we get
• Substituting the above equation in
we finally arrive at
113 11WW
zz−
−
δ++ε=
,31
1 WzXW −α−= 31
1 WzWY −γ+β=
21
21
)(1)()( −−
−−
α+αε+δ+γ+γε+βδ+β==zzzz
XYzH
21Copyright © 2001, S. K. Mitra
The Delay-Free Loop ProblemThe Delay-Free Loop Problem• For physical realizability of the digital filter
structure, it is necessary that the blockdiagram representation contains no delay-free loops
• To illustrate the delay-free loop problemconsider the structure below
22Copyright © 2001, S. K. Mitra
The Delay-Free Loop ProblemThe Delay-Free Loop Problem• Analysis of this structure yields
which when combined results in
• The determination of the currentvalue of y[n] requires the knowledge of thesame value
][][][ nynwnu +=])[][(][ nAunvBny +=
( )])[][(][][ nynwAnvBny ++=
23Copyright © 2001, S. K. Mitra
The Delay-Free Loop ProblemThe Delay-Free Loop Problem• However, this is physically impossible to
achieve due to the finite time required tocarry out all arithmetic operations on adigital machine
• Method exists to detect the presence ofdelay-free loops in an arbitrary structure,along with methods to locate and removethese loops without the overall input-outputrelation
24Copyright © 2001, S. K. Mitra
The Delay-Free Loop ProblemThe Delay-Free Loop Problem• Removal achieved by replacing the portion
of the overall structure containing the delay-free loops by an equivalent realization withno delay-free loops
• Figure below shows such a realization ofthe example structure described earlier
25Copyright © 2001, S. K. Mitra
Canonic and Canonic and NoncanonicNoncanonicStructuresStructures
• A digital filter structure is said to becanonic if the number of delays in the blockdiagram representation is equal to the orderof the transfer function
• Otherwise, it is a noncanonic structure
26Copyright © 2001, S. K. Mitra
Canonic andCanonic and Noncanonic NoncanonicStructuresStructures
• The structure shown below is noncanonic asit employs two delays to realize a first-orderdifference equation
]1[][]1[][ 101 −++−−= nxpnxpnydny
27Copyright © 2001, S. K. Mitra
Equivalent StructuresEquivalent Structures
• Two digital filter structures are defined tobe equivalent if they have the same transferfunction
• We describe next a number of methods forthe generation of equivalent structures
• However, a fairly simple way to generate anequivalent structure from a given realizationis via the transpose operation
28Copyright © 2001, S. K. Mitra
Equivalent StructuresEquivalent Structures
Transpose Operation• (1) Reverse all paths• (2) Replace pick-off nodes by adders, and
vice versa• (3) Interchange the input and output nodes• All other methods for developing equivalent
structures are based on a specific algorithmfor each structure
29Copyright © 2001, S. K. Mitra
Equivalent StructuresEquivalent Structures
• There are literally an infinite number ofequivalent structures realizing the sametransfer function
• It is thus impossible to develop allequivalent realizations
• In this course we restrict our attention to adiscussion of some commonly usedstructures
30Copyright © 2001, S. K. Mitra
Equivalent StructuresEquivalent Structures
• Under infinite precision arithmetic anygiven realization of a digital filter behavesidentically to any other equivalent structure
• However, in practice, due to the finitewordlength limitations, a specificrealization behaves totally differently fromits other equivalent realizations
31Copyright © 2001, S. K. Mitra
Equivalent StructuresEquivalent Structures• Hence, it is important to choose a structure
that has the least quantization effects whenimplemented using finite precisionarithmetic
• One way to arrive at such a structure is todetermine a large number of equivalentstructures, analyze the finite wordlengtheffects in each case, and select the oneshowing the least effects
32Copyright © 2001, S. K. Mitra
Equivalent StructuresEquivalent Structures
• In certain cases, it is possible to develop astructure that by construction has the leastquantization effects
• We defer the review of these structures aftera discussion of the analysis of quantizationeffects
• Here, we review some simple realizationsthat in many applications are quite adequate
33Copyright © 2001, S. K. Mitra
Basic FIR Digital FilterBasic FIR Digital FilterStructuresStructures
• A causal FIR filter of order N is characterizedby a transfer function H(z) given by
which is a polynomial in• In the time-domain the input-output relation
of the above FIR filter is given by
∑ =−= N
nnznhzH 0 ][)(
1−z
∑ = −= Nk knxkhny 0 ][][][
34Copyright © 2001, S. K. Mitra
Direct Form FIR Digital FilterDirect Form FIR Digital FilterStructuresStructures
• An FIR filter of order N is characterized byN+1 coefficients and, in general, requireN+1 multipliers and N two-input adders
• Structures in which the multipliercoefficients are precisely the coefficients ofthe transfer function are called direct formstructures
35Copyright © 2001, S. K. Mitra
Direct Form FIR Digital FilterDirect Form FIR Digital FilterStructuresStructures
• A direct form realization of an FIR filter canbe readily developed from the convolutionsum description as indicated below for N =4
36Copyright © 2001, S. K. Mitra
Direct Form FIR Digital FilterDirect Form FIR Digital FilterStructuresStructures
• An analysis of this structure yields
which is precisely of the form of theconvolution sum description
• The direct form structure shown on theprevious slide is also known as a tappeddelay line or a transversal filter
][][][][ 4433 −+−+ nxhnxh][][][][][][][ 22110 −+−+= nxhnxhnxhny
][][][][ 4433 −+−+ nxhnxh
37Copyright © 2001, S. K. Mitra
Direct Form FIR Digital FilterDirect Form FIR Digital FilterStructuresStructures
• The transpose of the direct form structureshown earlier is indicated below
• Both direct form structures are canonic withrespect to delays
38Copyright © 2001, S. K. Mitra
Cascade Form FIR DigitalCascade Form FIR DigitalFilter StructuresFilter Structures
• A higher-order FIR transfer function canalso be realized as a cascade of second-order FIR sections and possibly a first-ordersection
• To this end we express H(z) as
where if N is even, and if Nis odd, with
∏ =−− ++= K
k kk zzhzH 12
21
110 )(][)( ββ
2NK =
21+= NK
02 =Kβ
39Copyright © 2001, S. K. Mitra
Cascade Form FIR DigitalCascade Form FIR DigitalFilter StructuresFilter Structures
• A cascade realization for N = 6 is shownbelow
• Each second-order section in the abovestructure can also be realized in thetransposed direct form
40Copyright © 2001, S. K. Mitra
PolyphasePolyphase FIR Structures FIR Structures
• The polyphase decomposition of H(z) leadsto a parallel form structure
• To illustrate this approach, consider a causalFIR transfer function H(z) with N = 8:
4321 43210 −−−− ++++= zhzhzhzhhzH ][][][][][)(8765 8765 −−−− ++++ zhzhzhzh ][][][][
41Copyright © 2001, S. K. Mitra
PolyphasePolyphase FIR Structures FIR Structures• H(z) can be expressed as a sum of two
terms, with one term containing the even-indexed coefficients and the othercontaining the odd-indexed coefficients:
)][][][][][()( 8642 86420 −−−− ++++= zhzhzhzhhzH)][][][][( 7531 7531 −−−− ++++ zhzhzhzh
)][][][][][( 8642 86420 −−−− ++++= zhzhzhzhh)][][][][( 6421 7531 −−−− ++++ zhzhzhhz
42Copyright © 2001, S. K. Mitra
PolyphasePolyphase FIR Structures FIR Structures
• By using the notation
we can express H(z) as
3211 7531 −−− +++= zhzhzhhzE ][][][][)(
43210 86420 −−−− ++++= zhzhzhzhhzE ][][][][][)(
)()()( 21
120 zEzzEzH −+=
43Copyright © 2001, S. K. Mitra
PolyphasePolyphase FIR Structures FIR Structures
• In a similar manner, by grouping the termsin the original expression for H(z), we canreexpress it in the form
where now)()()()( 3
223
113
0 zEzzEzzEzH −− ++=
210 630 −− ++= zhzhhzE ][][][)(
211 741 −− ++= zhzhhzE ][][][)(
212 852 −− ++= zhzhhzE ][][][)(
44Copyright © 2001, S. K. Mitra
PolyphasePolyphase FIR Structures FIR Structures
• The decomposition of H(z) in the form
or
is more commonly known as the polyphasedecomposition
)()()()( 32
231
130 zEzzEzzEzH −− ++=
)()()( 21
120 zEzzEzH −+=
45Copyright © 2001, S. K. Mitra
PolyphasePolyphase FIR Structures FIR Structures
• In the general case, an L-branch polyphasedecomposition of an FIR transfer functionof order N is of the form
where
with h[n]=0 for n > N
)()( Lm
Lm
m zEzzH ∑ −=
−= 10
∑+
=
−+=LN
n
mm zmLnhzE
/)(
][)(1
0
46Copyright © 2001, S. K. Mitra
PolyphasePolyphase FIR Structures FIR Structures• Figures below show the 4-branch, 3-branch,
and 2-branch polyphase realization of atransfer function H(z)
• Note: The expression for the polyphasecomponents are different in each case)(zEm
47Copyright © 2001, S. K. Mitra
PolyphasePolyphase FIR Structures FIR Structures
• The subfilters in the polyphaserealization of an FIR transfer function arealso FIR filters and can be realized usingany methods described so far
• However, to obtain a canonic realization ofthe overall structure, the delays in allsubfilters must be shared
)( Lm zE
48Copyright © 2001, S. K. Mitra
PolyphasePolyphase FIR Structures FIR Structures• Figure below shows a canonic realization of
a length-9 FIR transfer function obtainedusing delay sharing
49Copyright © 2001, S. K. Mitra
Linear-Phase FIR StructuresLinear-Phase FIR Structures• The symmetry (or antisymmetry) property of a
linear-phase FIR filter can be exploited toreduce the number of multipliers into almosthalf of that in the direct form implementations
• Consider a length-7 Type 1 FIR transferfunction with a symmetric impulse response:
321 3210 −−− +++= zhzhzhhzH ][][][][)(654 012 −−− +++ zhzhzh ][][][
50Copyright © 2001, S. K. Mitra
Linear-Phase FIR StructuresLinear-Phase FIR Structures• Rewriting H(z) in the form
we obtain the realization shown below
)]([)]([)( 516 110 −−− +++= zzhzhzH342 32 −−− +++ zhzzh ][)]([
51Copyright © 2001, S. K. Mitra
Linear-Phase FIR StructuresLinear-Phase FIR Structures
• A similar decomposition can be applied to aType 2 FIR transfer function
• For example, a length-8 Type 2 FIR transferfunction can be expressed as
• The corresponding realization is shown onthe next slide
)]([)]([)( 617 110 −−− +++= zzhzhzH
)]([)]([ 4352 32 −−−− ++++ zzhzzh
52Copyright © 2001, S. K. Mitra
Linear-Phase FIR StructuresLinear-Phase FIR Structures
• Note: The Type 1 linear-phase structure fora length-7 FIR filter requires 4 multipliers,whereas a direct form realization requires 7multipliers
53Copyright © 2001, S. K. Mitra
Linear-Phase FIR StructuresLinear-Phase FIR Structures
• Note: The Type 2 linear-phase structure fora length-8 FIR filter requires 4 multipliers,whereas a direct form realization requires 8multipliers
• Similar savings occurs in the realization ofType 3 and Type 4 linear-phase FIR filterswith antisymmetric impulse responses