Cloud hardware project 1 and ch5 questions
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import numpy as np
|
||||
import scipy as sp
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
def u(n):
|
||||
return np.heaviside(n, 1)
|
||||
|
||||
|
||||
def ideal_lowpass(omega, omega_c):
|
||||
return np.where(np.abs(omega) <= omega_c, 1, 0)
|
||||
|
||||
|
||||
def main():
|
||||
omega_c = 0.4*np.pi
|
||||
omega = np.arange(0, np.pi, 0.05*np.pi)
|
||||
|
||||
h_lpf = ideal_lowpass(omega, omega_c)
|
||||
|
||||
plt.plot(omega, h_lpf)
|
||||
plt.show()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user