1D and 2D implementation of Fast Fourier Transform