fft-small
fft-small copied to clipboard
Different results between fft & fft_slow
Hey Brendan ! Thx for opensourcing this amazing implementation!
I'm learning FFT and trying to find some C implementations then I found yours!
I generated a 50Hz sine wave(y=2sin(2pi50t)(under 1200hz sample rate and I sampled the first period of 0~0.02s signals) and tried radix2 on the first try. I changed the FFT input of int* x to double* x to fit my float inputs.
But the calculated modulus doesn't come as expected. While I'm confused I tried fft_slow then it's 100% accurate.
fft radix2:
fft_slow:
I don't know if I'm coding it wrong...Appreciate any help!
Here's my code(Based on 'test.c'.) https://gist.github.com/2ndMessiah/03f875c8fba6f790cdefebb187c37c9e