Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm trying to plot the Fourier transform of $\sin (2 t)$.

I tried using the FourierTransform Function (I'm expecting a peak at w = 2) but it gives me undefined at w = 2 because the DiracDelta function is not defined at DiracDelta[0]. Is there any way around this? I used

Plot[FourierTransform[Sin[2*t], t, w], {w, -3, 3}, PlotRange -> Full]

enter image description here

which has gaps at 2 and -2, but no height. How do I get a peak with some height there?

share|improve this question
1  
You may find an answer to how to plot (approximations to the delta function) here: mathematica.stackexchange.com/q/3506/1783 –  bill s Feb 16 at 16:16

1 Answer 1

up vote 2 down vote accepted

Since the transform has complex delta functions, you have to create a representation by hand.

FourierTransform[Sin[2*t], t, w]
(*
  I Sqrt[\[Pi]/2] DiracDelta[-2 + w] - I Sqrt[\[Pi]/2] DiracDelta[2 + w]
*)

Here's one way that includes marking the axes by hand.

Plot[UnitBox[100 (2 - w)] - UnitBox[100 (2 + w)],
 {w, -3, 3}, Exclusions -> {-2, 2}, PlotStyle -> Thick,
 Ticks -> {Automatic, {{-1, Row[{-I Sqrt[Pi/2], Infinity}]}, {1, 
     Row[{I Sqrt[Pi/2], Infinity}]}}}]

Mathematica graphics

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.