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 is the idealization of such an impulse: zero everywhere except at , with total area 1.
Definition by a limit
Take a rectangular pulse of width and height , area 1. As it gets taller and thinner. No ordinary function is the limit, but integrals against it converge:
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, .
Its transform
From the sifting property,
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
, : the mass is at rest and gets a unit impulse at . Then and
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:
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 with zero initial conditions, the response to is with . It is called the impulse response, and it determines the response to every input by convolution: .
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 with .
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 at the contact, exactly the delta-function idealization.
Exercises
Exercise 1: Sifting
Compute .
Answer
Solution
The delta picks out the value at : .
Exercise 2: First-order impulse
Solve , .
Answer
.
Solution
. Then , shifted by 1. The impulse makes jump from 0 to 3 at .
Exercise 3: Two kicks (code)
with , . Describe the motion on and after .
Answer
The mass is at rest on ; after it moves as again.
Solution
Without kicks . At the mass is at 0 with velocity , and the kick adds : it stops dead. At the second kick gives it velocity 1 from rest at 0. In formulas, .
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
is…
- 1
A unit impulse applied to a unit mass…
- moves it instantly by 1
- changes its velocity instantly by 1
- does nothing
- changes its acceleration permanently
The impulse response of a linear system is…
- the step response
- always