
Question
Transcribed Text
Solution Preview
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.
import numpy as npimport matplotlib.pyplot as plt
from scipy import signal
a = 0.9
'''
ANIMATION OF CONVOLUTION:
x[n] = delta function
h[n] = a^n
'''
n = np.arange(-50, 50)
h = np.array([0 for i in range(int(len(n)/2))] + [a**i for i in range(int(len(n)/2))])
convolution = np.zeros(len(n))
for i in range(len(n)):
plt.subplot(3,1,1)
plt.cla()
plt.title("Convolution of Delta Function with a^n, a = " + str(a))
plt.plot(n, h, color="red")
plt.ylabel("h[n]")
plt.subplot(3,1,2)
plt.cla()
x = signal.unit_impulse(100, i)
plt.plot(n, x, color="blue")
plt.ylabel("x[n]")
plt.subplot...
By purchasing this solution you'll be able to access the following files:
Solution.zip.