Skip to content

Instantly share code, notes, and snippets.

@embed
Created March 13, 2010 17:12
Show Gist options
  • Save embed/331442 to your computer and use it in GitHub Desktop.
Save embed/331442 to your computer and use it in GitHub Desktop.
Python fft test
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Programmed by Atilla Filiz
#Based the code by Kaan AKŞİT
rows=1024
cols=1024
try:
import random
from numpy.fft import *
import time
except ImportError, err:
print "couldn't load module. %s" % (err)
sys.exit()
def main():
input_array = []
for x in range(rows):
input_array.append([])
for y in range(cols):
input_array[x].append(random.random())
tstart=time.time()
solution = fft2(input_array)
solution = fft2(input_array)
solution = fft2(input_array)
solution = fft2(input_array)
solution = fft2(input_array)
solution = fft2(input_array)
solution = fft2(input_array)
solution = fft2(input_array)
tstop=time.time()
print tstop-tstart
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment