package fftw3
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=6e3e5931eda0f66c2bf9cac2f40bf9d563fbf04adbaccb26278a7bf598537684
sha512=9e8684c9fb2327f7a18e04b7de770ada7cbac18eb03db37b3a974ff5968b6327f7b91aa489db5f70beac6757acea88d3e04c25e35380345ec3d33a0942b27450
doc/fftw3/Fftw3/index.html
Module Fftw3
Source
Interface for FFTW version 3.
We advise against opening this module as it contains submodules with the same names as the Bigarray
ones. Instead, declare
module FFT = Fftw3.D
or
module FFT = Fftw3.S
depending to the precision you need (this way of proceeding makes it easy to change the precision of the FFT sould it be necessary) and then use it as
let input = FFT.Array1.create FFT.complex Bigarray.c_layout dim in
let output = FFT.Array1.create FFT.complex Bigarray.c_layout dim in
let dft = FFT.Array1.dft FFT.Forward input output in
(* code to initialize input and output arrays here *)
FFT.exec dft (* compute the DFT *)
The plan creation function will raise FFT.Failure
in case of problems. The last line can be repeated as many times as needed to compute the FFT of input
into output
. Beware that creating the plan (FFT.Array1.dft
) usually destroys the content of input
and output
, so only fill them afterwards.
HINT: Plan creation functions like Fftw3.Sig.Array1.dft
have many optional arguments for maximum flexibility. The important one is ~meas
. The other ones can be ignored at first.
Thread safety
If you use Async or Lwt, please read the https://www.fftw.org/fftw3_doc/Thread-safety.html
read safety guidelines
}
}
of FFTW. If you encounter problems, please let us know
.
module D :
Sig
with type float_elt = Bigarray.float64_elt
and type complex_elt = Bigarray.complex64_elt
Double precision FFTW.
module S :
Sig
with type float_elt = Bigarray.float32_elt
and type complex_elt = Bigarray.complex32_elt
Single precision FFTW. This is only available if the single precision FFTW3 library was found when this module was compiled (if not, all functions raise Failure
).