I'm writing a Win32 application, using just C++ and WinApi calls. I need to run an 8192-point FFT over 20ms of WAVEFORMATEX data. What would be the most e开发者_如何学Cfficient method of accomplishing this?
It's been a long time, but I recall this code library as being very fast and easy to compile:
http://fftw.org/
As we fleshed out in the comments, the MSDN Documentation for XDSP functions may be of relevance to you.
The functions don't appear to take WAVEFORMATEX
directly, but if you can convert it to the appropriate format you can use FFT
to do what you want.
Note that it's part of the DirectX SDK, so you're introducing a new dependency.
KISSFFT is not a windows api, per se. However it is small enough to embed nicely in any project -- about 30kb of ANSI C sourcecode for the basic complex-to-complex transform. Unlike other super-tiny FFT libraries, it is fast, featureful, accurate, and can be used in a multi-threaded program.
One of the key features is that KISSFFT can do mixed radix (multiples of 2,3,5 are fastest). Other "bolt-on" features are available in the tools directory. Use only the pieces you need for: multi-dimensional transforms, real-optimized transforms (i.e. half spectrum), fast convolution, etc
The speed is generally fast enough for most applications -- not quite as fast as fftw or vendor libraries, but faster than the builk of the remainder.
KISSFFT's accuracy is as good as any FFT library out there.
The license is 3 clause BSD which can legally be used inside a commercial app at one end of the spectrum or a GPL app at the other end. It just requires a simple attribution in the docs.
精彩评论