I would like a Python2 script that calculates some Ffts of various lengths.
* Any version of python2 is fine
* A method that calculates a Fft on complex inputs. I need to support Fft's of length 8, 16, 32, 64, and 128
* The inputs should be read from a file, there should be 2 test cases for each Fft length, the files should be located in a sub-directory and named as such "[login to view URL]", "[login to view URL]"...etc
* The python script will read the source file, calculate the Fft of the specified length, and then check the results by reading another file called "[login to view URL]", "[login to view URL]"...etc
* The python script should support some kind of unit testing framework. (the default Python methods are fine or whatever you like most)
* Solve the Fft using the algorithm of your choice
* Additionally, there should be a different method (a "split method") that can calculate an Fft by splitting up the input Fft into 2 smaller Ffts. So for the Fft of length 32, it would work by splitting up the Fft source data into 2 subsets, and call the origin method to calculate the Fft of the 2 subsets, then it would take the results, combine them and produce the same results as if someone called the original Fft function.
* A total of 18 tests:
* 2 for Fft of length 8
* 2 for Fft of length 16
* 2 for Fft of length 32
* 2 for Fft of length 64
* 2 for Fft of length 128
* 2 for length 16 where it splits up the problem and calls a "split method"
* 2 for length 32 where it splits up the problem and calls a "split method"
* 2 for length 64 where it splits up the problem and calls a "split method"
* 2 for length 128 where it splits up the problem and calls a "split method"
note: you can use the following site to verify the inputs/outputs
[login to view URL]
I have already tried some code for calculating FFTs and it seems to work fine.
I attach the code for the split method so that you belive me.
Contact me if you have any questions whatsoever.
def FFT(x):
x = [login to view URL](x, dtype=float)
N = [login to view URL][0]
if N % 2 > 0:
raise ValueError("size of x must be a power of 2")
elif N <= 32: # this cutoff should be optimized
aux = DFT_slow(x)
return aux
else:
X_even = [login to view URL](x[::2])
X_odd = [login to view URL](x[1::2])
factor = [login to view URL](-2j * [login to view URL] * [login to view URL](N) / N)
return [login to view URL]([X_even + factor[:N / 2] * X_odd,
X_even + factor[N / 2:] * X_odd])
$25 USD in 1 day
5.0 (1 review)
0.0
0.0
3 freelancers are bidding on average $20 USD for this job
a very experienced python developer is ready to get the job done quickly, professionally and at the lowest cost. contact me now, and let's get started right away