View source code Display the source code in std/numeric.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

std.numeric.fft - multiple declarations

Function fft

Convenience functions that create an Fft object, run the FFT or inverse FFT and return the result. Useful for one-off FFTs.

Prototypes

Complex!F[] fft(F, R)(
  R range
);

void fft(Ret, R)(
  R range,
  Ret buf
);

Note

In addition to convenience, these functions are slightly more efficient than manually creating an Fft object for a single use, as the Fft object is deterministically destroyed before these functions return.

Class Fft

A class for performing fast Fourier transforms of power of two sizes. This class encapsulates a large amount of state that is reusable when performing multiple FFTs of sizes smaller than or equal to that specified in the constructor. This results in substantial speedups when performing multiple FFTs with a known maximum size. However, a free function API is provided for convenience if you need to perform a one-off FFT.

Inherits from

Constructors

Name Description
this Create an Fft object for computing fast Fourier transforms of power of two sizes of size or smaller. size must be a power of two.

Methods

Name Description
fft Compute the Fourier transform of range using the Ο(N log N) Cooley-Tukey Algorithm. range must be a random-access range with slicing and a length equal to size as provided at the construction of this object. The contents of range can be either numeric types, which will be interpreted as pure real values, or complex types with properties or members .re and .im that can be read.
fft Same as the overload, but allows for the results to be stored in a user- provided buffer. The buffer must be of the same length as range, must be a random-access range, must have slicing, and must contain elements that are complex-like. This means that they must have a .re and a .im member or property that can be both read and written and are floating point numbers.
inverseFft Computes the inverse Fourier transform of a range. The range must be a random access range with slicing, have a length equal to the size provided at construction of this object, and contain elements that are either of type std.complex.Complex or have essentially the same compile-time interface.
inverseFft Inverse FFT that allows a user-supplied buffer to be provided. The buffer must be a random access range with slicing, and its elements must be some complex-like type.
factory Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor.
opCmp Compare with another Object obj.
opEquals Returns !=0 if this object does have the same contents as obj.
toHash Compute hash function for Object.
toString Convert Object to a human readable string.

References

Authors

Andrei Alexandrescu, Don Clugston, Robert Jacques

License

Boost License 1.0.

Comments