Source: http://physics.wm.edu/~evmik/classes/matlab_book/ch_dft/ch_dft.pdf