I learned about the Fourier transform in math classes and thought I understood them. Now I am trying to play with R (statistical language) and in practice interpret the results of a discrete FFT. This is what I did:
x = seq(0,1,by=0.1) y = sin(2*pi*(x)) calcenergy <- function(x) Im(x) * Im(x) + Re(x) * Re(x) fy <- fft(y) plot(x, calcenergy(fy))
and get this plot:

If I understand this right, this represents "half" of the energy density spectrum. Since the transformation is symmetrical, I could just flip all the values โโto negative x values โโto get the full spectrum.
However, I donโt understand why I get two spikes? There is only one sine frequency here. Is this a smoothing effect?
In addition, I do not know how to get frequencies from this plot. Assume that the units of the sinus function were seconds, this is a peak at 1.0 in the density spectrum of 1 Hz, then?
Again: I understand the FFT theory; practical application is a problem :).
Thanks for any help!
Peter Mรผller
source share