A simple wrapper for FFTW, using Guile's FFI.

lloda 90d5da6583 Have fftw-dft! return the output array пре 3 година
mod 90d5da6583 Have fftw-dft! return the output array пре 3 година
test 90d5da6583 Have fftw-dft! return the output array пре 3 година
LICENSE 95d7ffb558 Add license пре 5 година
README.md 95d7ffb558 Add license пре 5 година

README.md

guile-ffi-fftw

This is a minimal set of Guile FFI bindings for FFTW's ‘guru interface’, www.fftw.org/fftw3_doc/Guru-Interface.html#Guru-Interface

It provides two functions:

  • fftw-dft! rank sign in out
  • fftw-dft rank sign in

These bindings being minimal, there is no support for computing & reusing plans, or split r/i transforms, or anything other than straight complex DFTs. Contributions are welcome!

I think the bindings provide a good example of how to interface from Guile with array libraries taking dense arrays as arguments. FFTW is nice in this respect, because it supports arbitrary strides —which should be the norm really!

There is another set of bindings by Mikael Djurfeldt,

https://savannah.gnu.org/projects/guile-fftw

But it only does up to 2D DFTs and is particular about array strides (based on my reading of the code), while fftw-dft! and fftw-dft do DFTs of any rank and place no restriction on strides. This comes through no effort on my part; it is a feature of FFTW's. Also guile-ffi-fftw uses the FFI, while guile-fftw uses a C extension, which you need to build, etc.

Running the tests

The tests use SRFI-64.

$GUILE -L mod -s test/test-ffi-fftw.scm