2D dft function.