Implement 2D and 3D FFTs