# How to plot the convolution of dirac delta series with a sine function [closed]

I am new to mathematica. I do the convolution of dirac delta :(DiracDelta(x-10)" with "sine(t),t=0-pi". How to plot the output ? Theoretically, the full wave should appear at the location of the singularity.

-

## closed as not a real question by F'x, R. M.♦, Dr. belisarius, Verbeia♦, whuberAug 30 '12 at 18:07

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Please include the code that you used (and didn't work). Look up the docs for Convolve. The very first example should lead you to the answer. – R. M. Aug 27 '12 at 20:12

Using convolution theorem http://en.wikipedia.org/wiki/Convolution_theorem that Fourier of the convolution of two functions is the same as multiplications of their Fourier transforms then

Use UnitStep to generate the time limited sin function to convolve with, like this

Plot[UnitStep[t] UnitStep[Pi - t] Sin[t], {t, -3 Pi, 3 Pi}]


and now apply the convolution theorem as above (earlier I forgot to InverseForurierTranform at the end, thanks to OleksandrR for noticing)

Clear[t, w];
f1 = DiracDelta[t - 10];
f2 = UnitStep[t] UnitStep[Pi - t] Sin[t];
y = FourierTransform[f1, t, w]  FourierTransform[f2 , t, w] ;
conv = InverseFourierTransform[y, w, t]


which gives

((1/Sign[10 - t] - 1/Sign[10 + Pi - t])*Sin[10 - t])/(2*Sqrt[2*Pi])


Plotting it

Plot[conv, {t, 0, 50}]


Using Convolve[] directly as suggested by OleksandrR below seems to be faster on V8.04.

Here is using Convolve[] directly. Much faster also. (I do not know why I did not try this first).

Clear[t, z];
f1 = DiracDelta[t - 10];
f2 = UnitStep[t] UnitStep[Pi - t] Sin[t];
conv2 = Convolve[f1, f2, t, z]
Plot[conv2, {z, 0, 50}, Exclusions -> None]


where conv2 above is

Piecewise[{{-Sin[10 - z], 10 <= z <= 10 + Pi}}, 0]


Hopefully not more errors in this now. It is nice that Mathematica offers many ways and functions to analyze a problem.

-
Looks like you forgot the InverseFourierTransform step! (It takes quite a while to find the answer, though. Convolve seems to be better than using the convolution theorem in this case.) – Oleksandr R. Aug 28 '12 at 1:50
This time the FourierParameters were incorrect (have to be consistent between the forward and reverse transforms). I edited your post to correct it, but looks like you just overrode my edits, so if you're actively editing I'll leave it alone... – Oleksandr R. Aug 28 '12 at 2:20
Okay! +1 it is, then! – Oleksandr R. Aug 28 '12 at 2:41