Skip to content

Instantly share code, notes, and snippets.

View hessammehr's full-sized avatar

Hessam Mehr hessammehr

View GitHub Profile
(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