fixed a bug with nfft==1

and added utility for more testing
This commit is contained in:
Mark Borgerding
2003-12-16 03:43:05 +00:00
parent 95a7b856d1
commit f4961ed74b
5 changed files with 165 additions and 34 deletions

View File

@ -18,6 +18,12 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
fixed or floating point complex numbers. It also delares the kf_ internal functions.
*/
/* the max length of the sequence of factors of nfft ,
MAXFACTORS==32 this should be good up to more 1e15 samples
( 2 * 3**31 )
*/
#define MAXFACTORS 32
static void kf_bfly2(
kiss_fft_cpx * Fout,
int fstride,
@ -303,7 +309,7 @@ void * kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem )
size_t memneeded = sizeof(kiss_fft_state)
+ sizeof(kiss_fft_cpx)*nfft /* twiddle factors*/
+ sizeof(kiss_fft_cpx)*nfft /* tmpbuf*/
+ sizeof(int)*nfft /* factors*/
+ sizeof(int)*2*MAXFACTORS /* factors*/
+ sizeof(kiss_fft_cpx)*nfft; /* scratch*/
if ( lenmem==NULL ) {