#include <Tpffft.hpp>
|
using | uchar = unsigned char |
|
using | uint = unsigned int |
|
Definition at line 20 of file Tpffft.hpp.
◆ uchar
◆ uint
◆ FFTpffft()
tklb::FFTpffft::FFTpffft |
( |
uint |
size = 0 | ) |
|
|
inline |
Definition at line 30 of file Tpffft.hpp.
31 if (size == 0) {
return; }
◆ ~FFTpffft()
tklb::FFTpffft::~FFTpffft |
( |
| ) |
|
|
inline |
◆ back()
Frequency domain back to time domain.
- Parameters
-
input | Buffer with 2 channels. channel 0 for real and 1 for imaginary |
result | Single channel output buffer. Needs to be twice the size of the imput buffer |
Definition at line 89 of file Tpffft.hpp.
92 while (processed < input.validSize()) {
94 const uint processedHalf = processed / 2;
95 mRc.
set(input[0] + processedHalf, sizeHalf);
96 mRc.
set(input[1] + processedHalf, sizeHalf, sizeHalf);
97 const T volume = 1.0 / double(
mSize);
98 if (std::is_same<T, float>::value) {
99 float* out =
reinterpret_cast<float*
>(result[0]) + processed;
100 pffft_transform_ordered(
mSetup,
mRc[0], out,
nullptr, PFFFT_BACKWARD);
101 result.multiply(volume);
103 pffft_transform_ordered(
mSetup,
mRc[0],
mBuffer[0],
nullptr, PFFFT_BACKWARD);
105 T* out = result[0] + processed;
107 out[i] = buf[i] * volume;
#define TKLB_ASSERT(condition)
Wrap assertions.
void set(const T2 *samples, Size length, const uchar channel=0, const Size offsetDst=0)
Set a single channel from an array.
◆ forward()
timedomain to frequency domain
- Parameters
-
input | Input buffer, validSize needs to be a multiple of 2 |
output | Output buffer, must have 2 channel for real and imaginary. Half the length of thie input buffer |
Definition at line 56 of file Tpffft.hpp.
59 while (processed < input.validSize()) {
60 const float* data =
nullptr;
61 if (std::is_same<T, float>::value) {
62 data =
reinterpret_cast<const float*
>(input[0] + processed);
68 pffft_transform_ordered(
mSetup, data,
mRc[0],
nullptr, PFFFT_FORWARD);
75 result.set(
mRc[0],
mSize, processed);
◆ resize()
void tklb::FFTpffft::resize |
( |
uint |
size | ) |
|
|
inline |
Definition at line 40 of file Tpffft.hpp.
42 pffft_destroy_setup(
mSetup);
44 mSetup = pffft_new_setup(size, PFFFT_REAL);
bool resize(const Size length, uchar channels)
! Will not keep the contents! Resizes the buffer to the desired length and channel count.
◆ mBuffer
◆ mRc
◆ mSetup
PFFFT_Setup* tklb::FFTpffft::mSetup = nullptr |
|
private |
◆ mSize
uint tklb::FFTpffft::mSize |
|
private |
The documentation for this class was generated from the following file: