Skip to content

Instantly share code, notes, and snippets.

@hessammehr
Created May 18, 2014 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hessammehr/e603bf196138b496dfc3 to your computer and use it in GitHub Desktop.
Save hessammehr/e603bf196138b496dfc3 to your computer and use it in GitHub Desktop.
(import '[edu.emory.mathcs.jtransforms.fft DoubleFFT_1D])
(defn fft [data] (let [a-data (into-array Double/TYPE data)
fftfun (DoubleFFT_1D. (count data))
dummy (.realForward fftfun a-data)] a-data))
;; Example: Constant signal
(fft (take 128 (repeat 1.0)))
;; [optional] view the result as vector
(vec *1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment