#include <kissfft.hh>
Public Types | |
typedef std::complex< scalar_t > | cpx_t |
Public Member Functions | |
void | assign (const std::size_t nfft, const bool inverse) |
kissfft (const std::size_t nfft, const bool inverse) | |
void | transform (const cpx_t *fft_in, cpx_t *fft_out, const std::size_t stage=0, const std::size_t fstride=1, const std::size_t in_stride=1) const |
void | transform_real (const scalar_t *const src, cpx_t *const dst) const |
Private Member Functions | |
void | kf_bfly2 (cpx_t *Fout, const size_t fstride, const std::size_t m) const |
void | kf_bfly3 (cpx_t *Fout, const std::size_t fstride, const std::size_t m) const |
void | kf_bfly4 (cpx_t *const Fout, const std::size_t fstride, const std::size_t m) const |
void | kf_bfly5 (cpx_t *const Fout, const std::size_t fstride, const std::size_t m) const |
void | kf_bfly_generic (cpx_t *const Fout, const size_t fstride, const std::size_t m, const std::size_t p) const |
Private Attributes | |
bool | _inverse |
std::size_t | _nfft |
std::vector< cpx_t > | _scratchbuf |
std::vector< std::size_t > | _stageRadix |
std::vector< std::size_t > | _stageRemainder |
std::vector< cpx_t > | _twiddles |
Definition at line 17 of file kissfft.hh.
Definition at line 21 of file kissfft.hh.
|
inline |
Definition at line 23 of file kissfft.hh.
|
inline |
Changes the FFT-length and/or the transform direction.
kissfft
object will be in the same state as if it had been newly constructed with the passed arguments. However, the implementation may be faster than constructing a new fft object. Definition at line 61 of file kissfft.hh.
|
inlineprivate |
Definition at line 193 of file kissfft.hh.
|
inlineprivate |
Definition at line 202 of file kissfft.hh.
|
inlineprivate |
Definition at line 233 of file kissfft.hh.
|
inlineprivate |
Definition at line 256 of file kissfft.hh.
|
inlineprivate |
Definition at line 321 of file kissfft.hh.
|
inline |
Calculates the complex Discrete Fourier Transform.
The size of the passed arrays must be passed in the constructor. The sum of the squares of the absolute values in the dst
array will be N
times the sum of the squares of the absolute values in the src
array, where N
is the size of the array. In other words, the l_2 norm of the resulting array will be sqrt(N)
times as big as the l_2 norm of the input array. This is also the case when the inverse flag is set in the constructor. Hence when applying the same transform twice, but with the inverse flag changed the second time, then the result will be equal to the original input times N
.
Definition at line 90 of file kissfft.hh.
|
inline |
Calculates the Discrete Fourier Transform (DFT) of a real input of size 2*N
.
The 0-th and N-th value of the DFT are real numbers. These are stored in dst
[0].real() and dst
[0].imag() respectively. The remaining DFT values up to the index N-1 are stored in dst
[1] to dst
[N-1]. The other half of the DFT values can be calculated from the symmetry relation
The same scaling factors as in transform()
apply.
scalar_t
and cpx_t
must fulfill the following requirements:For any object z
of type cpx_t
, reinterpret_cast<scalar_t(&)[2]>(z)
[0] is the real part of z
and reinterpret_cast<scalar_t(&)[2]>(z)
[1] is the imaginary part of z
. For any pointer to an element of an array of cpx_t
named p
and any valid array index i
, reinterpret_cast<T*>(p)
[2*i] is the real part of the complex number p
[i], and reinterpret_cast<T*>(p)
[2*i+1] is the imaginary part of the complex number p
[i].
Since C++11, these requirements are guaranteed to be satisfied for scalar_ts
being float
, double
or long
double
together with cpx_t
being std::complex<scalar_t>
.
Definition at line 154 of file kissfft.hh.
|
private |
Definition at line 355 of file kissfft.hh.
|
private |
Definition at line 354 of file kissfft.hh.
Definition at line 359 of file kissfft.hh.
|
private |
Definition at line 357 of file kissfft.hh.
|
private |
Definition at line 358 of file kissfft.hh.
Definition at line 356 of file kissfft.hh.