Skip to content

Commit 49dd32e

Browse files
committed
fft comparison wip
1 parent 0ea0bce commit 49dd32e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/dsp/fft_comparison.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
[com.github.psambit9791.jdsp.transform FastFourier]
2323
[org.jtransforms.fft DoubleFFT_1D]))
2424

25+
(set! *warn-on-reflection* true)
26+
2527
;; # Introduction
2628
;;
2729
;; The [Fast Fourier Transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) (FFT) is fundamental to signal processing, audio analysis, image compression, and scientific computing. If you're working with frequency analysis in Clojure, you have several Java FFT libraries to choose from.
@@ -84,7 +86,7 @@
8486

8587
;; We'll create a simple test signal: a combination of two [sine waves](https://en.wikipedia.org/wiki/Sine_wave) at 5 Hz and 12 Hz, [sampled](https://en.wikipedia.org/wiki/Sampling_(signal_processing)) at 100 Hz for 1 second.
8688

87-
; Hz
89+
; Hz
8890
(def sample-rate 100.0)
8991
; seconds
9092
(def duration 1.0)
@@ -156,7 +158,7 @@
156158

157159
(defn fft-apache-commons
158160
"Compute FFT using Apache Commons Math."
159-
[signal]
161+
[^doubles signal]
160162
(let [transformer (FastFourierTransformer. DftNormalization/STANDARD)]
161163
; Result is Complex[] array
162164
(.transform transformer signal TransformType/FORWARD)))

0 commit comments

Comments
 (0)