傅里叶展开作图

 原文地址: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()

  

posted @ 2023-06-29 08:35  liqinglucky  阅读(25)  评论(0编辑  收藏  举报