On the internet I have found the definition of the DFT to be : $$ F(k) = \frac{1}{\sqrt{N}} \sum\limits_{n=0}^{N-1} f(n) e^{-\frac{2\pi}{N}jkn} $$ But in this article I have found an implementation which doesn't really match the formular above. Are there different definitions ? Can I exchange the $e^{-\frac{2\pi}{N}jkn}$-part with something else? And if yes, why ?
The implementation in the article I mentioned above looks similar to:
for (i = 0; i <= transformLength /2; i++) {
cosPart[i] = 0;
sinPart[i] = 0;
for (k = 0; k < transformLength; k++) {
tmp = 2*i*M_PI*( double)k/(double)transformLength;
sinPart[i] += inputData[k] * (-1) * sin(tmp);
cosPart[i] += inputData[k] * cos(tmp);
}
}
Could someone explain to me the context between the sin/cos functions and the e-function in the definition formular?