home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Plus
/
Graphics Plus.iso
/
general
/
fractal
/
kaos.lha
/
fftlib
/
fft_set_len.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1989-12-19
|
756 b
|
28 lines
/*
### procedure for computing the length of time series for fft ###
*/
#define MAXPOWER 31
int power_of_two[MAXPOWER] = {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,
33554432,67108864,134217728,268435456,536870912,1073741824};
#define FFTMAX 21
fft_set_len()
{
int i,is_power_of_two=0;
extern int tser_len,power_of_two[];
extern char string[];
for(i=0;i<FFTMAX && tser_len >= power_of_two[i];i++){
if(tser_len == power_of_two[i]){
is_power_of_two = 1;
break;
}
}
if(is_power_of_two!=1){
tser_len = power_of_two[i-1];
sprintf(string,"FFT: Length of time series is set to a power of two (%d).",tser_len);
system_mess_proc(0,string);
return;
}
}