21 lines
266 B
Python
21 lines
266 B
Python
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
def main():
|
|
f_s = 6
|
|
T_s = 1/f_s
|
|
t = np.arange(-1, 1, T_s)
|
|
|
|
f = 3
|
|
omega = 2*np.pi*f
|
|
signal = np.cos(omega*t)
|
|
|
|
plt.stem(t, signal)
|
|
plt.show()
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|