[Libre-soc-bugs] [Bug 653] investigate FFT, DCT, etc for REMAP in SVP64
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Fri Jul 16 23:03:58 BST 2021
https://bugs.libre-soc.org/show_bug.cgi?id=653
--- Comment #13 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
TODO, create partial recursive partial iterative FFT
import sys
from cmath import exp, pi
def fft(x):
N = len(x)
if N <= 1:
return x
if N % 2 > 0:
raise ValueError("size of x must be a power of 2")
even = fft(x[::2])
odd = fft(x[1::2])
r = range(N//2)
T = [exp(-2j * pi * k / N) * odd[k] for k in r]
[even[k] for k in r]
res = ([even[k] + T[k] for k in r] +
[even[k] - T[k] for k in r])
return res
input_data = [1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0]
print(' '.join("%5.3f" % abs(f) for f in fft(input_data)))
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list