# Plot a Dirac Delta Function?

**URL:** <https://community.wolfram.com/t/plot-a-dirac-delta-function/13671>\
**Category:** Questions\
**Tags:** graphics-and-visualization\
**Created:** [February 13, 2019, 2:10am UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671 "2019-02-13T02:10:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucianopinheiro](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@lucianopinheiro](https://community.wolfram.com/u/lucianopinheiro)\
**Post date:** [February 13, 2019, 2:10am UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671/1 "2019-02-13T02:10:21Z")

</div>

Good Evening All,  
I have stumbled across a Dirac Delta Function, when applying the Fourier Transform to a function. I am not quite sure how to plot it. Could anyone provide some guidance?  
Thanks!

```
F[t_] := A*Sin[t]
g[k_] := FourierTransform[F[t], t, k]
I A Sqrt[\[Pi]/2] DiracDelta[-1 + k] - 
 I A Sqrt[\[Pi]/2] DiracDelta[1 + k

```

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [February 13, 2019, 3:28pm UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671/2 "2019-02-13T15:28:41Z")

</div>

It’s really a functional, not a function. There is no reason to expect one could “plot” it in the usual sense.

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [February 13, 2019, 4:21pm UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671/3 "2019-02-13T16:21:24Z")

</div>

You can approximate it.

```
Plot[PDF[NormalDistribution[0, 10^-2], x], {x, -2, 2}, 
 PlotRange -> {0, 1}]

```

 ![delta.jpg](https://global.discourse-cdn.com/wolfram/original/2X/6/613db13640e4356b3b976dcaae4a9f0ccad8d3ec.jpeg)

---

<div class="post-metadata">

**Author:** ![lucianopinheiro](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@lucianopinheiro](https://community.wolfram.com/u/lucianopinheiro)\
**Post date:** [February 13, 2019, 4:57pm UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671/4 "2019-02-13T16:57:23Z")

</div>

Delta Function is a generalized function, not a functional bud. But thanks anyways

---

<div class="post-metadata">

**Author:** ![lucianopinheiro](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@lucianopinheiro](https://community.wolfram.com/u/lucianopinheiro)\
**Post date:** [February 13, 2019, 4:59pm UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671/5 "2019-02-13T16:59:00Z")

</div>

Thats it! Thanks! Its undefined at zero so we gotta approximate, makes sense. Thanks!!

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [February 13, 2019, 5:06pm UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671/6 "2019-02-13T17:06:54Z")

</div>

> **[Distribution (mathematical analysis)](https://en.wikipedia.org/wiki/Distribution_(mathematics))**
>
> Distributions (or generalized functions) are objects that generalize the classical notion of functions in mathematical analysis. Distributions make it possible to differentiate functions whose derivatives do not exist in the classical sense. In particular, any locally integrable function has a distributional derivative. Distributions are widely used in the theory of partial differential equations, where it may be easier to establish the existence of distributional solutions than classical solu...

Check the part about linear functionals.

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [February 13, 2019, 6:42pm UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671/7 "2019-02-13T18:42:19Z")

</div>

To be honest, I would be quite unhappy if a plot of `DiracDelta` would actually show anything! What you can do is making something visible by showing its convolution with some “sharp” function, e.g.:

```
f[t_] := a Sin[t]
g[\[FormalK]_] = FourierTransform[f[\[FormalT]], \[FormalT], \[FormalK]];

plotDelta[f_, k_] := Total@*ReIm@Convolve[f[\[FormalX]], HeavisideLambda[50 \[FormalX]], \[FormalX], k]
Plot[Evaluate[plotDelta[g, k] /. a -> 1], {k, -2, 2}, PlotRange -> All]

```

which gives:

 ![ddd.png](https://global.discourse-cdn.com/wolfram/original/3X/2/c/2c8678b5579c7bfedd8a5ac88829457471283bc1.png)

---

<div class="post-metadata">

**Author:** ![dlkeith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dlkeith/32/31494_2.png) [@dlkeith](https://community.wolfram.com/u/dlkeith)\
**Post date:** [February 14, 2019, 1:14am UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671/8 "2019-02-14T01:14:59Z")

</div>

The Dirac delta function is a Monster. It must be kept in a cage, called an integrand. Outside the cage, it makes no more sense than the Jabberwock. Inside the cage it may be tamed:

```
Integrate[DiracDelta[x - a] f[x],
 {x, -Infinity, Infinity},
 Assumptions -> Element[a, Reals]]
(* f[a] *)

```

---

<div class="post-metadata">

**Author:** ![lucianopinheiro](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@lucianopinheiro](https://community.wolfram.com/u/lucianopinheiro)\
**Post date:** [February 14, 2019, 11:42am UTC](https://community.wolfram.com/t/plot-a-dirac-delta-function/13671/9 "2019-02-14T11:42:14Z")

</div>

Love the analogy, David! And that’s an elegant solution to my problem, based on the definition of the the Delta Func, because however the delta func is undefined when its argument is zero, the its integral is well defined by definition. thanks!
