Commit 503e5186 authored by Liam Healy's avatar Liam Healy

Use make-fft-wavetable and make-fft-workspace to make FFT objects

Use make-fft-wavetable and make-fft-workspace to make the FFT objects.
The specific FFT wavetable and workspace mobjects are not exported,
which is now possible to specify in defmobject with :export nil.
parent ce3177ad
;; Wavetable and workspace object definitions.
;; Sumant Oemrawsingh, Sun Oct 25 2009 - 16:35
;; Time-stamp: <2009-11-07 10:38:29EST wavetable-workspace.lisp>
;; Time-stamp: <2009-11-07 11:24:02EST wavetable-workspace.lisp>
(in-package :gsl)
;;; Define the wavetables and workspaces needed for non-power-of-2
;;; dimension vectors. These mobjects and their makers are not
;;; exported; instead, the user should call
;;; make-fft-wavetable and make-fft-workspace.
;;;;****************************************************************************
;;;; Real
;;;;****************************************************************************
......@@ -15,6 +20,7 @@
"gsl_fft_real_wavetable" ((n sizet))
"structure that holds the factorization and trigonometric lookup tables for
the mixed radix real fft algorithm"
:export nil
:documentation
"These functions prepare trigonometric lookup tables for an FFT of size n
real elements. The functions return a pointer to the newly allocated struct
......@@ -36,6 +42,7 @@
"gsl_fft_real_wavetable_float" ((n sizet))
"structure that holds the factorization and trigonometric lookup tables for
the mixed radix real float fft algorithm"
:export nil
:documentation
"These functions prepare trigonometric lookup tables for an FFT of size n
real float elements. The functions return a pointer to the newly allocated
......@@ -57,6 +64,7 @@
"gsl_fft_real_workspace" ((n sizet))
"Structure that holds the additional working space required for the
intermediate steps of the mixed radix real fft algoritms"
:export nil
:documentation
"This function allocates a workspace for a real transform of length n.")
......@@ -64,6 +72,7 @@
"gsl_fft_real_workspace_float" ((n sizet))
"Structure that holds the additional working space required for the
intermediate steps of the mixed radix real float fft algoritms"
:export nil
:documentation
"This function allocates a workspace for a real float transform of length
n.")
......@@ -79,6 +88,7 @@
"gsl_fft_complex_wavetable" ((n sizet))
"structure that holds the factorization and trigonometric lookup tables for
the mixed radix complex fft algorithm"
:export nil
:documentation
"This function prepares a trigonometric lookup table for a complex FFT of
length n. The function returns a pointer to the newly allocated
......@@ -100,6 +110,7 @@
"gsl_fft_complex_wavetable_float" ((n sizet))
"structure that holds the factorization and trigonometric lookup tables for
the mixed radix complex float fft algorithm"
:export nil
:documentation
"This function prepares a trigonometric lookup table for a complex float FFT
of length n. The function returns a pointer to the newly allocated
......@@ -121,6 +132,7 @@
"gsl_fft_complex_workspace" ((n sizet))
"Structure that holds the additional working space required for the
intermediate steps of the mixed radix complex fft algoritms"
:export nil
:documentation
"This function allocates a workspace for a complex transform of length n.")
......@@ -128,6 +140,7 @@
"gsl_fft_complex_workspace_float" ((n sizet))
"Structure that holds the additional working space required for the
intermediate steps of the mixed radix complex float fft algoritms"
:export nil
:documentation
"This function allocates a workspace for a complex float transform of length
n.")
......@@ -143,6 +156,7 @@
"gsl_fft_halfcomplex_wavetable" ((n sizet))
"structure that holds the factorization and trigonometric lookup tables for
the mixed radix halfcomplex fft algorithm"
:export nil
:documentation
"These functions prepare trigonometric lookup tables for an FFT of size n
real elements. The functions return a pointer to the newly allocated struct
......@@ -164,6 +178,7 @@
"gsl_fft_halfcomplex_wavetable_float" ((n sizet))
"structure that holds the factorization and trigonometric lookup tables for
the mixed radix real float fft algorithm"
:export nil
:documentation
"These functions prepare trigonometric lookup tables for an FFT of size n
real float elements. The functions return a pointer to the newly allocated
......@@ -185,7 +200,7 @@
;;;; General makers
;;;;****************************************************************************
;; Generalised ways of making wavetables
;;; Generalised ways of making wavetables
(export 'make-fft-wavetable)
(defun make-fft-wavetable (element-type dimension &optional (half-complex nil))
"Make a wavetable for an FFT of the given element type and length. T can be
......@@ -204,7 +219,7 @@
((equal element-type '(complex double-float))
(make-fft-complex-wavetable-double-float dimension))))
;; Generalised ways of making workspaces
;;; Generalised ways of making workspaces
(export 'make-fft-workspace)
(defun make-fft-workspace (element-type dimension)
"Make a wavetable for an FFT of the given element type and length."
......@@ -217,7 +232,7 @@
((equal element-type '(complex double-float))
(make-fft-complex-workspace-double-float dimension))))
;; An environment to allow more efficient FFTs of the same type and length
;;; An environment to allow more efficient FFTs of the same type and length
(export 'with-fourier-transform-environment)
(defmacro with-fourier-transform-environment
((wavetable workspace element-type dimension &optional (half-complex nil))
......
;; Definition of GSL objects and ways to use them.
;; Liam Healy, Sun Dec 3 2006 - 10:21
;; Time-stamp: <2009-08-25 20:45:31EDT mobject.lisp>
;; Time-stamp: <2009-11-07 11:21:10EST mobject.lisp>
;;; GSL objects are represented in GSLL as and instance of a 'mobject.
;;; The macro demobject takes care of defining the appropriate
......@@ -61,7 +61,7 @@
(class prefix allocation-args description
&key documentation initialize-suffix initialize-name initialize-args
arglists-function inputs gsl-version allocator allocate-inputs freer
((:callbacks cbinfo))
((:callbacks cbinfo)) (export t)
(superclasses (if cbinfo '(callback-included) '(mobject)))
singular switch ri-c-return)
"Define the class, the allocate, initialize-instance and
......@@ -114,7 +114,7 @@
cbinfo
superclasses
switch ri-c-return))
(export '(,maker ,class))
,@(when export `((export '(,maker ,class))))
,@(when cbinfo `((record-callbacks-for-class ',class ',cbinfo)))
,@(when cbinfo (make-mobject-defmcallbacks cbinfo class))
,(mobject-maker
......@@ -122,7 +122,7 @@
description documentation initialize-args initializerp settingp
singular cbinfo))
`(progn
(export ',maker)
,@(when export `((export ',maker)))
(defun ,maker (&rest args)
(declare (ignore args))
(error 'obsolete-gsl-version
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment