傅里叶展开作图
原文地址:https://www.cnblogs.com/liqinglucky/p/fourier.html
import matplotlib.pyplot as plt import numpy as np t = np.arange(-2*np.pi, 2*np.pi, 0.01) s =(4*np.sin(t))/(np.pi)+(4* np.sin(3*t))/(3*np.pi) plt.plot(t, s) plt.xlabel('time (s)') plt.ylabel('voltage (mV)') plt.title('About as simple as it gets, folks') plt.grid(True) plt.savefig("test.png") plt.show()