Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Digital Signal Processing - Solved Assignment 9 | ECE 5213, Assignments of Digital Signal Processing

Material Type: Assignment; Professor: Havlicek; Class: Digital Signal Processing; Subject: ELECTRICAL AND COMPUTER ENGINEERING; University: University of Oklahoma; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 09/17/2009

koofers-user-fme-1
koofers-user-fme-1 🇺🇸

10 documents

1 / 26

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Name: SOLUTION
Section:
Laboratory Exercise 6
DIGITAL FILTER STRUCTURES
6.1 REALIZATION OF FIR TRANSFER FUNCTIONS
Project 6.1 Cascade Realization
Note: program P6_1.m cannot be called directly as suggested in Q6.1 below. This is because tf2zp
requires the length of the numerator and denominator polynomials to be the same. Thus, it is necessary
to MODIFY P6_1.m as shown below.
A copy of the MODIFIED Program P6_1 is given below:
% Program P6_1A
% Conversion of a rational transfer function
% to its factored form.
% MODIFIED to make the numerator and denominator coefficient vectors
% the same length for calling tf2zp.
num = input('Numerator coefficient vector = ');
den = input('Denominator coefficient vector = ');
[b,a] = eqtflength(num,den); % make lengths equal
[z,p,k] = tf2zp(b,a);
sos = zp2sos(z,p,k)
Answers:
Q6.1 By running Program P6_1 with num = [2 10 23 34 31 16 4] and den = [1] we arrive at
the following second-order factors:
[0] 2h
=
11 3
β
=
21 2
β
=
12 1
β
=
22 2
β
=
13 1
β
=
23 0.5
β
=
In other words, with regards to Eq. (6.3) on p. 92 of the Lab Manual, we have
(
)
(
)
(
)
12 12 1 2
1() 21 3 2 1 2 1 0.5
zzzzzzz
−− −−
=++++++
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Digital Signal Processing - Solved Assignment 9 | ECE 5213 and more Assignments Digital Signal Processing in PDF only on Docsity!

Name: SOLUTION

Section:

Laboratory Exercise 6

DIGITAL FILTER STRUCTURES

6.1 REALIZATION OF FIR TRANSFER FUNCTIONS

Project 6.1 Cascade Realization

Note: program P6_1.m cannot be called directly as suggested in Q6.1 below. This is because tf2zp requires the length of the numerator and denominator polynomials to be the same. Thus, it is necessary to MODIFY P6_1.m as shown below.

A copy of the MODIFIED Program P6_1 is given below:

% Program P6_1A % Conversion of a rational transfer function % to its factored form. % MODIFIED to make the numerator and denominator coefficient vectors % the same length for calling tf2zp. num = input('Numerator coefficient vector = '); den = input('Denominator coefficient vector = '); [b,a] = eqtflength(num,den); % make lengths equal [z,p,k] = tf2zp(b,a); sos = zp2sos(z,p,k)

Answers:

Q6.1 By running Program P6_1 with num = [2 10 23 34 31 16 4] and den = [1] we arrive at

the following second-order factors:

h [0] = 2

In other words, with regards to Eq. (6.3) on p. 92 of the Lab Manual, we have

H 1 ( ) z = 2 1 ( + 3 z −^1 + 2 z −^2 )( 1 + z −^1 + 2 z −^2 )( 1 + z −^1 +0.5 z −^2 )

The block-diagram of the cascade realization obtained from these factors is given below:

H 1 (z) is NOT a linear-phase transfer function, because the coefficients do not have the

required symmetry.

Q6.2 By running Program P6_1 with num = [6 31 74 102 74 31 6] and den = [1] we arrive at

the following second-order factors:

h [0] = 6

11

13

The block-diagram of the cascade realization obtained from these factors is given below:

H 2 (z) is a Type I linear-phase transfer function with odd length and even symmetry.

The block-diagram of the cascade realization obtained from these factors is given below:

Q6.4 By running Program P6_1 with num = [2 10 23 34 31 16 4] and den = [36 78 87 59

26 7 1] we arrive at the following second-order factors:

The result of running the modified program P6_1 is the following:

sos =

In terms of the parameters p 0 (^) , α (^) jk , and β (^) jk given in Eq. (6.8) of the Lab Manual, this corresponds to the following:

0

p =

β = α 13 =^123

The block-diagram of the cascade realization obtained from these factors is given below:

A copy of Program P6_2 is given below:

% Program P6_ % Parallel Form Realizations of an IIR Transfer num = input('Numerator coefficient vector = '); den = input('Denominator coefficient vector = '); [r1,p1,k1] = residuez(num,den); [r2,p2,k2] = residue(num,den); disp('Parallel Form I') disp('Residues are');disp(r1); disp('Poles are at');disp(p1); disp('Constant value');disp(k1); disp('Parallel Form II') disp('Residues are');disp(r2); disp('Poles are at');disp(p2); disp('Constant value');disp(k2);

Project 6.3 Parallel Realization

Answers:

Q6.5 By running Program P6_2 with num = [3 8 12 7 2 –2] and den = [16 24 24 14 5 1]

we arrive at the partial-fraction expansion of H 1 (z) in z –1^ given by:

For Parallel Form I, the program returns:

Parallel Form I

Residues are

-0.4219 + 0.6201i -0.4219 - 0.6201i 0.3438 - 2.5079i 0.3438 + 2.5079i

Poles are at

-0.2500 + 0.6614i -0.2500 - 0.6614i -0.2500 + 0.4330i -0.2500 - 0.4330i -0.

Constant value

Note that the complex poles occur in conjugate pairs with resides that are also conjugates. Thus, for a pair of conjugate poles at c + jd and cjd with residues a + jb and ajb ,we get a pair of terms in the

Partial Fraction Expansion given by (read the help for residuez if this isn’t clear to you)

1 (^1 1 1 2 2 )

a jb a jb^ a^ ac^ bd^ z

c jd z c jd z cz c d z

− − − (^) − −

+ − −^ +

The complex poles again occur in conjugate pairs with residues that are also conjugates. Read the help for residue if you are unclear on how to put this together into the partial fraction expansion. Thus, for a

pair of conjugate poles at c + jd and cjd with residues a + jb and ajb ,we get a pair of terms in the

partial fraction expansion of the form

2 1 2 2 2 2 2 1 2 2 2

a jb a jb az^ ac^ bd^ z az^ ac^ bd^ z

z c jd z c jd z cz c d z cz c d z

−^ −^ − − (^) − −

+ − −^ +^ −^ +

For example, for the first pole pair returned for Parallel Form II above, we have a = −0.3047, b = −0.4341, c = − 0.2500, and d = 0.6614. Thus, the partial fraction expansion in z is given by (to within roundoff)

(^1 22 )

2 2 2

z

H z

z z

z

z z

2 2

z

z z

z z z z z

Multiplying each fraction in this expression times appropriate powers of z −^1 on top and bottom then gives:

1 2 2 (^1 1 2 2 2 ) 1 1 2 1 2 1 1 2 1 2

z z z z z

H z

z z z z z z z z

z z z z z

z z z z z

− − − − − − − − − − − − − − − −

Comparing this partial fraction expansion to Eq. (6.11) on p. 96 of the Lab Manual, we have the following values for the Parallel Form II parameters:

The block-diagram of the parallel-form I realization of H 1 (z) is thus as indicated below:

Plugging into the complex pole pair formulas derived in Q6.5, we have

( ) ( )

( ) ( )

1 (^2 1 2 )

1

1 2 2 2

z

H z

z z

z

z z

− −

− −

( ) ( )

1

1 2 2 2

1 1 1 1 2 1 2 1

z

z z

z z z

z z z z z z

− −

− − − − − − − −

With relation to (6.10) on p. 96 of the Lab Manual, the Parallel Form I parameters are:

and the partial-fraction expansion of H 2 (z) in z given by:

The residues and poles returned for Parallel From II are:

Parallel Form II

Residues are 0.5159 + 0.2062i 0.5159 - 0.2062i 1.2593 + 0.4976i 1.2593 - 0.4976i -1.6964 - 1.4537i -1.6964 + 1.4537i

Poles are at -0.5000 + 0.2887i -0.5000 - 0.2887i -0.3333 + 0.4714i -0.3333 - 0.4714i -0.2500 + 0.4330i -0.2500 - 0.4330i

Constant value

Plugging into the complex pole pair formulas derived in Q6.5, we have

( ) ( )

( ) ( )

(^2 22 )

2 2 2

z

H z

z z

z

z z

( ) ( )

2 2 2

2 2 2 1

z

z z

z z z

z z z z z z

z −

2 1 2 1 2 1 2 1 2 1 2

z z z z z

z z z z z z

− − − − − − − − − − −

With relation to (6.11) on p. 96 of the Lab Manual, the Parallel Form II parameters are:

The block-diagram of the parallel-form II realization of H 2 (z) is thus as indicated below:

Project 6.4 Realization of an Allpass Transfer function

Answers:

Q6.7 Using Program P4_4 we arrive at the following values of {k i} for A 5 (z): All that is

required for this problem is to call poly2rc with the coefficients of the

denominator polynomial. The first coefficient should be a “1” and it is not here

(to make the numbers look nicer). So you may be bothered by the fact that the

help for poly2rc says that if d0 isn’t one then everything will get scaled. That’s

true, but it’s just fine here because the numerator and denominator both get

scaled by 16; in other words, the reflection coefficients are not affected by the

scaling. The result of calling ploy2rc is:

k(5) = 0.0625 k(4) = 0.2196 k(3) = 0. k(2) = 0.6837 k(1) = 0.

The block-diagram of the cascaded lattice realization of A 5 (z) is thus as shown below:

From the values of {k i} we conclude that the transfer function A 5 (z) is - STABLE, since

ki < for all 1 ≤ i ≤ 5.

Q6.8 Using Program P4_4 we arrive at the following values of {k i} for A 6 (z):

k(6) = 0.0278 k(5) = 0.1344 k(4) = 0. k(3) = 0.5922 k(2) = 0.7711 k(1) = 0.

The block-diagram of the cascaded lattice realization of A 6 (z) is thus as shown below.

From the values of {k i} we conclude that the transfer function A 6 (z) is – STABLE. All of the

reflection coefficients have squared-magnitudes strictly less than unity.

Q6.9 Using zp2sos we obtain the following factors of A 5 (z):

sos =

0.0625 0.1250 0 1.0000 0.5000 0 1.0000 2.0000 4.0000 1.0000 0.5000 0. 1.0000 1.0000 2.0000 1.0000 0.5000 0.

From the above factors we arrive at the decomposition of A 5 (z) into its low-order allpass

factors as:

1 1 1 1 2 1 1 16 8 (^5 1 1 1 1 1 2 1 1 ) 2 2 4 2 2 1 1 1 1 1 2 1 1 1 2 2 4 2 2 2 1 1 1 1 1 2 1 1 1 2 2 2 4 2 2 1 1 1 1 1 2 1 1 1 2 2 4 2 2 2 1 1 1 1 1 2 1 2 2 4

z z z z z

A z

z z z z z

z z z z z

z z z z z

z z z z z

z z z

− (^) − − − −

− − − − −

− − − − −

− − − − −

− − − − − − − −

z −^ + z −

The block-diagram of the canonic cascade realization of A 5 (z) using Type 1 and 2 allpass

sections is thus as indicated below:

NOTE: Since a canonic realization is called for, it is required to use the structures

Type 1B given in Fig. 6.9(b) on page 97 of the Lab manual and Type 2A given in Fig.

6.10(a) on page 98. The other structures given in the other parts of these figures are

direct , but not canonical , since they use a number of delay elements that exceeds the

order of the section.

NOTE 2: In this problem we are required to use Type 1 and Type 2 allpass sections.

The use of Type 3 sections such as the one shown in Fig. 6.11(a) is therefore not

allowed. In this regard, you should contrast (6.14) and (6.15) on p. 97 of the Lab

The total number of multipliers in the final structure is 6z.

Project 6.5 Cascaded Lattice Realization of an IIR Transfer function

A copy of Program P6_3 is given below:

% Program P6_ % Gray-Markel Cascaded Lattice Structure % k is the lattice parameter vector % alpha is the vector of feedforward multipliers format long % Read in the transfer function coefficients num = input('Numerator coefficient vector = '); den = input('Denominator coefficient vector = '); N = length(den)-1; % Order of denominator polynomial k = ones(1,N); a1 = den/den(1); alpha = num(N+1:-1:1)/den(1); for ii = N:-1:1, alpha(N+2-ii:N+1) = alpha(N+2-ii:N+1)-alpha(N-ii+1)a1(2:ii+1); k(ii) = a1(ii+1); a1(1:ii+1) = (a1(1:ii+1)-k(ii)a1(ii+1:-1:1))/(1-k(ii)*k(ii)); end disp('Lattice parameters are');disp(k) disp('Feedforward multipliers are');disp(alpha)

Answers :

Q6.11 Using Program P6_3 we arrive at the lattice parameters and the feed-forward multiplier coefficients of the Gray-Markel realization of the causal IIR transfer function H 1 (z) of Q6.3 as

given below:

Lattice parameters are

Columns 1 through 4 0.62459686089013 0.68373782742919 0.48111942348398 0.

Column 5

Feedforward multipliers are

Columns 1 through 4 -0.12500000000000 0.31250000000000 0.16053921568627 0.

Columns 5 through 6 -0.09085169508677 -0.

From these parameters we obtain the block-diagram of the corresponding Gray-Markel

structure as given below:

From the lattice parameters obtained using Program P6_3 we conclude that the transfer

function H 1 (z) is – STABLE, since all the lattice parameters have squared magnitudes

strictly less than unity.

Q6.12 Using Program P6_3 we arrive at the lattice parameters and the feed-forward multiplier coefficients of the Gray-Markel realization of the causal IIR transfer function H 2 (z) of Q6.4 as

given below:

Lattice parameters are

Columns 1 through 4 0.81093584641352 0.77112772506402 0.59215187769984 0.

Columns 5 through 6 0.13436293436293 0.

Feedforward multipliers are

Columns 1 through 4 0.11111111111111 0.20370370370370 0.15199485199485 -0.

Columns 5 through 7 -0.01456452038379 0.02345313662512 -0.

From these parameters we obtain the block-diagram of the corresponding Gray-Markel structure

as given below:

From the lattice parameters obtained using Program P6_3 we conclude that the transfer

function H 2 (z) is – STABLE, since all the lattice parameters have squares strictly less

than unity in magnitude.

16*num ans = Columns 1 through 4 3.00000000000000 8.00000000000000 12.00000000000000 7. Columns 5 through 6 2.00000000000000 -2.

16*den ans = Columns 1 through 4 16.00000000000000 24.00000000000000 24.00000000000000 14. Columns 5 through 6 5.00000000000000 1.

The transfer function obtained is EQUIVALENT to H 1 (z) of Q6.3; as demonstrated above

the numerator and denominator coefficient vectors returned by latc2tf are equal to 1/

times the values shown in (6.27).

Q6.14 Using this program we arrive at the lattice parameters and the feed-forward multiplier

coefficients (vectors k and alpha) of the Gray-Markel realization of the transfer function

H 2 (z) of Q6.4 as given below:

k =

alpha =

-0.

-0. -0.

The parameters obtained using this program are THE SAME as those obtained in Q6.12.

Using the function latc2tf we obtain the following transfer function from the vectors k and

alpha:

num2 = Columns 1 through 4 0.05555555555556 0.27777777777778 0.63888888888889 0. Columns 5 through 7 0.86111111111111 0.44444444444444 0.

den2 = Columns 1 through 4 1.00000000000000 2.16666666666667 2.41666666666667 1. Columns 5 through 7

36*num ans = Columns 1 through 4 2.00000000000000 10.00000000000000 22.

Columns 5 through 7 31.00000000000000 16.00000000000000 4.

36*den

ans = Columns 1 through 4 36.00000000000000 77.99999999999997 87.

Columns 5 through 7 25.99999999999999 7.00000000000000 1.

The transfer function obtained is EQUIVALENT to H 2 (z) of Q6.4; the numerator and

denominator coefficients returned by latc2tf in this question are equal to 1/36 times the

original ones appearing in (6.28).