3 #include "ProgramVector.h"
4 #include "ServiceCall.h"
16 ASSERT(len==32 || len ==64 || len==128 || len==256 || len==512 || len==1024 || len==2048 || len==4096,
"Unsupported FFT size");
17 void* args[] = {(
void*)&instance, (
void*)&len};
18 int ret = getProgramVector()->serviceCall(OWL_SERVICE_ARM_RFFT_FAST_INIT_F32, args, 2);
19 ASSERT(ret == OWL_SERVICE_OK,
"FFT init failed");
27 arm_rfft_fast_f32(&instance, (
float*)in.
getData(), (
float*)out.
getData(), 0);
33 arm_rfft_fast_f32(&instance, (
float*)in.
getData(), (
float*)out.
getData(), 1);
37 return instance.fftLenRFFT;
55 ASSERT(aSize==32 || aSize ==64 || aSize==128 || aSize==256 || aSize==512 || aSize==1024 || aSize==2048 || aSize==4096,
"Unsupported FFT size");
56 cfgfft = kiss_fft_alloc(aSize, 0 , 0, 0);
57 cfgifft = kiss_fft_alloc(aSize, 1,0, 0);
64 for(
size_t n=0; n<
getSize(); n++){
68 kiss_fft(cfgfft, (kiss_fft_cpx*)(
float*)temp.
getData(), (kiss_fft_cpx*)(
float*)output.
getData());
74 kiss_fft(cfgifft, (kiss_fft_cpx*)(
float*)input.
getData(), (kiss_fft_cpx*)(
float*)temp.
getData());
76 for(
size_t n=0; n<
getSize(); n++){
77 output[n]=temp[n].
re*scale;
float im(const int i)
Get the imaginary part of an element of the array.
static void destroy(ComplexFloatArray)
Destroys a ComplexFloatArray created with the create() method.
static ComplexFloatArray create(size_t size)
Creates a new ComplexFloatArray.
float re(const int i)
Get the real part of an element of the array.
This class contains useful methods for manipulating arrays of floats.
T * getData()
Get the data stored in the Array.
#define ASSERT(cond, msg)