summaryrefslogtreecommitdiff
path: root/module/ffts.m
diff options
context:
space:
mode:
Diffstat (limited to 'module/ffts.m')
-rw-r--r--module/ffts.m32
1 files changed, 32 insertions, 0 deletions
diff --git a/module/ffts.m b/module/ffts.m
new file mode 100644
index 00000000..67b55607
--- /dev/null
+++ b/module/ffts.m
@@ -0,0 +1,32 @@
+FFTs: module{
+ PATH: con "/dis/math/ffts.dis";
+
+ ffts: fn(a,b:array of real, ntot,n,nspan,isn:int);
+};
+
+# multivariate complex fourier transform, computed in place
+# using mixed-radix fast fourier transform algorithm.
+# arrays a and b originally hold the real and imaginary
+# components of the data, and return the real and
+# imaginary components of the resulting fourier coefficients.
+# multivariate data is indexed according to the fortran
+# array element successor function, without limit
+# on the number of implied multiple subscripts.
+# the subroutine is called once for each variate.
+# the calls for a multivariate transform may be in any order.
+# ntot is the total number of complex data values.
+# n is the dimension of the current variable.
+# nspan/n is the spacing of consecutive data values
+# while indexing the current variable.
+# the sign of isn determines the sign of the complex
+# exponential, and the magnitude of isn is normally one.
+# univariate transform:
+# ffts(a,b,n,n,n,1)
+# trivariate transform with a(n1,n2,n3), b(n1,n2,n3):
+# ffts(a,b,n1*n2*n3,n1,n1,1)
+# ffts(a,b,n1*n2*n3,n2,n1*n2,1)
+# ffts(a,b,n1*n2*n3,n3,n1*n2*n3,1)
+# the data can alternatively be stored in a single vector c
+# alternating real and imaginary parts. the magnitude of isn changed
+# to two to give correct indexing increment, and a[0:] and a[1:] used
+# for a and b