This commit is contained in:
Mark Borgerding 2004-01-31 02:46:20 +00:00
parent 366f17e379
commit 1a5f860757
4 changed files with 50 additions and 16 deletions

View File

@ -1,4 +1,4 @@
Copyright (c) 2003, Mark Borgerding Copyright (c) 2003,4 Mark Borgerding
All rights reserved. All rights reserved.

View File

@ -1,4 +1,8 @@
KFVER=111
DISTDIR=kiss_fft_v$(KFVER)
TARBALL=kiss_fft_v$(KFVER).tar.gz
ZIPFILE=kiss_fft_v$(KFVER).zip
testall: testall:
@ -7,11 +11,21 @@ testall:
export DATATYPE=double && cd test && make test export DATATYPE=double && cd test && make test
tarball: clean tarball: clean
find | grep -i -v cvs | zip kiss_fft.zip -@ tar --exclude CVS --exclude .cvsignore --exclude $(TARBALL) -cvzf $(TARBALL) .
tar --exclude CVS --exclude .cvsignore --exclude kiss_fft.zip -cvzf kiss_fft.tar.gz .
clean: clean:
cd test && make clean cd test && make clean
cd tools && make clean cd tools && make clean
rm -f kiss_fft.tar.gz *~ *.pyc kiss_fft.zip rm -f kiss_fft*.tar.gz *~ *.pyc kiss_fft*.zip
rm -rf $(DISTDIR)
dist: tarball
mkdir $(DISTDIR)
cd $(DISTDIR) && tar -zxf ../$(TARBALL)
rm $(TARBALL)
tar -czf $(TARBALL) $(DISTDIR)
zip -r $(ZIPFILE) $(DISTDIR)
rm -rf $(DISTDIR)
upload: dist
ncftpput upload.sourceforge.net incoming $(ZIPFILE) $(TARBALL)

39
README
View File

@ -8,26 +8,40 @@ incorporated into someone's C program in a few minutes with trivial licensing.
USAGE: USAGE:
The basic usage is: The basic usage for 1-d complex FFT is:
#include "kiss_fft.h"
void * cfg = kiss_fft_alloc( nfft ,inverse_fft ); void * cfg = kiss_fft_alloc( nfft ,inverse_fft );
while ... while ...
... // put kth sample in cx_in[k].r and cx_in[k].i ... // put kth sample in cx_in[k].r and cx_in[k].i
kiss_fft( cfg , cx_in , cx_out ); kiss_fft( cfg , cx_in , cx_out );
... // transformed
... // transformed. DC is in cx_out[0].r and cx_out[0].i
free(cfg); free(cfg);
Note: frequency-domain data is stored from dc up to 2pi. Note: frequency-domain data is stored from dc up to 2pi.
so cx_out[0] is the dc bin of the FFT so cx_out[0] is the dc bin of the FFT
and cx_out[nfft/2] is the Nyquist bin (if even length 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 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. functions you'll need to use.
with sample usage code. For more functionality, like 2d FFTs you may need to add
other source files to your project. 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 FFTs (complex only currently, apologies to Steve DeKorte -- mebbe next time )
* real FFTs
* fast convolution filtering
The core fft and most tools/ code can be compiled to use float, double
or 16bit short samples. The default is float.
The code can be compiled to use float, double or 16bit short samples.
The default is float.
BACKGROUND: BACKGROUND:
@ -68,11 +82,18 @@ UNDER THE HOOD:
Kiss FFT uses a time decimation, mixed-radix, out-of-place FFT. Kiss FFT uses a time decimation, mixed-radix, out-of-place FFT.
No scaling is done. Optimized butterflies are used for factors 2,3,4, and 5. No scaling is done. 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) then twiddles.
The fast convolution filtering uses the overlap-scrap method, slightly
modified to put the scrap at the tail.
LICENSE: LICENSE:
BSD, see COPYING for details. Basically, "free to use, give credit where due, no guarantees" BSD, see COPYING for details. Basically, "free to use, give credit where due, no guarantees"
TODO: TODO:
*) Add real optimization for odd length FFTs *) Add real optimization for odd length FFTs (DST)
*) Add real optimization to the n-dimensional FFT *) Add real optimization to the n-dimensional FFT
*) Add simple windowing function, e.g. Hamming : w(i)=.54-.46*cos(2pi*i/(n-1)) *) Add simple windowing function, e.g. Hamming : w(i)=.54-.46*cos(2pi*i/(n-1))
*) Make the fixed point scaling and bit shifts more easily configurable. *) Make the fixed point scaling and bit shifts more easily configurable.

View File

@ -39,10 +39,9 @@ all: tools $(BENCHKISS) $(SELFTEST) $(BENCHFFTW) $(TESTREAL) $(TESTKFC)
tools: tools:
cd ../tools && make all cd ../tools && make all
#CFLAGS=-Wall -O3 -pedantic -march=pentiumpro -ffast-math -fomit-frame-pointer -I.. -I../tools CFLAGS=-Wall -O3 -pedantic -march=pentiumpro -ffast-math -fomit-frame-pointer -I.. -I../tools
#-DUSE_SKIP
# If the above flags do not work, try the following # If the above flags do not work, try the following
CFLAGS=-Wall -O3 -I.. -I../tools #CFLAGS=-Wall -O3 -I.. -I../tools
$(SELFTEST): $(SELFTESTSRC) $(SRCFILES) $(SELFTEST): $(SELFTESTSRC) $(SRCFILES)
$(CC) -o $@ $(CFLAGS) $(TYPEFLAGS) -lm $+ $(CC) -o $@ $(CFLAGS) $(TYPEFLAGS) -lm $+