擅长:python、mysql、java
<p>我猜你在找这样的东西:</p>
<pre><code>from numpy.fft import fft
x = array([ 0., 1., 0., 1.])
y = fft(x)
#first rescale it
nfft = len(x)
y /= nfft
n = arange(0,4)
# notice that y[1] and y[3] are identically zero:
x_reconstructed = y[0] +y[2] * cos(2*2*pi/nfft*n)
</code></pre>
<p>现在你有了<code>x_reconstructed==x</code>。现在您可以转到DFT页面,特别是<a href="https://en.wikipedia.org/wiki/Discrete_Fourier_transform#math_Eq.2" rel="nofollow">this</a>方程,并根据上面的例子理解求和符号。在</p>