kiss_fft_v1_2_5

所属分类:数学计算
开发工具:C/C++
文件大小:50KB
下载次数:135
上传日期:2006-08-01 20:45:35
上 传 者凝晖幽
说明:  FFT的源代码,C语音,比其他的FFT代码更加效率高和质量好.
(FFT source code, C voice, other than the FFT code more efficient and better quality.)

文件列表:
kiss_fft_v1_2_5 (0, 2006-07-02)
kiss_fft_v1_2_5\CHANGELOG (4256, 2006-06-28)
kiss_fft_v1_2_5\COPYING (1475, 2004-04-05)
kiss_fft_v1_2_5\kiss_fft.c (11972, 2006-06-28)
kiss_fft_v1_2_5\kiss_fft.h (3125, 2006-06-28)
kiss_fft_v1_2_5\Makefile (1291, 2006-06-28)
kiss_fft_v1_2_5\test (0, 2006-06-28)
kiss_fft_v1_2_5\test\benchfftw.c (1936, 2005-11-04)
kiss_fft_v1_2_5\test\benchkiss.c (1880, 2006-06-28)
kiss_fft_v1_2_5\test\compfft.py (2190, 2004-02-09)
kiss_fft_v1_2_5\test\doit.c (4283, 2004-02-27)
kiss_fft_v1_2_5\test\fastfir.py (2617, 2004-02-26)
kiss_fft_v1_2_5\test\fft.py (4797, 2005-06-24)
kiss_fft_v1_2_5\test\Makefile (2634, 2006-06-01)
kiss_fft_v1_2_5\test\mk_test.py (3012, 2004-04-03)
kiss_fft_v1_2_5\test\pstats.c (1066, 2004-02-26)
kiss_fft_v1_2_5\test\pstats.h (94, 2004-02-26)
kiss_fft_v1_2_5\test\tailscrap.m (653, 2004-02-02)
kiss_fft_v1_2_5\test\testkiss.py (3593, 2006-03-14)
kiss_fft_v1_2_5\test\test_real.c (4592, 2005-12-26)
kiss_fft_v1_2_5\test\test_vs_dft.c (1677, 2004-09-14)
kiss_fft_v1_2_5\test\twotonetest.c (2540, 2005-07-09)
kiss_fft_v1_2_5\TIPS (1883, 2005-07-09)
kiss_fft_v1_2_5\tools (0, 2006-06-28)
kiss_fft_v1_2_5\tools\fftutil.c (5340, 2004-04-05)
kiss_fft_v1_2_5\tools\kfc.c (3471, 2005-06-25)
kiss_fft_v1_2_5\tools\kfc.h (1262, 2004-02-27)
kiss_fft_v1_2_5\tools\kiss_fastfir.c (13647, 2005-06-24)
kiss_fft_v1_2_5\tools\kiss_fftnd.c (6978, 2006-06-28)
kiss_fft_v1_2_5\tools\kiss_fftnd.h (378, 2005-05-31)
kiss_fft_v1_2_5\tools\kiss_fftr.c (5931, 2005-12-26)
kiss_fft_v1_2_5\tools\kiss_fftr.h (858, 2004-04-05)
kiss_fft_v1_2_5\tools\Makefile (1508, 2005-10-07)
kiss_fft_v1_2_5\tools\psdpng.c (7149, 2005-12-26)
kiss_fft_v1_2_5\_kiss_fft_guts.h (5260, 2005-10-07)

KISS FFT - A mixed-radix Fast Fourier Transform based up on the principle, "Keep It Simple, Stupid." There are many great fft libraries already around. Kiss FFT is not trying to be better than any of them. It only attempts to be a reasonably efficient, moderately useful FFT that can use fixed or floating data types and can be incorporated into someone's C program in a few minutes with trivial licensing. USAGE: The basic usage for 1-d complex FFT is: #include "kiss_fft.h" kiss_fft_cfg cfg = kiss_fft_alloc( nfft ,is_inverse_fft ,0,0 ); while ... ... // put kth sample in cx_in[k].r and cx_in[k].i kiss_fft( cfg , cx_in , cx_out ); ... // transformed. DC is in cx_out[0].r and cx_out[0].i free(cfg); Note: frequency-domain data is stored from dc up to 2pi. so cx_out[0] is the dc bin of the FFT and cx_out[nfft/2] is the Nyquist bin (if exists) Declarations are in "kiss_fft.h", along with a brief description of the functions you'll need to use. Code definitions for 1d complex FFTs are in kiss_fft.c. You can do other cool stuff with the extras you'll find in tools/ * arbitrary dimension complex FFTs * 1-d real FFTs * fast convolution FIR filtering * spectrum image creation The core fft and most tools/ code can be compiled to use float, double or Q15 short samples. The default is float. BACKGROUND: I started coding this because I couldn't find a fixed point FFT that didn't use assembly code. I started with floating point numbers so I could get the theory straight before working on fixed point issues. In the end, I had a little bit of code that could be recompiled easily to do ffts with short, float or double (other types should be easy too). Once I got my FFT working, I was curious about the speed compared to a well respected and highly optimized fft library. I don't want to criticize this great library, so let's call it FFT_BRANDX. During this process, I learned: 1. FFT_BRANDX has more than 100K lines of code. The core of kiss_fft is about 500 lines (cpx 1-d). 2. It took me an embarrassingly long time to get FFT_BRANDX working. 3. A simple program using FFT_BRANDX is 522KB. A similar program using kiss_fft is 18KB. 4. FFT_BRANDX is roughly twice as fast as KISS FFT in default mode. It is wonderful that free, highly optimized libraries like FFT_BRANDX exist. But such libraries carry a huge burden of complexity necessary to extract every last bit of performance. Sometimes simpler is better, even if it's not better. FREQUENTLY ASKED QUESTIONS: Q: Can I use kissfft in a project with a ___ license? A: Yes. See LICENSE below. Q: Why don't I get the output I expect? A: The two most common causes of this are 1) scaling : is there a constant multiplier between what you got and what you want? 2) mixed build environment -- all code must be compiled with same preprocessor definitions for DATATYPE & FIXED_POINT PERFORMANCE: (on Athlon XP 2100+, with gcc 2.96, float data type) Kiss performed 10000 1024-pt cpx ffts in .63 s of cpu time. For comparison, it took md5sum twice as long to process the same amount of data. Transforming 5 minutes of CD quality audio takes less than a second (nfft=1024). DO NOT: ... use Kiss if you need the Fastest Fourier Transform in the World ... ask me to add features that will bloat the code UNDER THE HOOD: Kiss FFT uses a time decimation, mixed-radix, out-of-place FFT. No scaling is done for the floating point version (for speed). Scaling is done both ways for the fixed-point version (for overflow prevention). Optimized butterflies are used for factors 2,3,4, and 5. The real optimization code only works for even length ffts. It does two half-length FFTs in parallel (packed into real&imag), and then combines them via twiddling. The fast convolution filtering uses the overlap-scrap method, slightly modified to put the scrap at the tail. LICENSE: Revised BSD License, see COPYING for verbiage. Basically, "free to use&change, give credit where due, no guarantees" Note this license is compatible with GPL at one end of the spectrum and closed, commercial software at the other end. See http://www.fsf.org/licensing/licenses TODO: *) Add real optimization for odd length FFTs (DST?) *) Add real optimization to the n-dimensional FFT *) Document/revisit the input/output fft scaling *) Make doc describing the overlap (tail) scrap fast convolution filtering in kiss_fastfir.c *) Test all the ./tools/ code with fixed point (kiss_fastfir.c doesn't work, maybe others) AUTHOR: Mark Borgerding Mark@Borgerding.net

近期下载者

相关文件


收藏者