我试图用一把锋利的剃须刀画出预期的衍射图,它的公式是:
I(p) = \frac 14 \delta^2(p) + \frac {1}{4\pi^2p^2},其中p = \frac {\sin\theta}{\lambda}
最初,我只想列出一个简单的x值列表,并将它们输入方程中,得到y值并绘制这些值,如下所示:
x = [theta for theta in range(-90,90)]
y = [I(theta) for theta in x]
plt.plot(x,y)
但是,我不知道如何编写I(\theta),因为我不知道如何在python中编写dirac增量函数。一个图这个函数会是怎样的?
发布于 2020-10-31 09:01:26
本例中的
从进口信号number_points =100 location_of_impulse= 60 it_theta=signal.unit_impulse(number_points,location_of_impulse)进口numpy为np
顺便说一句,下面是SCIPY的直接副本,可能更有启发性的..........................................................................
从进口信号导入matplotlib.pyplot = signal.unit_impulse(100,40) b,a= signal.butter(4,0.2)响应= signal.lfilter(b,a,imp)
plt.plot(np.arange(-50,50),imp) plt.plot(np.arange(-50,50),response) plt.margins(0.1,0.1) plt.xlabel('Time 样本') plt.ylabel(‘振幅’)plt.grid(真)
‘
https://datascience.stackexchange.com/questions/62776
复制相似问题