##// END OF EJS Templates
test_fft directory added to the repository
test_fft directory added to the repository

File last commit:

r3:42c6ea189885 default
r4:a2755b43b4c9 default
Show More
twiddle_factors.py
16 lines | 381 B | text/x-python | PythonLexer
# exp( - j 2 pi k / N ) = W^k_N
from math import exp, cos, sin, pi
class TwiddleFactors(object):
"""docstring for TwiddleFactors"""
def __init__(self, N):
super (TwiddleFactors, self).__init__()
self.N = N
def build_twiddle_factors(self):
w = []
for k in range( self.N / 2 ):
teta = - 2 * pi * k / self.N
w.append( cos ( teta ) + 1j * sin( teta ) )
return w