MCPcopy Create free account
hub / github.com/algorithm-archivists/algorithm-archive / dft

Function dft

contents/cooley_tukey/code/c/fft.c:25–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void dft(double complex *X, const size_t N) {
26 double complex tmp[N];
27 for (size_t i = 0; i < N; ++i) {
28 tmp[i] = 0;
29 for (size_t j = 0; j < N; ++j) {
30 tmp[i] += X[j] * cexp(-2.0 * M_PI * I * (double)j * (double)i / (double)N);
31 }
32 }
33
34 memcpy(X, tmp, N * sizeof(*X));
35}
36
37void cooley_tukey(double complex *X, const size_t N) {
38 if (N >= 2) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected