Fourier transforms
Try varying the values of 𝑁 and 𝑎, and see the effect on the plots of 𝑔(𝑘).
![discrete fourier transforms](https://i-blog.csdnimg.cn/blog_migrate/6e42cbc17a015ae50b0f1992613cb8b9.png)
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.set(style="darkgrid")
from ipywidgets import interact
import ipywidgets as widgets
def fourier_trans(N,a):
x=np.arange(-3*N*a,3*N*a,0.01)
y=np.sin((N+1/2)*a*x)/np.sin(a/2*x)
plt.plot(x,y)
interact(fourier_trans,N=(0,10),a=(0.,3.));
plot of fourier transform
链接