<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">np.fft.ifft([0, 4, 0, 0])
# array([ 1.+0.j,  0.+1.j, -1.+0.j,  0.-1.j])

# Create and plot a band-limited signal with random phases:

import matplotlib.pyplot as plt
t = np.arange(400)
n = np.zeros((400,), dtype=complex)
n[40:60] = np.exp(1j*np.random.uniform(0, 2*np.pi, (20,)))
s = np.fft.ifft(n)
plt.plot(t, s.real, 'b-', t, s.imag, 'r--')
# ...
plt.legend(('real', 'imaginary'))
# ...
plt.show()
</pre></body></html>