Michaël Van Canneyt 879bbc3de5 * Dotted filenames for package fftw 2 år sedan
..
examples 66dfc61eaa * Placed fftw_getmem and fftw_freemem in interface section 16 år sedan
namespaced 879bbc3de5 * Dotted filenames for package fftw 1 år sedan
src 879bbc3de5 * Dotted filenames for package fftw 1 år sedan
Makefile a9eee6d7e0 * Remove redundant Makefile.fpc 1 år sedan
Makefile.fpc.fpcmake 98f00acb06 * trunk to 3.3.1 7 år sedan
fpmake.pp 54fa882914 * Add namespaces.lst 1 år sedan
namespaces.lst 879bbc3de5 * Dotted filenames for package fftw 1 år sedan
readme.txt d2b1c7a65c * fftw, minor updates to xforms 17 år sedan

readme.txt

Interface unit for Fastest Fourier in the West library
------------------------------------------------------

This unit is a Pascal interface to the FFTW library version 3. FFTW is
a library to compute fast fourier transforms extremely fast, it uses
a runtime code generator to generate the best algorithm for a specific
transformation.

The unit is experimental and community involvement is welcome.

At this time we provide a single precision interface only.
Interfaces for the double and extended precision is a simpleprogramming
exercise, you can simply replace single by double everywhere.

See http://www.fftw.org for extensive documentation.

Usage:
* Compile FFTW. Use the "--enable-single" option to configure to select single
precision.
* We need libgcc. Its location should be present in your fpc.cfg. If not,
please use the tool "samplecfg" that is shipped with the compiler to
generate a new fpc.cfg.
* The compiler should be able to find libfftw3f.a. Put something like
-Fl/path/to/libfftw3f.a in your fpc.cfg

Short example how to perform a Fourier transformation in Pascal:

begin
{You can use getmem, but only fftw_getmem ensures 3DNOW/SSE
algorithms.}
fftw_getmem(i,count*sizeof(complex_single));
fftw_getmem(o,count*sizeof(complex_single));

{FFTW will now generate an algoritm to compute the FFT:}
plan:=fftw_plan_dft_1d(count,i,o,fftw_forward,[fftw_estimate]);

{Put code to fill i^ with input data here.}
fftw_execute(p); {Execute FFT}
{Output in o^}

{We can repeat, and refill i with input data.}
{Put code to fill i^ with input data here.}
fftw_execute(p); {Execute FFT}
{Output in o^}

fftw_destroy_plan(p);
fftw_freemem(i);
fftw_freemem(o);
end;

Differences with C version:
* To introduce strong typing:
** The sign (fftw_forward,fftw_backward) is an enumeration instead of an int
with constants.
** The flags ([fftw_estimate]) is a flag set instead of an int with constants.
** The fftw_plan_single type is an opaque pointer incompatible with anything
else;
* To ease programming:
** Functions for complex to complex, real to complex, and complex to real are
all called equally, the compiler will determine which one needs to be
called. So we have just fftw_plan_dft_1d instead of fftw_plan_dft_1d,
fftw_plan_dft_r2c_1d, fftw_plan_dft_c2r_1d, etc.
* fftw_getmem/fftw_freemem instead of fftw_malloc/fftw_free