[Gsll-devel] need fft routines
Mirko Vukovic
mirko.vukovic at gmail.com
Wed Jun 17 13:26:04 UTC 2009
I tried recently to link to gsl's gsl_fft_complex_radix2_forward, but
failed miserably:
(defmfun fft-c2f (x n)
"gsl_fft_complex_radix2_forward"
;; for gsl doc and example see
;; http://www.gnu.org/software/gsl/manual/html_node/Radix_002d2-FFT-routines-for-complex-data.html
;; for stride I use the example from sorting.lisp
(((mpointer x) :pointer) (1 sizet) (n :int))
:inputs (x)
:definition :function
:c-return :success-failure
:documentation
"Forward FFT for a complex double radix-2 vector")
#|
;; test run
(let ((arg (make-marray '(complex double-float) :dimensions 4
:initial-element #c(0d0 0d0))))
(setf (aref arg 2) #c(1d0 0d0))
(let* ((dim (length arg)))
;; (double (make-array (* 2 dim)
;; :element-type 'double-float
;; :initial-element 0d0)))
;; repackaging complex as double -- is there a built-in? ;
;; (loop
;; for re-im across arg
;; for i from 0 to (* 2 (1- dim)) by 2
;; do (progn
;; (setf (aref double i) (realpart re-im))
;; (setf (aref double (1+ i)) (imagpart re-im))))
(print dim)
(fft-c2f arg dim)))
|#
I see one possible problem, that gsl_complex_packed_array datatypes.
I don't see those defined in gsll.
Can someone help me with linking to the fft routines? Once I can
access gsl's fft's, I will verify the computation, and also generate
the unit tests.
Thanks,
Mirko
More information about the gsll-devel
mailing list