To fully understand the Fourier Transform I have been working on a rather standard implementation of the FFT algorithm. I tried generating a 440 Hz sin wave and passing it through the algorithm, however, when plotting the real part of the result, I get a spiky mess, whereas I was expecting two spikes (as from my understanding it's mirrored, since the second half is just a representation of the first's complex conjugate).
Disappointed, I tried passing the sin wave through a third party library, but achieved the same result, so I suspect I am misunderstanding what the FFT actually outputs.
Not sure how useful it is, but here is the GitHub project https://github.com/kradicati/fourier-transform
The two most important classes are: https://github.com/kradicati/fourier-transform/blob/master/src/test/kotlin/me/krb/transform/FastFourierTransformTest.kt (where the actual plotting is done) https://github.com/kradicati/fourier-transform/blob/master/src/main/kotlin/me/krb/transform/FastFourierTransform.kt (the FFT implementation)