implement 1D dft and idft