Write python program to plot the zeros and poles if a user provides the coefficients for the numerator and denominator of the transfer function. Since the zeros and poles can be complex, this plot is essentially and argand diagram, where the x axis is the real component and the y axis the imaginary component of a given zero or pole. Create a method called plot-poles zeros(num, den) which takes two lists containing the coefficients. Here is an example and the resulting plot. num [1, 3, 7] # yields zeros at -1.5 +/- 2.17945j den = [1, 4, 5, 3] # yields poles at -2.46557, -0.7672143 +/- 0.7925519j plot_poles_zeros(num, den) Imaginary Page 2 Pole-Zero Plot 3 Zeros × Poles 2 1 -2 1 * Real When you write your code you are only allowed to use the packages numpy and matplotlib. Make sure you label the axes, provide a legend and give a title to your plot (See the example plot). Hint: numpy has a method called roots. When given a list of numbers corresponding to the coefficients of a polynomial, it will find the solutions. Make sure you use cross symbol for poles and filled circles for zeros. You can use what ever colors you like. The numpy methods real and imag will let you extract the real and imaginary part of a zero or pole.

Introductory Circuit Analysis (13th Edition)
13th Edition
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:Robert L. Boylestad
Chapter1: Introduction
Section: Chapter Questions
Problem 1P: Visit your local library (at school or home) and describe the extent to which it provides literature...
icon
Related questions
Question
Write python program to plot the zeros and poles if a user provides the coefficients for
the numerator and denominator of the transfer function. Since the zeros and poles can be
complex, this plot is essentially and argand diagram, where the x axis is the real component
and the y axis the imaginary component of a given zero or pole.
Create a method called plot-poles zeros(num, den) which takes two lists containing the
coefficients. Here is an example and the resulting plot.
num
[1, 3, 7] # yields zeros at -1.5 +/- 2.17945j
den = [1, 4, 5, 3] # yields poles at -2.46557, -0.7672143 +/- 0.7925519j
plot_poles_zeros(num, den)
Imaginary
Page 2
Pole-Zero Plot
3
Zeros
× Poles
2
1
-2
1
*
Real
When you write your code you are only allowed to use the packages numpy and matplotlib.
Make sure you label the axes, provide a legend and give a title to your plot (See the example
plot).
Hint: numpy has a method called roots. When given a list of numbers corresponding to the
coefficients of a polynomial, it will find the solutions.
Make sure you use cross symbol for poles and filled circles for zeros. You can use what ever
colors you like.
The numpy methods real and imag will let you extract the real and imaginary part of a zero
or pole.
Transcribed Image Text:Write python program to plot the zeros and poles if a user provides the coefficients for the numerator and denominator of the transfer function. Since the zeros and poles can be complex, this plot is essentially and argand diagram, where the x axis is the real component and the y axis the imaginary component of a given zero or pole. Create a method called plot-poles zeros(num, den) which takes two lists containing the coefficients. Here is an example and the resulting plot. num [1, 3, 7] # yields zeros at -1.5 +/- 2.17945j den = [1, 4, 5, 3] # yields poles at -2.46557, -0.7672143 +/- 0.7925519j plot_poles_zeros(num, den) Imaginary Page 2 Pole-Zero Plot 3 Zeros × Poles 2 1 -2 1 * Real When you write your code you are only allowed to use the packages numpy and matplotlib. Make sure you label the axes, provide a legend and give a title to your plot (See the example plot). Hint: numpy has a method called roots. When given a list of numbers corresponding to the coefficients of a polynomial, it will find the solutions. Make sure you use cross symbol for poles and filled circles for zeros. You can use what ever colors you like. The numpy methods real and imag will let you extract the real and imaginary part of a zero or pole.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Introductory Circuit Analysis (13th Edition)
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:
9780133923605
Author:
Robert L. Boylestad
Publisher:
PEARSON
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Electrical Engineering
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education
Fundamentals of Electric Circuits
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:
9780078028229
Author:
Charles K Alexander, Matthew Sadiku
Publisher:
McGraw-Hill Education
Electric Circuits. (11th Edition)
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:
9780134746968
Author:
James W. Nilsson, Susan Riedel
Publisher:
PEARSON
Engineering Electromagnetics
Engineering Electromagnetics
Electrical Engineering
ISBN:
9780078028151
Author:
Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:
Mcgraw-hill Education,