Skip to content

Instantly share code, notes, and snippets.

@jorge-lavin
Created January 13, 2015 12:06
Show Gist options
  • Save jorge-lavin/c46a40742ea706ab5eba to your computer and use it in GitHub Desktop.
Save jorge-lavin/c46a40742ea706ab5eba to your computer and use it in GitHub Desktop.
Reverse List for FFT
# As stated in the SciPy documentation for fft http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.fftpack.fft.html
# Note that y(-j) = y(n-j).conjugate().
# This is a possible implementation of that equality.
import numpy as np
from scipy.fftpack import fft
x = np.linspace(-np.pi, np.pi, 201)
y = fft(x)
list_index = range(len(y))
[l[i].conjugate() for i in reversed(list_index)]
# Now its spectrum can be computed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment