1
$\begingroup$

I give wolfram a Fourier transform to solve and I get my answer like this:

enter image description here

but when I try to plot it using the plot command like this

enter image description here

It doesn't plot the impulses given by the dirac delta function

enter image description here

What am I doing wrong? I want a plot of the magnitude and phase.

Edit:

When I say I want a graph of the magnitude and phase, I mean something along the lines of this:

enter image description here

enter image description here

$\endgroup$
6
  • 2
    $\begingroup$ How do you think the Dirac “function” should be plotted. It is zero everywhere except at one point, when it is infinite. Plotting it seems hard. Telling $\pi\delta(w)$ from $\delta(w)$ is nearly impossible. $\endgroup$ Commented Apr 26, 2021 at 20:23
  • 1
    $\begingroup$ When I plot the magnitude by hand for this question I draw an impulse at w = -1/2, -1/2pi, 1/2pi and 1/2 with an amplitude of 1/2. Idk if that makes sense. I know those are poles so they technically go to infinity. $\endgroup$
    – MisterM
    Commented Apr 26, 2021 at 20:25
  • 1
    $\begingroup$ Do you know what $\delta(0)$ is? $\endgroup$ Commented Apr 26, 2021 at 20:27
  • $\begingroup$ At heart, you can’t do this. You can approximate it, but any graph is more of a lie than is usual for a graph. $\endgroup$ Commented Apr 26, 2021 at 20:56
  • $\begingroup$ It’s not at all clear what you mean by an “impulse” or how one graphs it. But you are really asking Wolfram Alpha to do something. It is unwise to do. Personally, I’d prefer no graph to what WA gives you, but I don’t understand what you’d expect. $\endgroup$ Commented Apr 26, 2021 at 21:27

2 Answers 2

1
$\begingroup$

You can achieve this with Mathematica but there are a few problems that must be overcome, and I'm not sure about Wolfram Alpha.


DiracDelta[x] returns $0$ for all real values of $x\ne 0$, but remains un-evaluated at $x=0$. But DiscreteDelta[x] can be used in place of DiracDelta[x] to show the integrated magnitude of the DiracDelta[x] function.

The Plot function doesn't necessarily plot the discrete points of interest, but the DiscretePlot or ListPlot function can be used instead. The real impulses are at multiples of $\pi$, but the imaginary impulses are at discrete integers, but the real and imaginary impulses can be plotted on separate graphs and the Show function can be used to combine the two graphs.


Assume the function is defined as follows:


(1) $\quad$ f[$\omega$_]:=-($\pi$(DiscreteDelta[$\pi$-$\omega$]-I DiscreteDelta[$\omega$-1]+I DiscreteDelta[$\omega$+1]+DiscreteDelta[$\omega$+$\pi$]))


The function f[$\omega$] can then be plotted with the following statement the results of which are illustrated in Figure (1) below where the strictly real part is plotted in blue, the strictly imaginary part is plotted in orange, and the horizontal dashed grid-lines are at $\pm\pi$.


Show[Plot[{f[$\omega$],$\pi$,-$\pi$},{$\omega$,-5, 5},PlotRange->{-4,4},GridLines->Automatic,PlotStyle->{Thick,{Gray,Dashed},{Gray, Dashed}}], ListPlot[Table[{$\omega$,f[$\omega$]},{$\omega$,{-$\pi$,$\pi$}}],Filling->Axis,FillingStyle->Thick], ListPlot[Table[{$\omega$,Im@f[$\omega$]},{$\omega$, {-1, 1}}],PlotStyle->Orange,Filling->Axis,FillingStyle->Thick]]


Illustration of Formula (1) for f[omega]

Figure (1): Illustration of Formula (1) for f[$\omega$]


Another way to achieve this is to use an analytic representation of the discrete delta function $\delta_d(x)$ such as formula (2) below where the evaluation frequency $f$ is assumed to be a positive integer and $N$ must be selected such that $M(N)=0$ where $M(x)=\sum\limits_{n\le x}\mu(n)$ is the Mertens function:


(2) $\ \delta_d(x)=\underset{N,f\to\infty}{\text{lim}}\left(\frac{1}{2 f}\sum\limits_{n=1}^N\frac{\mu(n)}{n} \left(\sum\limits_{k=1}^{f\ n}\left(\cos\left(\frac{2 \pi k (x-1)}{n}\right)+\cos\left(\frac{2 \pi k (x+1)}{n}\right)\right)-\frac{1}{2}\sum\limits_{k=1}^{2 f\ n} \cos\left(\frac{\pi k x}{n}\right)\right)\right)$


Substituting $\delta_d(x)$ for the DiscreteDelta[x] functions in formula (1) above leads to the following.


(3) $\quad f(\omega)=-(\pi(\delta_d(\pi-\omega)-i\ \delta_d(\omega-1)+i\ \delta(\omega+1)+\delta_d(\omega+\pi$)))


Figure (3) below illustrates the real and imaginary parts of $f(\omega)$ defined in formula (3) above in blue and orange respectively where formula (2) is used to evaluate the $\delta_d(x)$ functions in formula (3) and formula (2) is evaluated at $N=39$ and $f=8$. The discrete evaluation points are at $\omega=\pm 1$ and $\omega=\pm\pi$, and the dashed gray horizontal grid-lines are at $\pm\pi$.


Illustration of Formula (3) for f(omega) evaluated using formula (2) for delta_d(x)

Figure (3): Illustration of Formula (3) for $f(\omega)$ evaluated using formula (2) for $\delta_d(x)$

$\endgroup$
0
$\begingroup$

Your general question is reasonable (and significant), but the current form of "Wolfram Alpha" is not set up to respond in these terms.

Yes, there is an entirely reasonable sense in which we can ask "what multiple of a Dirac delta at point $x_o$ do we get?".

It is also true that there are some subtleties in understanding why $\int_{-\infty}^\infty e^{-2\pi ixt}dt=1\times \delta(x)$ (so to speak...) as opposed to some other multiple of $\delta$. Not to mention the problem of pointwise values of the generalized function $\delta(x)$... (This is not at all a deal-breaker problem, but it does broach the somewhat awkward idea that perhaps functions shouldn't be literally the collection of their pointwise values... which already arose with $L^p$ functions and "almost everywhere" stuff.)

I'm not a WA maven, but I suspect that there's not a canned way to make WA respond in the way you want.

$\endgroup$
3
  • $\begingroup$ Thank you for your answer. It answers what I suspected but wasn't totally sure about. $\endgroup$
    – MisterM
    Commented Apr 26, 2021 at 23:17
  • $\begingroup$ A question for you math.stackexchange.com/questions/4117936/… $\endgroup$
    – reuns
    Commented Apr 27, 2021 at 18:22
  • $\begingroup$ @reuns, ah, I will look at this a bit later. Thanks! $\endgroup$ Commented Apr 27, 2021 at 19:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .