MCPcopy Create free account
hub / github.com/LabSound/LabSound / FFTFrame

Method FFTFrame

src/internal/src/FFTFrameKissFFT.cpp:22–41  ·  view source on GitHub ↗

Normal constructor: allocates for a given fftSize.

Source from the content-addressed store, hash-verified

20
21// Normal constructor: allocates for a given fftSize.
22FFTFrame::FFTFrame(int fftSize)
23 : m_FFTSize(fftSize), m_log2FFTSize(static_cast<int>(log2((double) fftSize)))
24 , mFFT(0), mIFFT(0), m_realData(fftSize / 2 + 1), m_imagData(fftSize / 2 + 1)
25{
26 // We only allow power of two.
27 ASSERT(1UL << m_log2FFTSize == m_FFTSize);
28
29 const int mBinSize = m_FFTSize / 2 + 1;
30
31 mFFT = kiss_fftr_alloc(m_FFTSize, 0, nullptr, nullptr);
32 mIFFT = kiss_fftr_alloc(m_FFTSize, 1, nullptr, nullptr);
33
34 m_cpxInputData = new kiss_fft_cpx[mBinSize];
35 m_cpxOutputData = new kiss_fft_cpx[mBinSize];
36
37 int nbytes = sizeof(float) * mBinSize;
38
39 memset(realData(), 0, nbytes);
40 memset(imagData(), 0, nbytes);
41}
42
43// Creates a blank/empty frame (interpolate() must later be called).
44FFTFrame::FFTFrame() : m_FFTSize(0), m_log2FFTSize(0), mFFT(0), mIFFT(0)

Callers

nothing calls this directly

Calls 2

realDataMethod · 0.45
imagDataMethod · 0.45

Tested by

no test coverage detected