Skip to content

Impulse, step and ramp

Give the spike and the switch from 2.3 their real names, and meet their continuous-time twins.

Before thisDecomposing signals (2.3)

Before this2.3
Chapter 3 · Lesson 1 of 4

First, the picture

Set Relation to Spike → running sum, then to Switch → difference, and watch the same two traces come back with the arrow running the other way.

Naming the spike and the switch

Choose a pair; running sum and differencing relate them exactly.

↓ Running sum turns the spike into the switch. ↑ Differencing turns the switch back into the spike.

Relation
Describe this picture

Two traces of samples, one above the other, for nn from −3-3 to 5, with a caption between them. Three “Relation” buttons choose the pair: “Spike → running sum” shows the spike above the switch; “Switch → running sum” the switch above the ramp; “Switch → difference” the switch above the spike. The caption names the two operations, for example ”↓ Running sum turns the spike into the switch. ↑ Differencing turns the switch back into the spike.”

Naming the spike and the switch

On the page on decomposing signals, I built two of the pieces I used to rebuild a sequence by hand and told you they’d get proper names once Chapter 3 arrived. That’s now. The spike, the piece that’s 11 at one sample and 00 everywhere else, is called the unit sample (or unit impulse), written δ[n]\delta[n]. The switch, the piece that turns on at one instant and stays on forever after, is called the unit step, written u[n]u[n]. Nothing about them changes; they just have names now.

There’s a third piece worth naming here too. Running-summing the switch one level further, the way you ran a difference into a sum before, gives you a signal that climbs by 11 every sample once it’s switched on: 0,0,0,1,2,3,…0,0,0,1,2,3,\dots. That’s the ramp, written r[n]r[n].

δ[n]={1n=00n≠0,u[n]={0n<01n≥0,r[n]=n u[n]\delta[n] = \begin{cases}1 & n=0 \\ 0 & n\ne0\end{cases}, \qquad u[n] = \begin{cases}0 & n<0 \\ 1 & n\ge0\end{cases}, \qquad r[n] = n\,u[n]

Here nn is the sample index, δ[n]\delta[n] is the unit sample, u[n]u[n] is the unit step, and r[n]r[n] is the ramp: it equals nn once u[n]u[n] has switched it on, and 00 before that. These three are tied together by exactly the difference and running-sum operations from the page on amplitude operations: differencing u[n]u[n] gives you δ[n]\delta[n] back, and running-summing δ[n]\delta[n] gives you u[n]u[n] back; running-summing u[n]u[n] (delayed by one sample, so it hasn’t switched on yet at the instant you’re summing) gives you r[n]r[n].

In the picture at the top of the page, Spike → running sum and Switch → difference show the same two traces, running the arrow both ways: running-summing δ[n]\delta[n] gives u[n]u[n], and differencing u[n]u[n] gives δ[n]\delta[n] back, exactly the operations from 2.2, just applied to signals that now have names.

Shrinking a pulse to a spike

A hammer strike is over almost instantly, yet it clearly lands with a definite amount of “push”. The shorter the strike, the harder it has to hit to deliver the same push. I want to build the continuous-time twin of the spike the same way.

Start with a rectangular pulse: some width, and a height chosen so the area under it (width times height) is exactly 11. Now shrink the width while keeping the area pinned at 11: the pulse has to get taller to compensate, since a narrower base with the same area needs a taller rectangle. Shrink the width toward 00 and the height grows without bound. The idealized limit, too tall and thin to even draw as a curve, is called the Dirac delta, written δ(t)\delta(t): a spike that’s 00 everywhere except at one instant, yet whose area is 11.

Drag Pulse width all the way down toward its smallest setting and watch Area under the pulse.

Shrinking a pulse to a spike

Narrower means taller, but the shaded area never changes.

1.20
Area under the pulse
1.00
Describe this picture

One plot of a rectangular pulse with its area shaded, held at 1. The “Pulse width” slider runs from 0.08 to 2, and the height grows as the width shrinks. The readout “Area under the pulse” shows the area to two decimals.

Notice the pulse gets visibly taller as it narrows, but Area under the pulse stays pinned at 1.001.00 the entire time: that’s why δ(t)\delta(t) can be “infinitely tall” and still have a perfectly finite, well-defined area underneath it.

The sifting property

Imagine a sensor that only reports a reading during a very brief “on” gate around one instant, and is silent the rest of the time. If that gate is narrow enough, what it reports back is close to the true value the signal had at that one instant. That’s the idea behind the sifting property.

If you know a little calculus, the “adding up” I’m about to describe is an integral: for now, think of it in plain words as a running area, the total area swept out under a curve. Multiply a signal x(t)x(t) by a narrow, unit-area pulse centred at some instant t0t_0, and find the running area under that product. A wide gate blurs together nearby values of x(t)x(t), but as the gate narrows toward δ(t−t0)\delta(t-t_0), less and less of any other instant leaks in, until the running area becomes exactly x(t0)x(t_0), the signal’s own value right at t0t_0:

∫−∞∞x(t) δ(t−t0) dt=x(t0)\int_{-\infty}^{\infty} x(t)\,\delta(t-t_0)\,dt = x(t_0)

Here x(t)x(t) is the signal being sampled, δ(t−t0)\delta(t-t_0) is a unit-area spike centred at t0t_0, and the integral sign is that running-area total taken over all time. The delta “sifts out” one value of xx from the whole trace.

Drag Gate width down toward its narrowest setting and watch Estimate of the value there.

The sifting property

Narrow the gate around the marker; the estimate homes in on the trace's value there.

1.20
Estimate of the value there
1.06
Describe this picture

One plot of a smooth trace over time, with a marker at t=2.4t = 2.4 and a gate around it. The “Gate width” slider runs from 0.08 to 2, and the readout “Estimate of the value there” shows the running area of the trace times the unit-area gate, to two decimals.

Notice the estimate homes in on the trace’s true height at the marked instant as the gate narrows, exactly what the sifting property predicts.

The continuous spike, switch and ramp

Flip a light switch at t=0t=0. The light level itself, off before and fully on after, is the continuous-time twin of the switch: the unit step u(t)u(t), 00 before t=0t=0 and 11 from t=0t=0 on. The “flick,” the instantaneous, infinitely fast climb from off to on, is the continuous-time twin of the spike: the Dirac delta δ(t)\delta(t) from the last section.

If you know a little calculus, the rate of climb of a curve at an instant is its derivative: in plain words, it’s the curve’s slope, how fast it’s rising or falling right there. u(t)u(t) sits flat at 00, then flat at 11, with all of its rise packed into zero width at t=0t=0: an infinitely steep slope for an instant, which is exactly δ(t)\delta(t). Running the other way, the running area under δ(t)\delta(t) up to time tt is 00 before t=0t=0 and 11 after, which is u(t)u(t) again. And running-summing (integrating) u(t)u(t) one level further gives the ramp r(t)=t u(t)r(t)=t\,u(t), the continuous twin of the discrete ramp from the first section.

dudt=δ(t),u(t)=∫−∞tδ(τ) dτ,r(t)=∫−∞tu(τ) dτ=t u(t)\frac{du}{dt} = \delta(t), \qquad u(t) = \int_{-\infty}^{t} \delta(\tau)\,d\tau, \qquad r(t) = \int_{-\infty}^{t} u(\tau)\,d\tau = t\,u(t)

Here dudt\frac{du}{dt} is the step’s derivative (its slope), δ(τ)\delta(\tau) is the Dirac delta, and τ\tau is just a dummy time variable being run over inside the integral, distinct from the tt at which you’re reading the answer out.

Set Relation to Switch → derivative and read the caption, then to Switch → integral.

The continuous spike, switch and ramp

The same relation as before, now for continuous time.

Integrating turns the spike into the switch. Differentiating turns the switch back into the spike.

Relation
Describe this picture

Two traces over time, one above the other, with a caption between them, and three “Relation” buttons: “Spike → integral”, “Switch → integral” and “Switch → derivative”. The pairs are the spike and the switch, the switch and the ramp, and the switch and the spike. The delta is drawn as an arrow labelled with its area. The caption names the two operations, for example “Differentiating turns the switch into the spike. Integrating turns the spike back into the switch.”

Notice this mirrors the discrete-time selector from the first section exactly: differentiation and integration are standing in for differencing and running-summing, and the delta is drawn as an arrow, since it’s too tall and thin to plot as a curve.

The maths behind it · point masses

Statistics uses the same narrowing-pulse picture for a measurement you’re completely certain of: all of the probability piled onto one single value, with total probability still exactly 1.

Building a pulse from shifted pieces

A camera shutter that’s open for a fixed interval and then shuts is a rectangle: off, then on for a while, then off again. A stage light faded linearly up and then back down is a triangle. Both can be built from the pieces you already have.

A rectangular pulse is two shifted steps, one switching on and a later one switching back off, subtracted:

rect(t)=u(t+1)−u(t−1)\mathrm{rect}(t) = u(t+1) - u(t-1)

Here the first step switches on at t=−1t=-1 and the second switches on (and is subtracted, so it switches the total off) at t=1t=1, giving a pulse of width 22 and height 11 centred at 00. A triangular pulse is built the same way from three shifted ramps: one ramping up, a steeper one ramping it back down, and a third ramping it back to flat.

Set Shape to Rectangle and look at the two coloured pieces against the pale outline, then switch to Triangle.

Building a pulse from shifted pieces

Add the coloured pieces together; they exactly reproduce the dashed outline.

Shape
Describe this picture

One plot over time, with two “Shape” buttons, “Rectangle” and “Triangle”. The rectangle is built from two shifted steps, the triangle from three shifted ramps, each piece in its own colour, with a dashed outline of the target pulse that their sum matches exactly.

Notice that adding the coloured pieces together, at every instant, exactly reproduces the plain outline: any signal that’s straight-line segments stitched together can be written this way.

Worked example

Take x(t)=t2x(t) = t^2 and t0=5t_0 = 5. The sifting property says ∫−∞∞x(t) δ(t−5) dt=x(5)\int_{-\infty}^{\infty} x(t)\,\delta(t-5)\,dt = x(5), and x(5)=52=25x(5) = 5^2 = 25: the integral just reads off the value of t2t^2 at t=5t=5, no other calculation needed.

Now check the rectangular pulse rect(t)=u(t+1)−u(t−1)\mathrm{rect}(t) = u(t+1)-u(t-1) at a point inside it and a point outside it. At t=0t=0: u(1)−u(−1)=1−0=1u(1)-u(-1) = 1-0 = 1, inside the pulse, as expected. At t=1.5t=1.5: u(2.5)−u(0.5)=1−1=0u(2.5)-u(0.5) = 1-1=0, outside the pulse on the right; and at t=−1.5t=-1.5: u(−0.5)−u(−2.5)=0−0=0u(-0.5)-u(-2.5)=0-0=0, outside on the left. The formula agrees with the picture at every point checked.

Where you’ll meet this

The unit sample is the building block Chapter 5 needs to describe how a system responds to any input at all, once you know how it responds to exactly one δ[n]\delta[n]: that response has a name, the impulse response, and it turns out to tell you everything about the system. The unit step is the standard test input for how fast and how smoothly a system settles down, in Chapter 6. And a rectangular pulse is a window, the shape you’ll multiply a signal by whenever you want to look at just one stretch of it, in Chapter 15.

Reference card

TermFormulaNotes
Unit sampleδ[n]=1\delta[n]=1 at n=0n=0, else 00δ[n]=u[n]−u[n−1]\delta[n]=u[n]-u[n-1]
Unit stepu[n]=0u[n]=0 (n<0n<0), 11 (n≥0n\ge0)u[n]=∑k≤nδ[k]u[n]=\sum_{k\le n}\delta[k]
Rampr[n]=n u[n]r[n]=n\,u[n]running-summed step, one level further
Dirac deltaδ(t)=0\delta(t)=0 (t≠0t\ne0), ∫−∞∞δ(t) dt=1\int_{-\infty}^{\infty}\delta(t)\,dt=1limit of a narrowing, unit-area pulse
Sifting property∫x(t) δ(t−t0) dt=x(t0)\int x(t)\,\delta(t-t_0)\,dt = x(t_0)picks out one value of xx
Unit step (continuous)u(t)=0u(t)=0 (t<0t<0), 11 (t≥0t\ge0)dudt=δ(t)\dfrac{du}{dt}=\delta(t), u(t)=∫−∞tδ(τ) dτu(t)=\int_{-\infty}^t \delta(\tau)\,d\tau
Rectangular pulserect(t)=u(t+1)−u(t−1)\mathrm{rect}(t)=u(t+1)-u(t-1)width 22, height 11, centred at 00

End of lesson 3.1

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look