optimointeja ja vanha fft takas

This commit is contained in:
2025-08-01 14:37:45 +03:00
parent 1d8d47b374
commit 266e4bd85d
4 changed files with 100 additions and 64 deletions

View File

@ -3,16 +3,6 @@
#include <math.h>
#define FFT_SIZE 2048
// Simple complex number struct
struct Complex {
float re, im;
Complex(float r = 0, float i = 0) : re(r), im(i) {}
Complex operator+(const Complex& o) const { return { re + o.re, im + o.im }; }
Complex operator-(const Complex& o) const { return { re - o.re, im - o.im }; }
Complex operator*(const Complex& o) const {
return { re * o.re - im * o.im, re * o.im + im * o.re };
}
};
void fft(Complex* x, int N, Complex* buffer);
void init_hamming_window();
void compute_fft(float* time_data, float* freq_out);