So to gain a better understanding of how Discrete Fourier Transforms are done, I'm trying to program one in Mathematica so I can easily check my answers with the built-in Mathematica code. Based on Wolfram's page on the DFT, I see that I have to sum over N elements N times to calculate the full transform of a set with N discretizations. So I made a for() loop to calculate the DFT.
For[k = 0, k < m , k++, For[x = 0, x < m , x++, Ts[[k + 1]] += s[[x + 1]]*Exp[-2*I*π*k*x/m]; ] ]
Ts being the transform of
s being the set that I would like to transform. But every time I check the answer, it's wrong. I thought that I might have a few off-by-one errors but none of the places I would expect there to be an error seem to have one and shifting by one in most places either doesn't make sense or does not product the correct DFT. What am I misunderstanding?