From 1a5f860757945a77753289e728387fd1e93de53c Mon Sep 17 00:00:00 2001 From: Mark Borgerding Date: Sat, 31 Jan 2004 02:46:20 +0000 Subject: [PATCH] v110 --- COPYING | 2 +- Makefile | 20 +++++++++++++++++--- README | 39 ++++++++++++++++++++++++++++++--------- test/Makefile | 5 ++--- 4 files changed, 50 insertions(+), 16 deletions(-) diff --git a/COPYING b/COPYING index dfeca04..d09f8e9 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright (c) 2003, Mark Borgerding +Copyright (c) 2003,4 Mark Borgerding All rights reserved. diff --git a/Makefile b/Makefile index 60d0951..4850b7f 100644 --- a/Makefile +++ b/Makefile @@ -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: @@ -7,11 +11,21 @@ testall: export DATATYPE=double && cd test && make test tarball: clean - find | grep -i -v cvs | zip kiss_fft.zip -@ - tar --exclude CVS --exclude .cvsignore --exclude kiss_fft.zip -cvzf kiss_fft.tar.gz . + tar --exclude CVS --exclude .cvsignore --exclude $(TARBALL) -cvzf $(TARBALL) . clean: cd test && 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) diff --git a/README b/README index fc881c9..e122f30 100644 --- a/README +++ b/README @@ -8,26 +8,40 @@ incorporated into someone's C program in a few minutes with trivial licensing. 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 ); + while ... + ... // put kth sample in cx_in[k].r and cx_in[k].i + kiss_fft( cfg , cx_in , cx_out ); - ... // transformed + + ... // 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 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 -functions you'll need to use. Code definitions for 1d complex FFTs are in kiss_fft.c. -with sample usage code. For more functionality, like 2d FFTs you may need to add -other source files to your project. +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 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: @@ -68,11 +82,18 @@ UNDER THE HOOD: 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. + 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: BSD, see COPYING for details. Basically, "free to use, give credit where due, no guarantees" 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 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. diff --git a/test/Makefile b/test/Makefile index 60fa05b..db43480 100644 --- a/test/Makefile +++ b/test/Makefile @@ -39,10 +39,9 @@ all: tools $(BENCHKISS) $(SELFTEST) $(BENCHFFTW) $(TESTREAL) $(TESTKFC) tools: cd ../tools && make all -#CFLAGS=-Wall -O3 -pedantic -march=pentiumpro -ffast-math -fomit-frame-pointer -I.. -I../tools -#-DUSE_SKIP +CFLAGS=-Wall -O3 -pedantic -march=pentiumpro -ffast-math -fomit-frame-pointer -I.. -I../tools # 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) $(CC) -o $@ $(CFLAGS) $(TYPEFLAGS) -lm $+