minor doc changes

This commit is contained in:
Mark Borgerding 2003-12-05 00:35:25 +00:00
parent 39d2974fe3
commit 72de907478
5 changed files with 22 additions and 21 deletions

View File

@ -3,7 +3,7 @@
If the same buffer pointer is supplied for both in and out, kiss will
manage the buffer copies.
added kiss_fft2d as a separate source file (declarations in kiss_fft.h )
0.4 : optimized for radix 2,3,4,5

27
README
View File

@ -12,18 +12,18 @@ USAGE:
void * cfg = kiss_fft_alloc( nfft ,inverse_fft );
while ...
... // put kth sample in cx_buf_in_out[k].r and cx_buf_in_out[k].i
kiss_fft( cfg , cx_buf_in_out );
... // put kth sample in cx_in[k].r and cx_in[k].i
kiss_fft( cfg , cx_in , cx_out );
... // transformed
free(cfg);
Note: frequency-domain data is stored from dc to 2pi.
so cx_buf_in_out[0] is the dc bin of the FFT
and cx_buf_in_out[nfft/2] is the Nyquist bin
so cx_out[0] is the dc bin of the FFT
and cx_out[nfft/2] is the Nyquist bin (if present)
Declarations are in "kiss_fft.h", along with a brief description of the
functions you'll need to use. Code definitions are in kiss_fft.c, along
with sample usage code.
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.
The code can be compiled to use float, double or 16bit short samples.
The default is float.
@ -44,8 +44,8 @@ During this process, I learned:
1. FFT_BRANDX has 500 times as many lines of code as Kiss
(and that's just the C code).
2. It took me an embarrassingly long time to get FFT_BRANDX working.
3. A simple program using FFT_BRANDX is 500K. A similar program using kiss_fft is 18k.
4. FFT_BRANDX is about 3-4 times faster than Kiss
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.
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
@ -56,25 +56,22 @@ last bit of performance.
PERFORMANCE:
(on Athlon XP 2100+, with gcc 2.96, optimization O3, float data type)
Kiss performed 1000 1024-pt ffts in 110 ms of cpu time (132ms real time).
Kiss performed 1000 1024-pt ffts in 100 ms of cpu time.
For comparison, it took md5sum 160ms cputime to process the same amount of data
DO NOT:
... use Kiss if you need the Fastest Fft in The World
... 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 complex-only, time decimation, mixed-radix, out-of-place FFT.
No scaling is done. Optimized butterflies are used for factors 2 and 4.
Experiments with a radix 3 optimization showed no real gain over the generic
butterfly currently used for non power-2 factors.
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.
LICENSE:
BSD, see COPYING for details. Basically, "free to use, give credit where due, no guarantees"
TODO:
*) Add sample code for parallel ffts (stereo) packed into re,im components of time sequence.
*) 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.
*) Document/revisit the input/output fft scaling

View File

@ -71,8 +71,11 @@ typedef struct {
do { (res).r -= (a).r; (res).i -= (a).i; }while(0)
kiss_fft_cpx kf_cexp(double phase);
int kf_allocsize(int nfft);
void kf_init_state(kiss_fft_state * st,int nfft,int inverse_fft);
void kf_work(
kiss_fft_cpx * Fout,
const kiss_fft_cpx * f,

View File

@ -12,7 +12,11 @@ Redistribution and use in source and binary forms, with or without modification,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "_kiss_fft_guts.h"
/* The guts header contains all the multiplication and addition macros that are defined for
fixed or floating point complex numbers. It also delares the kf_ internal functions.
*/
kiss_fft_cpx kf_cexp(double phase) /* returns e ** (j*phase) */
{
@ -363,6 +367,3 @@ void kiss_fft(const void * cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)
kf_work( fout, fin, 1, st->factors,st );
}

View File

@ -15,7 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include "_kiss_fft_guts.h"
typedef struct {
int minus2; /*signify a 2-d transform*/
int minus2; /*magic to signify a 2-d transform*/
kiss_fft_state * rowst;
kiss_fft_state * colst;
kiss_fft_cpx * tmpbuf;