I'm not very experienced with Fourier Transforms, so there may be something inherently wrong with attempting to do this, but how can I make the discrete Fourier behave like the continuous FourierTransform?

@yulinyulin sorry, I wasn't very specific. I meant the OPs original question. The graph you've plotted doesn't seem quite to resemble either of the OPs graphs. So I was interested in what approach you had taken in your solution and how it matched the original question.
–
image_doctorJun 20 '12 at 9:01

Note the symmetric spikes around list element 2500 in the above plot of a sine wave with frequency of unity.

Fourier produces a result which runs up from 0 to max freq and then down from max freq to 0, consisting of two identical spectra reflected around the centre of the list. In contrast, by default FourierTransform produces an expression which covers the range 0 up to max freq.

the Dirac delta appears smeared out across a range of frequencies, this is an effect of the discrete nature of this transform.

I suspect there is an issue in the continuous case when using FourierTransform in that DiracDelta does not resolve to a numeric value when plotting, so you don't see the spike in the continuous form of the plot.

The result you obtain with when using Sin[x] UnitStep[x] in the discrete case is equivalent to Sin[x] as UnitStep[n] evaluates to 1, so use of the UnitStep results in no modification to the Sin function.

In the continuous case, Sin[x] UnitStep[x] does not evaluate to Sin[x] but a truncated sine wave. Sharp discontinuities, such as those introduced by unit steps, cause a smearing in the frequency domain. I suspect this is the origin of your broad spectrum like plot for the continuous case as can be seen by examining the Fourier transforms of the two expressions.

Very helpful explanation. +1 I went with yulinlinyu's answer as it does a good job of matching that initial image, but really I'm now interested in knowing how to make the continuous fourier transform behave like the images in your post. Perhaps I'll be able to figure that out will all of this info!
–
EmpireJonesJun 21 '12 at 3:10

@EmpireJones No problem :), May I ask again what your goal is? Do you want a plot of Sin[x] or Sin[x] UnitStep[x], these are not the same thing.
–
image_doctorJun 21 '12 at 6:34

@EmpireJones The Fourier transform of Sin[x] is a single Dirac delta function, not a wideband spectrum as Sin[x] UnitStep[x] is.
–
image_doctorJun 21 '12 at 6:50

Plot of Sin[x]. When I try using the plotting method that you used above for Sin[15 x] + Sin[x] + Cos[x 30], I get only two visible points, instead of the 6 peaks that the discrete version comes up with. Perhaps the plot functionality can't pick up on the narrow point. It's also interesting that the Filling doesn't show up in your second to last image.
–
EmpireJonesJun 22 '12 at 3:56

The discrete Fourier transform produces a spectrum {Fmax->0,0->Fmax} whilst the symbolic version gives {0->Fmax}, hence half the number of points.
–
image_doctorJun 22 '12 at 7:33

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.