Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to compute the Z-transform of a unit step sequence.
Signal Processing
import sympy as sp z = sp.symbols('z') n = sp.symbols('n', integer=True, nonnegative=True) x = sp.Heaviside(n) X = sp.summation(x * z**(-n), (n, 0, sp.oo)) result = X # Result is [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing z and z^-1 in the formula.
Using z/(z-1) instead of 1/(1-z^-1).
✗ Incorrect
The Z-transform of the unit step sequence u[n] is 1 / (1 - z-1) for |z| > 1.
2fill in blank
mediumComplete the code to find the Z-transform of the sequence x[n] = a^n u[n].
Signal Processing
a = sp.symbols('a') x = a**n * sp.Heaviside(n) X = sp.summation(x * z**(-n), (n, 0, sp.oo)) result = X # Result is [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping a and z in the denominator.
Forgetting the unit step function u[n].
✗ Incorrect
The Z-transform of x[n] = an u[n] is 1 / (1 - a z-1) for |z| > |a|.
3fill in blank
hardFix the error in the code to compute the Z-transform of the sequence x[n] = delta[n - k].
Signal Processing
k = sp.symbols('k', integer=True, nonnegative=True) x = sp.KroneckerDelta(n - k) X = sp.summation(x * z**(-n), (n, 0, sp.oo)) result = X # Result should be [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using z^k instead of z^-k.
Confusing the sign in the exponent.
✗ Incorrect
The Z-transform of delta[n - k] is z-k.
4fill in blank
hardFill both blanks to compute the Z-transform of x[n] = n * a^n * u[n].
Signal Processing
x = n * a**n * sp.Heaviside(n) X = sp.summation(x * z**(-n), (n, 0, sp.oo)) result = [1] / ([2])**2
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to square the denominator.
Mixing up numerator and denominator terms.
✗ Incorrect
The Z-transform of n an u[n] is (a z-1) / (1 - a z-1)2.
5fill in blank
hardFill all three blanks to compute the Z-transform of x[n] = cos(ω₀ n) u[n].
Signal Processing
omega0 = sp.symbols('omega0', real=True) x = sp.cos(omega0 * n) * sp.Heaviside(n) X = sp.summation(x * z**(-n), (n, 0, sp.oo)) result = ([1] - [2] * z**-1) / (1 - 2 * [3] * z**-1 + z**-2)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using sin(ω₀) instead of cos(ω₀).
Mixing up powers of z in numerator and denominator.
✗ Incorrect
The Z-transform of cos(ω₀ n) u[n] is (z - cos(ω₀) z-1) / (1 - 2 cos(ω₀) z-1 + z-2).