Audacity 3.2.0
FourierTransform_pffft.h
Go to the documentation of this file.
1// FFT wrapper for the PFFFT library. It is possible to use different wrappers for
2// other FFT libraries or platforms, as long as the CSS complex data format is used.
3
4#pragma once
5
6#include <stdint.h>
7
8#include "SamplesFloat.h"
9
10struct PFFFT_Setup;
11
12namespace staffpad::audio {
13
15{
16public:
17 FourierTransform(int32_t newBlockSize);
19
20 int getSize() const { return static_cast<int>(_blockSize); }
21
22 void forwardReal(const SamplesReal& t, SamplesComplex& c);
23 void inverseReal(const SamplesComplex& c, SamplesReal& t);
24
25private:
26 PFFFT_Setup* realFftSpec = nullptr;
27 PFFFT_Setup* complexFftSpec = nullptr;
28 float* _pffft_scratch = nullptr;
29
30 const int32_t _blockSize;
31 int32_t _order = 0;
32};
33
34} // namespace staffpad::audio
void forwardReal(const SamplesReal &t, SamplesComplex &c)
void inverseReal(const SamplesComplex &c, SamplesReal &t)