-- 定义复数类型
local complex = {}
complex.__index = complex
function complex.new(re, im)
local self = setmetatable({}, complex)
self.re = re or 0
self.im = im or 0
return self
end
function complex.__add(a, b)
return complex.new(a.re + b.re, a.im + b.im)
end
local function fft(input)
local n = #input
if n <= 1 then
return input
end