如何用DFT计算一阶导数?

时间:2018-08-01 05:50:52

标签: python fft dft

我正在尝试通过计算e^sin(x)来找到P'(x)的导数的频谱近似。

enter image description here

def solve4(N):
xlist = []              #list of all x values
flist = []              #list of all f values
deriv = []              #list of first derivative of all values in f
for j in range(0,N):
    xlist.append((j*2*pi)/N)
for x in xlist:
    flist.append(e**(sin(x)))
for i in range(0,N):
    deriv.append((cos(xlist[i]))*(flist[i]))
P  = np.fft.fft(xlist,N)            #P is an array after xlist's FFT

0 个答案:

没有答案