0
0
Signal Processingdata~10 mins

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

Choose your learning style9 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.