Woops, one should not test with input of all zeros

This commit is contained in:
Mark Borgerding
2003-10-29 04:29:01 +00:00
parent 97b18f3fef
commit ca4c74e07c
6 changed files with 96 additions and 70 deletions

26
test/rand_fft_data.py Executable file
View File

@ -0,0 +1,26 @@
#!/usr/local/bin/python2.3
import sys
import random
import struct
def main():
from getopt import getopt
opts,args = getopt(sys.argv[1:],'n:N:t:l:h:')
opts=dict(opts)
nbufs = int( opts.get('-n','10000') )
nfft = int( opts.get('-N','1024') )
type = opts.get('-t','f')
lo = float(opts.get('-l','-32768') )
hi = float(opts.get('-h','32767') )
format = {'float':'f','short':'h','double':'d'}[type]
nums = [ random.uniform(lo,hi) for i in range(nfft*2) ]
buf = struct.pack( '%d%s' % ( len( nums ) , format ) , *nums )
for i in range(nbufs):
sys.stdout.write( buf )
if __name__ == '__main__':
main()