module-21:realization structure of iir filters

12

Upload: others

Post on 19-Nov-2021

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Module-21:Realization structure of IIR Filters
Page 2: Module-21:Realization structure of IIR Filters

Module-21:Realization structure of IIR Filters

Realization of IIR filters using Parallel and Cascade forms Objectives: ➢ To interpret the limitations of Direct Form of realizations ➢ To appreciate the various structures of Cascade and parallel realizations

Introduction: ❖ Direct form realization is easy to obtain as the coefficients that appear in

the realization are same as those in the difference equation. ❖ No additional computations are required in going from the difference

equation to the block diagram. ❖ This convenient property is overshadowed by the poor accuracy that results

when the coefficients and signals are discretized and represented by finite length binary numbers

❖ This computational inaccuracy problem is generally referred to as the parameter quantization effect, and is caused by quantizing or discretizing the coefficients using representations with a finite number of binary positions

❖ This difficulty arises when poles( or zeros) are close together and becomes a more serious problem when the order of the system becomes large

❖ This problem does not arise generally for second order systems, which are almost always realized using the direct form realization

❖ The direct form II has the advantage over Direct Form I as it requires less memory storage for the data samples

❖ The advantage of the reduced storage is offset by the larger adders. ❖ This structure tends to scale the input to reduce the gain. This could result

in a worse signal to noise ratio for larger order filters. ❖ For structures greater than 2nd order, these structures are not preferred.

Page 3: Module-21:Realization structure of IIR Filters

Cascade realization ▪ The Cascade realization of an IIR system is obtained by first

decomposing the system function H(z) into the product of several

simple transfer function

𝐻(𝑧) = 𝐻1(𝑧). 𝐻2(𝑧) … … . 𝐻3(𝑧)

𝐻(𝑧) = ∏ 𝐻𝑘

𝐾

𝑘=1

(𝑧)

▪ By expressing the Numerator and Denominator polynomials of the

Transfer function H(z) as a product of polynomials of lower degree, a

digital filter is realized as a cascade of low order Filter sections

▪ 𝐻(𝑧) =𝑃(𝑧)

𝐷(𝑧)=

𝑃1(𝑧).𝑃2(𝑧)……𝑃3(𝑧).

𝐷1(𝑧)𝐷2(𝑧)…..𝐷3(𝑧)

▪ To avoid Multiplication by complex numbers, pairs of complex

conjugate poles can be combined

▪ In the Transfer function 𝐻(𝑧) =∑ 𝑏𝑘

𝑀𝑘=0 𝑧−𝑘

1+∑ 𝑎𝑘𝑧−𝑘𝑁𝑘=1

, it is assumed that 𝑀 ≤

𝑁.

▪ The individual transfer functions in the cascade are generally chosen

to be either first order sections with 𝐻1(𝑧) =𝑏𝑘0+𝑏𝑘1𝑧−1

1+𝑎𝑘1𝑧−1 and second

order sections 𝐻1(𝑧) =𝑏𝑘0+𝑏𝑘1𝑧−1+𝑏𝑘2𝑧−2

1+𝑎𝑘1𝑧−1+𝑏𝑘2𝑧−2, where the coefficients are

assumed to be real.

▪ The second order sections are used whenever possible. When N is

odd, one first order is needed.

▪ The second order denominators are formed by pairing two real poles

or by pairing complex conjugate poles, so that real coefficients result.

▪ Various different cascade realizations of H(z) can be obtained by

different pole-zero polynomial mappings.

▪ Additional cascade realizations are obtained by simply changing the

ordering of the sections.

Page 4: Module-21:Realization structure of IIR Filters

Parallel Realization

▪ In this structure, the input signal is processed separately by a

different subsystems.

▪ The system output is then a weighted sum of the outputs of the

subsystems, which together constitute the overall system.

▪ An IIR Transfer function can be realized in a parallel form by making

use of the partial fraction of expansion of the Transfer function.

▪ 𝐻(𝑧) =∑ 𝑏𝑘

𝑀𝑘=0 𝑧−𝑘

1+∑ 𝑎𝑘𝑧−𝑘𝑁𝑘=1

=∏ (1−𝛽𝑘𝑧−1)𝑀

𝑘=1

∏ (1−𝛼𝑘𝑧−1)𝑁𝑘=1

▪ If 𝑁 > 𝑀 and 𝛼𝑖 ≠ 𝛼𝑘 i.e. the roots of the denominator polynomial

are distinct, H(z) may be expanded as a sum of N no. of first order

factors as 𝐻(𝑧) = ∑𝐴𝑘

(1−𝛼𝑘𝑧−1)𝑁𝑘=1 , where the coefficients 𝐴𝑘 and 𝛼𝑘

are in general complex.

▪ This expansion corresponds to a sum of N no. Of first order system

functions and may be realized by connecting these systems in

parallel.

▪ If h(n) is real, the poles of H(z) will occur in complex conjugate pairs,

and these complex roots in the partial expansion may be combined

to form second order systems with real coefficients

Worked out Examples:

1.Obtain Cascade and parallel structures for the following system:

𝑦(𝑛) =3

4𝑦(𝑛 − 1) −

1

8𝑦(𝑛 − 2) + 𝑥(𝑛) +

1

3𝑥(𝑛 − 1)

Taking Z-Transform on both sides results in

𝑌(𝑧) −3

4𝑧−1𝑌(𝑧) +

1

8𝑧−2𝑌(𝑧) = 𝑋(𝑧) +

1

3𝑧−1𝑋(𝑧)

The corresponding Transfer Function is

𝐻(𝑧) =1 +

13

𝑧−1

1 −34

𝑧−1 +18

𝑧−2

Page 5: Module-21:Realization structure of IIR Filters

➢ Cascasde Form:

𝐻(𝑧) =1 +

13

𝑧−1

1 −34

𝑧−1 +18

𝑧−2=

1 +13

𝑧−1

(1 −12

𝑧−1).

1

(1 −14

𝑧−1)

= 𝐻1(𝑧). 𝐻2(𝑧)

➢ Parallel Form:

By using partial fraction expansion

𝐻(𝑧) =1 +

13

𝑧−1

1 −34

𝑧−1 +18

𝑧−2=

𝐴

(1 −12

𝑧−1)+

𝐵

(1 −14

𝑧−1)

Solving for A and B,

𝐻(𝑧) =10

3

1

(1−1

2𝑧−1)

−7

3

1

(1−1

4𝑧−1)

Page 6: Module-21:Realization structure of IIR Filters

2.Determine 𝑎1, 𝑎2, 𝑐1𝑎𝑛𝑑𝑐0, 𝑖𝑛 𝑡𝑒𝑟𝑚𝑠 𝑜𝑓 𝑏1 𝑎𝑛𝑑 𝑏2 so that he two systems in

the following figure are equivalent.

Fig.1

x(n) y1(n) y2(n) y(n)

co

a1

a2 c1

+

𝑧−1

+ +

𝑧−1

Page 7: Module-21:Realization structure of IIR Filters

Fig.2

Fig.1: It is a cascade structure

𝑦1(𝑛) = 𝑥(𝑛) + 𝑎1𝑦1(𝑛 − 1)𝑎𝑛𝑑 𝐻1(𝑧) =𝑌1(𝑧)

𝑋(𝑧)=

1

(1 − 𝑎1𝑧−1)

𝑦2(𝑛) = 𝑦1(𝑛) + 𝑎2𝑦2(𝑛 − 1)𝑎𝑛𝑑 𝑌2(𝑧)

𝑌1(𝑧)=

1

(1−𝑎2𝑧−1)

𝑦(𝑛) = 𝑐𝑜𝑦2(𝑛) + 𝑐1𝑦2(𝑛 − 1) 𝑎𝑛𝑑 𝑌(𝑧)

𝑌2(𝑧)=

𝑌2(𝑧)

𝑌1(𝑧)= (𝑐𝑜 + 𝑐1𝑧−1)

Hence, 𝐻2(𝑧) =𝑌(𝑧)

𝑌1(𝑧)=

(𝑐𝑜+𝑐1𝑧−1)

(1−𝑎2𝑧−1)

The overall Transfer function of the Fig.1 is

Page 8: Module-21:Realization structure of IIR Filters

𝐻(𝑧) = 𝐻1(𝑧). 𝐻2(𝑧) = (𝑐𝑜+𝑐1𝑧−1)

(1−𝑎2𝑧−1)(1−𝑎1𝑧−1)

Fig.2: It is a parallel Structure.

𝐻(𝑧) = 𝐻1(𝑧) + 𝐻2(𝑧) =1

(1 − 𝑏1𝑧−1)+

1

(1 − 𝑏2𝑧−1)

=2−(𝑏1+𝑏2)𝑧−1

(1−𝑏1𝑧−1)(1−𝑏2𝑧−1)

Comparing H(z) in both the cases,

𝑐𝑜 = 2; 𝑐1 = −(𝑏1 + 𝑏2); 𝑎1 = 𝑏1; 𝑎2 = 𝑏2

3.Obtain the cascade realization of the IIR system described by

𝐻(𝑧) =(𝑧+1)(𝑧−5)

[𝑧+(1+𝑗)][𝑧+(1−𝑗)][𝑧−(1

2+𝑗)][𝑧−(

1

2−𝑗)]

Soln.: In the above H(z), complex poles can be paired to result in real coefficients.

Thus, 𝐻(𝑧) =(𝑧+1)(𝑧−5)

[(𝑧+1)+𝑗)][(𝑧+1)−𝑗][(𝑧−1

2)+𝑗)][(𝑧−

1

2)−𝑗)]

𝐻(𝑧) =(𝑧 + 1)(𝑧 − 5)

[(𝑧 + 1)2 − (𝑗)2)] [(𝑧 −12

)2 − (𝑗)2)]

𝐻(𝑧) =(𝑧 + 1)(𝑧 − 5)

[(𝑧 + 1)2 − (𝑗)2)] [(𝑧 −12

)2 − (𝑗)2)]

𝐻(𝑧) =(𝑧 + 1)(𝑧 − 5)

[𝑧2 + 2𝑧 + 2] [𝑧2 − 𝑧 +54

]= 𝐻1(𝑧)𝐻𝑧(𝑧)

The individual Transfer functions can be realized in Direct Form-II and can be

cascaded.

Page 9: Module-21:Realization structure of IIR Filters

Exercise Problems:

1.Realize the system 𝐻(𝑧) =8𝑧3−4𝑧2+11𝑧−2

(𝑧−1

4)(𝑧2−𝑧+

1

2)

using (i) Cascade and (ii) Parallel

realizations.

2.A system is represented by the its Transfer Function 𝐻(𝑧) = 3 +4𝑧

𝑧−1

2

−2

𝑧−1

4

.

Justify whether the above system represents an FIR or IIR system?

3. Find the recursive difference equation for the FIR system with unit sample

response ℎ(𝑛) = 𝛿(𝑛 + 1) − 2𝛿(𝑛) + 𝛿(𝑛 − 1)

4.Find the Transfer function and the difference equation of the following digital

filter. y(n)

x(n) 3 2

-

5.Show that the following two systems are equivalent.

System1

x(n) y(n)

𝟐𝒓𝒄𝒐𝒔𝝎𝟎

−𝒓𝟐

𝑧−1

+

4𝑧−1

+

𝑧−1

𝑧−1

+

Page 10: Module-21:Realization structure of IIR Filters

System-2

x(n) 𝒓. 𝒔𝒊𝒏𝝎𝟎 y(n)

𝒓. 𝒄𝒐𝒔𝝎𝟎

𝒓. 𝒄𝒐𝒔𝝎𝟎

−𝒓𝒔𝒊𝒏𝝎𝟎

Simulation:

Cascade Form:

❖ H(z) is written as a product of second order sections with real coefficients.

❖ This is done by factoring the numerator and denominator polynomials into

their respective roots and then combining either a complex conjugate pair

or any two real roots into second order polynomials.

❖ 𝐻(𝑧) =𝑏0+𝑏1𝑧−1+⋯+𝑏𝑁𝑧−𝑁

1+𝑎1𝑧−1+⋯+𝑎𝑁𝑧−𝑁= 𝑏0

1+𝑏1𝑏0

𝑧−1+⋯+𝑏𝑁𝑏0

𝑧−𝑁

1+𝑎1𝑧−1+⋯+𝑎𝑁𝑧−𝑁=

❖ 𝐹𝑜𝑟 2 𝑛𝑑 𝑜𝑟𝑑𝑒𝑟 𝑠𝑒𝑐𝑡𝑖𝑜𝑛𝑠,

=𝑏0 ∏1+𝐵𝑘,1𝑧−1+𝐵𝑘,2𝑧−2

1+𝐴𝑘,1𝑧−1+𝐴𝑘,2𝑧−2𝐾𝑘=1 , 𝑤ℎ𝑒𝑟𝑒 𝐾 =

𝑁

2 𝑎𝑛𝑑 𝐴𝑘,1, 𝐴𝑘,2, 𝐵𝑘,1 𝑎𝑛𝑑 𝐵𝑘,2 are

Real numbers representing the coefficients of second order sections.

Given the coefficients {𝑏𝑛} and {𝑎𝑛} of the direct form filter, the coefficients

𝑏0, {𝐵𝑘,𝑖}, 𝑎𝑛𝑑 {𝐴𝑘,𝑖}

%This Program Converts Direct Form to Cascade Form and implements

%This Program Converts Direct Form to Cascade Form and implements

+ + 𝑧−1 +

𝑧−1

Page 11: Module-21:Realization structure of IIR Filters

% b0=Gain Coefficient %B=kx3 Matrix of real coefficients containing bks %A=kx3 Matrix of real coefficients containing aks %b=Numerator Polynomial Coefficients of Direct Form %a=Denominator polynomial Coefficients of Direct Form %Computation of Gain Coefficient b0 clear all %Enter the coefficients such that ‘a’ and ‘b’ are of same length b=input('input enter the numerator coefficients') a=input('input enter the denominator coefficnets') b0=b(1); b=b/b0; a0=a(1);a=a/a0; b0=b0/a0; N=length(a); K=floor(N/2); A=zeros(K,3); B=zeros(K,3); if K*2==N b=[b 0]; a=[a 0]; end broots=cplxpair(roots(b)); aroots=cplxpair(roots(a)); i=1; while i<=2*K||i<=K Brow=broots(i:i+1,:); Brow=real(poly(Brow)); B(fix((i+1)/2),:)=Brow; Arow=aroots(i:i+1,:); Arow=real(poly(Arow)); A(fix((i+1)/2),:)=Arow; i=i+2; end disp(‘The value of b0 is’) disp(b0)

Page 12: Module-21:Realization structure of IIR Filters

Ex.: 1)The following system is to be realized by using Cascade Connection.

16𝑦(𝑛) + 12𝑦(𝑛 − 1) + 2𝑦(𝑛 − 2) − 4𝑦(𝑛 − 3) − 𝑦(𝑛 − 4)

= 𝑥(𝑛) − 3𝑥(𝑛 − 1) + 11𝑥(𝑛 − 2) − 27𝑥(𝑛 − 3) + 18𝑥(𝑛 − 4)

b =[1 -3 11 -27 18]; a=[16 12 2 -4 -1];

B=[1.000 0.000 9.0001.000 −3.000 2.000

]; A=[1.000 1.000 0.5001.000 −0.250 −0.1250

]

𝑏0 = 0.625

This implies, section 1 in the cascade can be 𝐻1(𝑧) =1+9𝑧−1

1+𝑧−1+0.5𝑧−2 and the second

section can be 𝐻2(𝑧) =1−3𝑧−1+2𝑧−2

1−0.25𝑧−1−0.125𝑧−2 . The individual stages can be realized

using Direct form II and the output of the first stage will be scaled by a factor of

𝑏0 = 0.625 and will be applied as the input for the second stage. It is a cascade

of two second order sections.

2) 𝐻(𝑧) =1+0.875𝑧−1

(1+0.2𝑧−1+0.9𝑧−2)(1−0.7𝑧−1) =

1+0.875𝑧−1

(1−0.5𝑧−1+076𝑧−2−0.63𝑧−3)

b =[1 0.875 0 0 ]; a=[1 -0.5 0.76 -0.63];

B=[1.000 0.8750 01.000 0 0

]; A=[1.000 0.200 0.90001.000 −0.70 0

] ; 𝑏0 = 1

This implies, section 1 in the cascade can be 𝐻1(𝑧) =1+0.875𝑧−1

1+0.2𝑧−1+0.9𝑧−2 and the

second section can be 𝐻2(𝑧) =1

1−0.7𝑧−1 . The individual stages can be

realized using Direct form II and the output of the first stage will be scaled by a

factor of 𝑏0 = 1 and will be applied as the input for the second stage. It is a

cascade of one First order section and one second order section.