FFT stands for the Fast Fourier Transform. Any function of time or space can be decomposed into a series of sines (with odd imaginary components) and cosines (even real components).
Remember... A dirac delta function only contains
even components (cosines) from frequency=0 to frequency=infinity.
Also, boxcar functions in time has the transform pair
of a sinc function ...(sin(f)/f) Draw a box car function
yourself to see.
You can get the source code from the author: http://sepwww.stanford.edu/oldsep/hale/index.html