import cmath def convolution(f,g): n = len(bin(len(f)+len(g)-1)) - 2 fft_length = 1<>k)&1) << (n - 1 - k) if i>k)&1) << (n - 1 - k) if i