Bird
Raised Fist0
Signal Processingdata~10 mins

Stability analysis (pole-zero plot) in Signal Processing - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the function that computes the poles and zeros of a system.

Signal Processing
from scipy.signal import [1]

zeros, poles, _ = tf2zpk([1, 0.5], [1, -0.8, 0.15])
Drag options to blanks, or click blank then click option'
Afreqz
Btf2zpk
Clfilter
Dbutter
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'freqz' which computes frequency response, not poles and zeros.
Using 'lfilter' which filters signals, not related to poles and zeros.
Using 'butter' which designs Butterworth filters, not for poles and zeros extraction.
2fill in blank
medium

Complete the code to plot the poles and zeros on the complex plane.

Signal Processing
import matplotlib.pyplot as plt

plt.scatter(zeros.real, zeros.imag, marker='o', label='Zeros')
plt.scatter(poles.real, poles.[1], marker='x', label='Poles')
plt.xlabel('Real')
plt.ylabel('Imaginary')
plt.legend()
plt.grid(True)
plt.title('Pole-Zero Plot')
plt.show()
Drag options to blanks, or click blank then click option'
Aimag
Breal
Cangle
Dconj
Attempts:
3 left
💡 Hint
Common Mistakes
Using '.real' for the imaginary axis.
Using '.angle' which gives the phase angle, not the imaginary part.
Using '.conj' which gives the complex conjugate, not the imaginary part.
3fill in blank
hard

Fix the error in the code that checks system stability by verifying if all poles are inside the unit circle.

Signal Processing
stable = all(abs(p) [1] 1 for p in poles)
print('System is stable:', stable)
Drag options to blanks, or click blank then click option'
A<
B>
C<=
D>=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' which checks poles outside the unit circle.
Using '>=' or '<=' which includes poles on the unit circle, not strictly inside.
4fill in blank
hard

Fill both blanks to create a dictionary of poles and zeros with their magnitudes.

Signal Processing
magnitudes = { 'zeros': [abs(z) for z in [1]], 'poles': [abs(p) for p in [2]] }
Drag options to blanks, or click blank then click option'
Azeros
Bpoles
Croots
Dvalues
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'roots' or 'values' which are not defined variables here.
Mixing zeros and poles in the wrong blanks.
5fill in blank
hard

Fill all three blanks to filter poles with magnitude greater than 1 and create a list of their angles in radians.

Signal Processing
import cmath

unstable_poles = [p for p in [1] if abs(p) [2] 1]
angles = [[3](p) for p in unstable_poles]
Drag options to blanks, or click blank then click option'
Apoles
B>
Ccmath.phase
Dzeros
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'zeros' instead of 'poles' for filtering.
Using '<' instead of '>' for magnitude comparison.
Using 'abs' instead of 'cmath.phase' for angle calculation.

Practice

(1/5)
1. What does it mean for a system to be stable in terms of its poles on the pole-zero plot?
easy
A. All poles must lie in the left half of the complex plane (negative real parts).
B. All poles must lie on the imaginary axis.
C. All zeros must lie in the right half of the complex plane.
D. Poles and zeros must be equal in number.

Solution

  1. Step 1: Understand pole location and stability

    Stability depends on poles, not zeros. Poles with negative real parts mean the system's response decays over time.
  2. Step 2: Identify correct pole location for stability

    Poles in the left half-plane (negative real parts) ensure the system is stable.
  3. Final Answer:

    All poles must lie in the left half of the complex plane (negative real parts). -> Option A
  4. Quick Check:

    Stable system = poles with negative real parts [OK]
Hint: Stable system means poles left of imaginary axis [OK]
Common Mistakes:
  • Confusing zeros with poles for stability
  • Thinking poles on imaginary axis are stable
  • Assuming zeros affect stability directly
2. Which of the following is the correct Python syntax to plot poles and zeros using the scipy.signal library?
easy
A. signal.pzmap(system, plot=True)
B. signal.pzplot(system)
C. signal.pzplot(system, plot=True)
D. signal.pzmap(system, plot=False)

Solution

  1. Step 1: Recall scipy.signal function for pole-zero plot

    The function to plot poles and zeros is pzmap, not pzplot.
  2. Step 2: Check correct usage with plotting enabled

    Using pzmap with plot=True plots the pole-zero map correctly.
  3. Final Answer:

    signal.pzmap(system, plot=True) -> Option A
  4. Quick Check:

    Use pzmap with plot=True for pole-zero plot [OK]
Hint: Use pzmap with plot=True to plot poles and zeros [OK]
Common Mistakes:
  • Using non-existent function pzplot
  • Forgetting plot=True argument
  • Confusing function names
3. Given the poles of a system as poles = [-1+2j, -1-2j, 0.5], what can you say about the system's stability?
medium
A. The system is stable because poles are complex conjugates.
B. The system is stable because all poles have negative real parts.
C. The system is marginally stable because poles are on the imaginary axis.
D. The system is unstable because one pole has a positive real part.

Solution

  1. Step 1: Analyze the real parts of each pole

    Poles are -1+2j (real part -1), -1-2j (real part -1), and 0.5 (real part 0.5).
  2. Step 2: Determine stability from pole real parts

    Since one pole has positive real part (0.5), the system is unstable.
  3. Final Answer:

    The system is unstable because one pole has a positive real part. -> Option D
  4. Quick Check:

    Positive real pole means unstable system [OK]
Hint: Check if any pole has positive real part for instability [OK]
Common Mistakes:
  • Ignoring positive real part pole
  • Assuming complex conjugates guarantee stability
  • Confusing marginal stability with instability
4. The following Python code attempts to plot poles and zeros but gives an error:
from scipy import signal
system = signal.TransferFunction([1, 3], [1, 2, 1])
signal.pzplot(system)

What is the error and how to fix it?
medium
A. TransferFunction requires discrete=True for pzplot to work.
B. TransferFunction arguments are reversed; swap numerator and denominator.
C. Function pzplot does not exist; use pzmap(system, plot=True) instead.
D. Import statement is wrong; use import scipy.signal as signal.

Solution

  1. Step 1: Identify the function causing error

    The function pzplot does not exist in scipy.signal, causing the error.
  2. Step 2: Use correct function to plot poles and zeros

    Use pzmap(system, plot=True) to plot poles and zeros correctly.
  3. Final Answer:

    Function pzplot does not exist; use pzmap(system, plot=True) instead. -> Option C
  4. Quick Check:

    Use pzmap, not pzplot, for pole-zero plots [OK]
Hint: Use pzmap with plot=True, not pzplot [OK]
Common Mistakes:
  • Using non-existent pzplot function
  • Swapping numerator and denominator unnecessarily
  • Wrong import statement causing confusion
5. You have a system with poles at -0.5, -1+1j, -1-1j and zeros at 0, -2. Which statement best describes the system's stability and response?
hard
A. The system is marginally stable because of zeros at zero.
B. The system is stable with oscillatory decay due to complex poles.
C. The system is unstable because zeros are on the right half-plane.
D. The system is unstable due to poles with positive real parts.

Solution

  1. Step 1: Check pole locations for stability

    All poles have negative real parts (-0.5, -1), so system is stable.
  2. Step 2: Analyze pole types for response behavior

    Complex conjugate poles (-1±1j) cause oscillations that decay over time.
  3. Step 3: Consider zeros' effect on stability

    Zeros do not affect stability directly; zeros at 0 and -2 are not in right half-plane.
  4. Final Answer:

    The system is stable with oscillatory decay due to complex poles. -> Option B
  5. Quick Check:

    Negative real poles + complex = stable oscillatory decay [OK]
Hint: Stable if poles negative; complex poles cause oscillations [OK]
Common Mistakes:
  • Confusing zeros with poles for stability
  • Thinking zeros at zero cause instability
  • Ignoring oscillatory nature of complex poles
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard