Using Goertzel algorithm I am detecting a certain frequency that goes into the iphone microphone (I use buffer samples).
Its working, but it has many strange stability problems when values are changed. (they are constant at a spectrum app on same device,but not with Goertzel algorithm )
I would like to use another way, in C , to detect a certain frequency, or the energy in a range of frequencies, (I don't know if FFT is good and accurate, if yes I need a good algorithm).
If you have a function that ONLY gets samples and length and return energy at a spectrum of frequencies, or at a certain known frequency, that can help.
I need a serious one, maybe a second order filter.
As you're developing on MacOSX or iOS, check out the Accelerate Framework which provides portable [within iOS and MacOSX] and optimised implementation of the DFT.
If you intend to release your work as an app in AppStore, you should pay particular attention to licensing. Is FFTW license compatible with your usage?
It includes vDSP and several FFT routines including the categories:
1D Fast Fourier Transforms (Fixed Length)
1D Fast Fourier Transforms (In-Place Complex)
1D Fast Fourier Transforms (In-Place Real)
1D Fast Fourier Transforms (Out-of-Place Complex)
1D Fast Fourier Transforms (Out-of-Place Real)
1D Fast Fourier Transforms (Support Functions)
2D Fast Fourier Transforms (In-Place Complex)
2D Fast Fourier Transforms (In-Place Real)
2D Fast Fourier Transforms (Out-of-Place Complex)
2D Fast Fourier Transforms (Out-of-Place Real)
Discrete Fourier Transforms
The Accelerate Framework is all to often overlooked.