Matlab to write DFT function