Created
March 13, 2010 17:12
-
-
Save embed/331442 to your computer and use it in GitHub Desktop.
Python fft test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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