MCPcopy Create free account
hub / github.com/davy7125/polyphone / FFT

Method FFT

sources/core/sample/sampleutils.cpp:347–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347Complex * SampleUtils::FFT(Complex * x, quint32 N)
348{
349 Complex* out = new Complex[N];
350 Complex* scratch = new Complex[N];
351 Complex* twiddles = new Complex [N];
352 quint32 k;
353 for (k = 0; k != N; ++k)
354 {
355 twiddles[k].real(cos(-2.0 * M_PI * k / N));
356 twiddles[k].imag(sin(-2.0 * M_PI * k / N));
357 }
358 FFT_calculate(x, N, out, scratch, twiddles);
359 delete [] twiddles;
360 delete [] scratch;
361 return out;
362}
363
364Complex * SampleUtils::IFFT(Complex * x, quint32 N)
365{

Callers

nothing calls this directly

Calls 2

realMethod · 0.80
imagMethod · 0.80

Tested by

no test coverage detected