#include <fft.hpp>
Public Member Functions | |
| FftT ()=default | |
| FftT (const FftT &)=delete | |
| FftT & | operator= (const FftT &)=delete |
| FftT (FftT &&other) noexcept | |
| FftT & | operator= (FftT &&other) noexcept |
| FftT (int size) | |
| ~FftT () | |
| int | size () const |
| bool | ready () const noexcept |
| True when every backend resource required by forward()/inverse() is available. | |
| int | vdsp_split_plane_gap_floats (bool real_transform) const noexcept |
| Floats between the end of the real half and the start of the imaginary half the vDSP transforms use (64 for every ready float transform; see the placement note on the split storage), or -1 when this transform does not use vDSP. | |
| int | vdsp_split_offset_bytes (bool real_transform) const noexcept |
| Byte offset past a 64-byte boundary of the real and imaginary halves the vDSP transforms use, or -1 when this transform does not use vDSP. | |
| void | forward (std::complex< SampleType > *data) const |
| void | inverse (std::complex< SampleType > *data) const |
| void | forward_real (const SampleType *input, std::complex< SampleType > *output) const |
| int | real_bins () const |
| Independent bins of a real transform of size(): DC through Nyquist. | |
| void | forward_real_half (const SampleType *input, std::complex< SampleType > *output, SampleType scale) const |
| Real-input forward transform. | |
| void | forward_real_half (const SampleType *input, std::complex< SampleType > *output) const |
| void | inverse_real_half (const std::complex< SampleType > *input, SampleType *output, SampleType scale) const |
| Inverse of forward_real_half(). | |
| void | inverse_real_half (const std::complex< SampleType > *input, SampleType *output) const |
| void | magnitude_db (const std::complex< SampleType > *freq, SampleType *out, int num_bins) const |
| void | magnitude (const std::complex< SampleType > *freq, SampleType *out, int num_bins) const |
Static Public Attributes | |
| static constexpr int | kMinRealSize = 2 |
| Smallest size() forward_real_half() / inverse_real_half() accept. | |
Friends | |
| struct | detail::FftRealSplit |
|
default |
|
delete |
|
inlinenoexcept |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Real-input forward transform.
Reads size() real samples and writes real_bins() bins, X[k] = scale * sum_n x[n] e^(-2 pi i k n / N) for k = 0..N/2. DC and Nyquist are written with zero imaginary part and nothing past the Nyquist bin is touched. output must not overlap input. Requires size() >= kMinRealSize. The two-argument overload uses scale 1.
|
inline |
|
inline |
|
inline |
Inverse of forward_real_half().
Reads real_bins() bins (the imaginary parts of DC and Nyquist are ignored, as a real signal cannot carry them) and writes size() real samples equal to scale times the unnormalised inverse DFT of the Hermitian spectrum they define; the default scale 1/N recovers the forward transform's input. output may occupy the same storage as input (a complex buffer reinterpreted as real samples), which lets a caller transform a spectrum in place. Requires size() >= kMinRealSize. The two-argument overload uses scale 1/N.
|
inline |
|
inline |
|
delete |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
True when every backend resource required by forward()/inverse() is available.
Construction can produce a non-ready float FFT if Apple's vDSP setup allocation returns null without throwing.
|
inline |
Independent bins of a real transform of size(): DC through Nyquist.
|
inline |
|
inlinenodiscardnoexcept |
Byte offset past a 64-byte boundary of the real and imaginary halves the vDSP transforms use, or -1 when this transform does not use vDSP.
Always 16 for a ready float transform of 32 points or more (see the placement note on the split storage); exposed so that contract can be tested rather than assumed.
|
inlinenodiscardnoexcept |
Floats between the end of the real half and the start of the imaginary half the vDSP transforms use (64 for every ready float transform; see the placement note on the split storage), or -1 when this transform does not use vDSP.
|
friend |
|
staticconstexpr |
Smallest size() forward_real_half() / inverse_real_half() accept.