Does anyone know any
FFT algorithm that can be implemented in C?
I am trying to convert a built-in matlab FFT api to a function in C.
Appreciate any help!
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It only takes a minute to sign up.Sign up to join this community
I just did exactly what you are asking for a few weeks ago. Try the Matlab coder. It turns your scripts into C funtions. This is what i did, maybe you can try it and see if it works for you:
1 - Make a simple function in matlab like this
function [y] = myfft(x)
y = fft(x,2^nextpow2(length(x)));
end 2 - Run the matlab coder.
3 - Set the input values to double and sizes of the inputs and outputs (You can read a little bit of the help for this, it is easy to understand).
4 - Build a static library based on this code
The result was that matlab created a few source and header files with initialization code, as well as a function with the actual algorithm, i think it used a global variable for the twiddle factors in the Cooley-Tukey algorithm and then just performed the radix-2 computations. So i ended up with the complete source code as well as the compiled myfft.so binary to include in any desired project.
Try it out, maybe you'll need to do some configurations, i use linux so i guess it was implied for matlab that the compiler would be gcc.
Hope it helps,