Low-level transform support module #include "diplib/dft.h"
Low-level functionality for computing the Discrete Fourier Transform.
Classes
Aliases
-
using dip::
Option:: DFTOptions = dip::detail::Options - Determines working mode for
dip::DFTanddip::RDFT. Combines multipledip::Option::DFTOptionvalues,.
Enums
-
enum class dip::
Option:: DFTOption: uint8 - Determines working mode for
dip::DFTanddip::RDFT. more...
Functions
-
auto dip::
GetOptimalDFTSize(dip::uint size0, bool larger = true, dip::uint maxFactor = 5) -> dip::uint - Returns a size equal or larger to
size0that is efficient for the DFT implementation. The value returned is a product of small primes. more... -
auto dip::
MaxFactor(bool complex = true) -> dip::uint - The
maxFactorparameter fordip::GetOptimalDFTSize.complexdetermines whether the transform to be computed is complex-to-complex or not.
Variables
-
dip::uint const dip::
maximumDFTSize - The largest size supported by
dip::DFTanddip::FourierTransform. Is equal to 231-1 when using FFTW, 264-1 when using PocketFFT on a 64-bit system, or 232-1 when using PocketFFT on a 32-bit system. -
bool const dip::
usingFFTW - Is
trueifdip::DFTanddip::RDFTuse the FFTW library, or false if they use PocketFFT.
Alias documentation
using dip:: Option:: DFTOptions = dip::detail::Options
Determines working mode for dip::DFT and dip::RDFT. Combines multiple dip::Option::DFTOption values,.
Enum documentation
enum class dip:: Option:: DFTOption: uint8
Determines working mode for dip::DFT and dip::RDFT.
Implicitly casts to dip::Option::DFTOptions. Combine constants together with the + operator.
| Enumerators | |
|---|---|
| InPlace = 0 | Work in place, the input and output buffers are the same. |
| TrashInput = 1 | Allowed to trash the input buffer, we don’t need to preserve it. |
| Aligned = 2 | Both buffers are aligned to 16-byte boundaries. |
Function documentation
dip::uint
dip:: GetOptimalDFTSize(
dip::uint size0, bool larger = true, dip::uint maxFactor = 5)
Returns a size equal or larger to size0 that is efficient for the DFT implementation.
The value returned is a product of small primes.
Set larger to false to return a size equal or smaller instead.
maxFactor should be 5, 7 or 11, and gives the largest integer that should be considered a “small prime”.
When using FFTW, set maxFactor to 7, as by default it works most efficiently for sizes that can be factored
into primes smaller or equal to 7. When using PocketFFT, set it to 5 for complex-to-real or real-to-complex
transforms, and to 11 for complex-to-complex transforms. See dip::MaxFactor.
If there is no suitable size that the implementation can use (see dip::maximumDFTSize), this function
will return 0.
Prefer to use dip::OptimalFourierTransformSize in your applications, it will throw an error if
the transform size is too large, and determines maxFactor for you.
dip::uint
dip:: MaxFactor(
bool complex = true)
The maxFactor parameter for dip::GetOptimalDFTSize. complex determines whether the transform to
be computed is complex-to-complex or not.
Variable documentation
dip::uint const dip:: maximumDFTSize
The largest size supported by dip::DFT and dip::FourierTransform. Is equal to 231-1 when using FFTW,
264-1 when using PocketFFT on a 64-bit system, or 232-1 when using PocketFFT on a 32-bit system.
bool const dip:: usingFFTW
Is true if dip::DFT and dip::RDFT use the FFTW library, or false if they use PocketFFT.