TExcelTAD
Home › Differential Equations › The Dirac Delta and Impulse Response

The Dirac Delta and Impulse Response

A hammer blow, a kick to a ball, a lightning strike on a power line: forces that act for a very short time but transfer a definite amount of momentum. The Dirac delta δ(t)\delta(t) is the idealization of such an impulse: zero everywhere except at t=0t = 0, with total area 1.

Definition by a limit

Take a rectangular pulse of width ε\varepsilon and height 1ε\frac{1}{\varepsilon}, area 1. As ε→0\varepsilon \to 0 it gets taller and thinner. No ordinary function is the limit, but integrals against it converge:

∫−∞∞δ(t−a) f(t) dt=f(a)(sifting property).\int_{-\infty}^{\infty} \delta(t - a)\,f(t)\,dt = f(a) \qquad \text{(sifting property)}.

The delta is a generalized function (a distribution): it is defined by what it does inside integrals. It is also the derivative of the step function, u′(t−a)=δ(t−a)u'(t - a) = \delta(t - a).

Its transform

From the sifting property,

L{δ(t−a)}=e−as,L{δ(t)}=1.\mathcal{L}\{\delta(t - a)\} = e^{-as}, \qquad \mathcal{L}\{\delta(t)\} = 1.
python · try it yourself
import sympy as sp

t, s = sp.symbols("t s", positive=True)
print(sp.laplace_transform(sp.DiracDelta(t - 3), t, s, noconds=True))
print(sp.integrate(sp.DiracDelta(t - 2) * sp.cos(t), (t, 0, 10)))
exp(-3*s)
cos(2)

A kicked spring

x′′+4x=δ(t−1)x'' + 4x = \delta(t - 1), x(0)=x′(0)=0x(0) = x'(0) = 0: the mass is at rest and gets a unit impulse at t=1t = 1. Then (s2+4)X=e−s(s^2 + 4)X = e^{-s} and

x(t)=12sin⁡(2(t−1)) u(t−1).x(t) = \tfrac{1}{2}\sin\big(2(t - 1)\big)\,u(t - 1).

Physically, the impulse changes the velocity instantly by 1 (momentum = impulse for unit mass) without moving the mass, and then the spring oscillates freely. The pulse approximation confirms it:

python · try it yourself
import numpy as np
from scipy.integrate import solve_ivp

def response(eps):
    pulse = lambda t: 1 / eps if 1 <= t < 1 + eps else 0.0
    sol = solve_ivp(lambda t, Y: [Y[1], pulse(t) - 4 * Y[0]], (0, 3), [0, 0],
                    max_step=eps / 4, rtol=1e-10, atol=1e-12)
    return sol.y[0][-1]

exact = 0.5 * np.sin(2 * (3 - 1))
for eps in (0.5, 0.1, 0.01):
    print(f"pulse width {eps}: x(3) = {response(eps):.5f}")
print(f"delta (exact):     x(3) = {exact:.5f}")
pulse width 0.5: x(3) = -0.16817
pulse width 0.1: x(3) = -0.34331
pulse width 0.01: x(3) = -0.37511
delta (exact):     x(3) = -0.37840

Impulse response and transfer function

For ay′′+by′+cy=f(t)ay'' + by' + cy = f(t) with zero initial conditions, the response to f=δ(t)f = \delta(t) is h(t)=L−1{H(s)}h(t) = \mathcal{L}^{-1}\{H(s)\} with H(s)=1as2+bs+cH(s) = \frac{1}{as^2 + bs + c}. It is called the impulse response, and it determines the response to every input by convolution: y=h∗fy = h * f.

python · try it yourself
import numpy as np
from scipy import signal

H = signal.lti([1], [1, 0.5, 4])            # H(s) = 1 / (s^2 + 0.5 s + 4)
t, h = signal.impulse(H, T=np.linspace(0, 6, 7))
w1 = np.sqrt(4 - 0.0625)
print(np.round(h, 5))
print(np.round(np.exp(-0.25 * t) * np.sin(w1 * t) / w1, 5))
[ 0.       0.3594  -0.22495 -0.07719  0.18475 -0.06881 -0.06899]
[ 0.       0.3594  -0.22495 -0.07719  0.18475 -0.06881 -0.06899]

The impulse response of this underdamped system is 1ω1e−t/4sin⁡ω1t\frac{1}{\omega_1}e^{-t/4}\sin\omega_1t with ω1=4−116\omega_1 = \sqrt{4 - \frac{1}{16}}.

In software

  • "Impulse response" is the standard way to characterize audio rooms, loudspeakers and filters: record the response to a click (or a sweep), then convolve any sound with it.
  • Game physics resolves collisions with impulses: an instantaneous change of velocity Δv=J/m\Delta v = J/m at the contact, exactly the delta-function idealization.

Exercises

Exercise 1: Sifting

Compute ∫0∞δ(t−π) sin⁡t2 dt\int_0^\infty \delta(t - \pi)\,\sin\frac{t}{2}\,dt.

Answer
Solution

The delta picks out the value at t=πt = \pi: sin⁡π2=1\sin\frac{\pi}{2} = 1.

Exercise 2: First-order impulse

Solve y′+2y=3δ(t−1)y' + 2y = 3\delta(t - 1), y(0)=0y(0) = 0.

Answer

y=3e−2(t−1)u(t−1)y = 3e^{-2(t-1)}u(t - 1).

Solution

(s+2)Y=3e−s(s + 2)Y = 3e^{-s}. Then 3s+2↔3e−2t\frac{3}{s + 2} \leftrightarrow 3e^{-2t}, shifted by 1. The impulse makes yy jump from 0 to 3 at t=1t = 1.

Exercise 3: Two kicks (code)

x′′+x=δ(t−π)+δ(t−2π)x'' + x = \delta(t - \pi) + \delta(t - 2\pi) with x(0)=0x(0) = 0, x′(0)=1x'(0) = 1. Describe the motion on (π,2π)(\pi, 2\pi) and after 2π2\pi.

Answer

The mass is at rest on (π,2π)(\pi, 2\pi); after 2π2\pi it moves as x=sin⁡tx = \sin t again.

Solution

Without kicks x=sin⁡tx = \sin t. At t=πt = \pi the mass is at 0 with velocity cos⁡π=−1\cos\pi = -1, and the kick adds +1+1: it stops dead. At t=2πt = 2\pi the second kick gives it velocity 1 from rest at 0. In formulas, x=sin⁡t+sin⁡(t−π)u(t−π)+sin⁡(t−2π)u(t−2π)=sin⁡t (1−u(t−π)+u(t−2π))x = \sin t + \sin(t - \pi)u(t - \pi) + \sin(t - 2\pi)u(t - 2\pi) = \sin t\,\big(1 - u(t - \pi) + u(t - 2\pi)\big).

python · try it yourself
import sympy as sp
t, s = sp.symbols("t s", positive=True)
X = (1 + sp.exp(-sp.pi * s) + sp.exp(-2 * sp.pi * s)) / (s**2 + 1)
x = sp.inverse_laplace_transform(X, s, t)
print(sp.simplify(x))
print([sp.simplify(x.subs(t, v)) for v in (sp.pi / 2, 3 * sp.pi / 2, 5 * sp.pi / 2)])
(Heaviside(t - 2*pi) - Heaviside(t - pi) + 1)*sin(t)
[1, 0, 1]

Test yourself

L{δ(t−2)}\mathcal{L}\{\delta(t - 2)\} is…

  1. e−2se^{-2s}
  2. 1s−2\frac{1}{s - 2}
  3. e−2ss\frac{e^{-2s}}{s}
  4. 1

A unit impulse applied to a unit mass…

  1. moves it instantly by 1
  2. changes its velocity instantly by 1
  3. does nothing
  4. changes its acceleration permanently

The impulse response h(t)h(t) of a linear system is…

  1. L−1{H(s)}\mathcal{L}^{-1}\{H(s)\}
  2. H(0)H(0)
  3. the step response
  4. always sin⁡t\sin t