diff options
| author | bhgv <bhgv.empire@gmail.com> | 2018-03-01 16:54:45 +0200 |
|---|---|---|
| committer | bhgv <bhgv.empire@gmail.com> | 2018-03-01 16:54:45 +0200 |
| commit | b786f20bbab5a59046aa78a2c6c2a11536497202 (patch) | |
| tree | 0851ecdec889eb9b7ba3751cc04d4f0b474e4a9e /module/ffts.m | |
inferno-os tree was separated from the inferno-os-android (separated from the Android driver)
Diffstat (limited to 'module/ffts.m')
| -rw-r--r-- | module/ffts.m | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/module/ffts.m b/module/ffts.m new file mode 100644 index 0000000..67b5560 --- /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 |
