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

Method computeInverseFFT

src/internal/src/FFTFrameKissFFT.cpp:105–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void FFTFrame::computeInverseFFT(float * data)
106{
107 const uint32_t inputSize = m_FFTSize / 2 + 1;
108
109 for (uint32_t i = 0; i < inputSize; ++i)
110 {
111 m_cpxInputData[i].r = m_realData.data()[i];
112 m_cpxInputData[i].i = m_imagData.data()[i];
113 }
114
115 // Inverse-transform the (inputSize) points of data in each
116 // of (m_cpxInputData.r) and (m_cpxInputData.i)
117 float * outData = reinterpret_cast<float *>(m_cpxOutputData); // .r + .i
118 kiss_fftri(mIFFT, m_cpxInputData, outData);
119
120 // Scale so that a forward then inverse FFT yields exactly the original data and
121 // store the resulting (m_FFTSize) points in (data).
122 // x == IFFT(FFT(x))
123 const float scale = 1.0f / m_FFTSize;
124 VectorMath::vsmul(outData, 1, &scale, data, 1, m_FFTSize);
125}
126
127float * FFTFrame::realData() const
128{

Callers 5

processMethod · 0.45
ExtractAverageGroupDelayFunction · 0.45
createImpulseResponseMethod · 0.45

Calls 2

vsmulFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected