From 1dc7b6ca41e9c11925da5c9c53bf5078657d2ace Mon Sep 17 00:00:00 2001 From: Liam Healy <liam@thinkpad.local> Date: Sun, 8 Nov 2009 17:35:16 -0500 Subject: [PATCH] Add discrete Fourier transforms Interface to discrete Fourier transforms defined in GSL but not documented, apparently used for tests of FFT only. --- fast-fourier-transforms/discrete.lisp | 75 +++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 fast-fourier-transforms/discrete.lisp diff --git a/fast-fourier-transforms/discrete.lisp b/fast-fourier-transforms/discrete.lisp new file mode 100644 index 00000000..6e1fc10d --- /dev/null +++ b/fast-fourier-transforms/discrete.lisp @@ -0,0 +1,75 @@ +;; Discrete Fourier Transforms +;; Liam Healy 2009-11-07 14:24:07EST +;; Time-stamp: <2009-11-07 17:02:19EST discrete.lisp> + +;;; These functions are not documented in GSL and appear to be present +;;; only to provide a check on the FFT routines. + +(in-package :gsl) + +;; /usr/include/gsl/gsl_dft_complex.h +;; /usr/include/gsl/gsl_dft_complex_float.h + +(defmfun forward-discrete-fourier-transform + ((vector vector) + &key (stride 1) + (result (make-marray element-type :dimensions (dimensions vector)))) + ("gsl_dft" :type "_forward") + (((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet) + ((c-pointer result) :pointer)) + :definition :generic + :element-types :complex + :inputs (vector) + :outputs (result) + :return (result) + :documentation + "Forward discrete Fourier transform provided to check the FFT + routines.") + +(defmfun backward-discrete-fourier-transform + ((vector vector) + &key (stride 1) + (result (make-marray element-type :dimensions (dimensions vector)))) + ("gsl_dft" :type "_backward") + (((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet) + ((c-pointer result) :pointer)) + :definition :generic + :element-types :complex + :inputs (vector) + :outputs (result) + :return (result) + :documentation + "Backward discrete Fourier transform provided to check the FFT + routines.") + +(defmfun inverse-discrete-fourier-transform + ((vector vector) + &key (stride 1) + (result (make-marray element-type :dimensions (dimensions vector)))) + ("gsl_dft" :type "_inverse") + (((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet) + ((c-pointer result) :pointer)) + :definition :generic + :element-types :complex + :inputs (vector) + :outputs (result) + :return (result) + :documentation + "Inverse discrete Fourier transform provided to check the FFT + routines.") + +(defmfun discrete-fourier-transform + ((vector vector) + &key (stride 1) + (result (make-marray element-type :dimensions (dimensions vector)))) + ("gsl_dft" :type "_transform") + (((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet) + ((c-pointer result) :pointer)) + :definition :generic + :element-types :complex + :inputs (vector) + :outputs (result) + :return (result) + :documentation + "Discrete Fourier transform in selectable direction provided to + check the FFT routines.") -- GitLab