0
0
Signal Processingdata~10 mins

Region of convergence 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 compute the Z-transform of a sequence.

Signal Processing
import numpy as np

x = [1, 2, 3]
z = np.array([1, -1j, 1j])
X = sum(x[n] * z[1]n for n in range(len(x)))
print(X)
Drag options to blanks, or click blank then click option'
A**
B*
C+
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using '*' instead of '**' causes a multiplication error.
Using '+' or '-' changes the meaning and causes wrong results.
2fill in blank
medium

Complete the code to check if the magnitude of z is inside the region of convergence (ROC).

Signal Processing
z = 0.5 + 0.5j
roc_radius = 1.0
if abs(z) [1] roc_radius:
    print('Inside ROC')
else:
    print('Outside ROC')
Drag options to blanks, or click blank then click option'
A>
B==
C<
D>=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' reverses the condition and gives wrong results.
Using '==' is too strict and rarely true.
3fill in blank
hard

Fix the error in the code to compute the ROC for a causal sequence with pole at p.

Signal Processing
p = 0.8
roc = {z for z in np.linspace(0, 2, 100) if abs(z) [1] abs(p)}
print(len(roc))
Drag options to blanks, or click blank then click option'
A>
B<
C<=
D>=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' selects inside the pole, which is incorrect for causal sequences.
Using '<=' or '>=' changes the boundary inclusion incorrectly.
4fill in blank
hard

Fill both blanks to create a dictionary of z values and their ROC status for a pole at p.

Signal Processing
p = 0.6
z_values = np.linspace(0, 1.5, 10)
roc_dict = {z: 'inside' if abs(z) [1] abs(p) else 'outside' for z in z_values if z [2] 0}
print(roc_dict)
Drag options to blanks, or click blank then click option'
A<
B>
C>=
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' in the first blank reverses the ROC condition.
Using '<=' or '>=' changes the strictness of the condition incorrectly.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps z to magnitude and ROC status for poles p1 and p2.

Signal Processing
p1, p2 = 0.5, 1.2
z_vals = np.linspace(0, 2, 15)
roc_info = {z: (abs(z), 'inside' if abs(z) [1] abs(p1) and abs(z) [2] abs(p2) else 'outside') for z in z_vals if z [3] 0}
print(roc_info)
Drag options to blanks, or click blank then click option'
A>
B<
C>=
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing inequalities causes wrong ROC classification.
Not filtering positive z values includes zero or negatives.