0% found this document useful (0 votes)
27 views5 pages

Lab # 3

This document discusses obtaining transfer functions from poles, zeros and gain values, and obtaining poles, zeros and gain from a given transfer function, using MATLAB. It provides theory on transfer functions and their representation. It then gives examples of writing MATLAB code to convert between these representations and obtain the output.

Uploaded by

saadshahab622
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views5 pages

Lab # 3

This document discusses obtaining transfer functions from poles, zeros and gain values, and obtaining poles, zeros and gain from a given transfer function, using MATLAB. It provides theory on transfer functions and their representation. It then gives examples of writing MATLAB code to convert between these representations and obtain the output.

Uploaded by

saadshahab622
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Lab # 03

Object: To Display a transfer function from given poles, zeros and gain, and zeros, poles,
gain from a given transfer function using MATLAB.

Theory:
A transfer function is also known as the network function is a mathematical representation, in
terms of spatial or temporal frequency, of the relation between the input and output of a (linear
time invariant) system. The transfer function is the ratio of the output Laplace Transform to the
input Laplace Transform assuming zero initial conditions. Many important characteristics of
dynamic or control systems can be determined from the transfer function.

The transfer function is commonly used in the analysis of single-input single-output electronic
system, for instance. It is mainly used in signal processing, communication theory, and control
theory. The term is often used exclusively to refer to linear time-invariant systems (LTI). In its
simplest form for continuous time input signal x(t) and output y(t), the transfer function is the
linear mapping of the Laplace transform of the input, X(s), to the output Y(s).

Zeros are the value(s) for z where the numerator of the transfer function equals zero. The
complex frequencies that make the overall gain of the filter transfer function zero. Poles are
the value(s) for z where the denominator of the transfer function equals zero. The complex
frequencies that make the overall gain of the filter transfer function infinite.

The general procedure to find the transfer function of a linear differential equation from input
to output is to take the Laplace Transforms of both sides assuming zero conditions, and to solve
for the ratio of the output Laplace over the input Laplace.
Procedure:
 Write MATLAB program in the MATLAB editor document.
 Then save and run the program.
 Give the required input.
 The syntax “zp2tf(z,p,k)” and “tf(num,den)” solves the given input poles and zeros
and gives the transfer function.
 zp2tf forms transfer function polynomials from the zeros, poles, and gains of a system
in factored form.

Now find the output theoretically for the given transfer function and compare it with the
output obtained practically

19
Lab Practice:
1. Write MATLAB code to obtain transfer function of a system from its pole, zero, and gain
values. Assume Poles are at −3.2 ± 7.8𝑗, −4.1 ± 5.9𝑗, 𝑎𝑛𝑑 − 8, while Zero are at
−0.8 ± 0.43𝑗 𝑎𝑛𝑑 − 0.6, and gain is 0.5.

z=input(‘enter zeroes’)
p=input(‘enter poles’)
k=input(‘enter gain’)
[num,den]=zp2tf(z,p,k)
tf(num,den)

2. Write MATLAB code to obtain transfer function of a system from its pole, zero, and gain
values. Assume Poles are at -2, and 1, while Zero is at -1, and gain is 7.

p= [-2 1]
z= [-1]
k=7
[num,den]= zp2tf(z',p',k)
g=tf(num,den)
Output:
g=
7s+7
-----------
s^2 + s - 2
Continuous-time transfer function.

3. Write MATLAB code to obtain transfer function of a system from its pole, zero, and gain
values.
a. Assume Poles are at −1 ± 𝑗, and -4, while Zero are at -2, -5 and gain is 1.
b. Assume Poles are at −1 ± 4𝑗, and -5, while Zero are at -8, -5 and gain is 0.75.

20
Poles, Zeros, and Gain from a given transfer function.
Theory:
The transfer function provides a basis for determining important system response
characteristics without solving the complete differential equation. As defined, the transfer
function is a rational function in the complex variable 𝑠 = 𝜎 + 𝑗𝜔 that is

𝑏𝑚 𝑠𝑚 + 𝑏𝑚−1 𝑠𝑚−1 + ⋯ + 𝑏0
𝐻(𝑠) =
𝑎𝑛 𝑠𝑛 + 𝑎𝑛−1 𝑠𝑛−1 + ⋯ + 𝑎0

It is often convenient to factor the polynomials in the numerator and the denominator, and to
write the transfer function in terms of those factors:

𝑁(𝑠) (𝑠 − 𝑧1 )(𝑠 − 𝑧2 ) … . (𝑠 − 𝑧𝑚−1 )(𝑠 − 𝑧𝑚 )


𝐻(𝑠) = =𝐾
𝐷(𝑠) (𝑠 − 𝑝1 )(𝑠 − 𝑝2 ) … . (𝑠 − 𝑝𝑚−1 )(𝑠 − 𝑝𝑚 )

Where the numerator and denominator polynomials, N(s) and D(s), have real coefficients
𝑏𝑚⁄
defined by the system’s differential equation and 𝐾 = 𝑎𝑛 . As written in the above equation,
the 𝑧𝑖 ′ 𝑠 are the roots of the equation 𝑁(𝑠) = 0, and are defined to be the system zeros. Whereas,
the 𝑝𝑖 ′ 𝑠 are the roots of the equation 𝐷(𝑠) = 0, and are defined to be the system poles.

Procedure:
 Type the program in the MATLAB editor that is in M-file.
 Save and run the program.
 Give the required inputs in the command window of MATLAB in matrix format.
 tf2zp converts the transfer function filter parameters to pole-zero-gain form.
 [z,p,k] = tf2zp(b,a) finds the matrix of zeros z, the vector of poles p, and the associated
vector of gains k from the transfer function parameters b and a:
 The numerator polynomials are represented as columns of the matrix b.
 The denominator polynomial is represented in the vector a.
 Note down the output of the program that is zeros, poles and gain obtained in
MATLAB.
 The zeros, poles and gain are also obtained theoretically.

Lab Practice:
1. Obtain the poles, zeros and gain of the transfer function given below
𝐶(𝑠) 𝑠 2 + 4𝑠 + 3
= 3
𝑅(𝑠) 𝑠 + 3𝑠 2 + 7𝑠 + 5

21
num = input(‘enter the numerator of the transfer function’)
den = input(‘enter the denominator of the transfer function’)
[z,p,k] = tf2zp(num,den)

2. Obtain the poles, zeros and gain of the transfer function given below
𝐶(𝑠) 𝑠 2 + 4𝑠 + 3
=
𝑅(𝑠) (𝑠 + 5)(𝑠 2 + 4𝑠 + 7)
num = [1 4 3]
den= conv([1 5], [1 4 7])
g = tf (num,den)
[z,p,k] = tf2zp(num,den)
pzmap(g)

Output:
g=
s^2 + 4 s + 3
-----------------------
s^3 + 9 s^2 + 27 s + 35
Continuous-time transfer function.
z=
-3
-1
p=
-5.0000 + 0.0000i
-2.0000 + 1.7321i
-2.0000 - 1.7321i
k=
1

22
3. Obtain the poles, zeros and gain of the transfer functions given below
𝐶(𝑠) 1
a. =
𝑅(𝑠) 𝑠 𝑠 +𝑠+4
𝐶(𝑠) 5
b. =
𝑅(𝑠) 𝑠 𝑠 +9
𝐶(𝑠) 1
c. =
𝑅(𝑠) (𝑠 𝑠 +3𝑠+5)(𝑠+3)(𝑠+5)

23

You might also like