---
title: Steps, impulses and complex exponentials
heading: The building blocks every signal is made from
eyebrow: C9 · Lesson 3 · Steps, impulses and complex exponentials
xp: 40
---

::: hook
Three signals do most of the work in this course. The unit step is a switch turning on. The impulse is a kick so short that only its area matters: a hammer tap, a lightning strike, a single nonzero sample. And the complex exponential, $e^{st}$ or $z^n$, is a sinusoid that can grow or decay, the natural response of every circuit you've analyzed. Any signal can be built from shifted impulses, and almost any from complex exponentials. Those two facts are what convolution and Fourier analysis rest on.
:::

::: play
- The dots are the real part of $z^n$, with $z = re^{j\omega_0}$: $r^n\cos(\omega_0 n)$. The dashed curves are the envelope $\pm r^n$.
- With r = 1 the samples oscillate forever. Below 1 they die away; above 1 they grow. That's the discrete-time version of a pole's real part.
- $\omega_0$ sets how fast the samples swing. At $\omega_0 = \pi$ they alternate in sign every sample.
:::
:::

```sim plot
view: graph
x: n = 0..40
y: x = -2..2
slider: r = 0.7..1.1 = 0.92 step 0.01
slider: w = 0..3.1416 = 0.5236 step 0.01
plot: r^n | dashed
plot: -r^n | dashed
plot: r^n*cos(w*n) | stems | label: Re z^n
readout: samples to halve the envelope = log(0.5)/log(r) | digits: 3
readout: samples per turn = 2*pi/w | digits: 3
```

::: predict
## What is $\int_{-\infty}^{\infty} \cos(t)\,\delta(t - \pi)\,dt$?

- [ ] 0
- [ ] 1
- [x] −1
- [ ] π

::: reveal
−1. The impulse is zero everywhere except at t = π, so the integral picks out the cosine's value there: $\cos\pi = -1$. That's the **sifting** property.
:::
:::

::: nameit
## Steps and impulses

The **unit step** u(t) is 0 for t < 0 and 1 for t > 0. The **unit impulse** δ(t) is the limit of a pulse of area 1 made ever narrower and taller. It's defined by what it does inside an integral:

$$\int_{-\infty}^{\infty} x(t)\,\delta(t - t_0)\,dt = x(t_0)$$

so $x(t)\delta(t - t_0) = x(t_0)\delta(t - t_0)$. The step is the running integral of the impulse, $u'(t) = \delta(t)$, and scaling the time variable scales the area: $\delta(at) = \delta(t)/\lvert a\rvert$.

In discrete time there's nothing to take a limit of: $\delta[n]$ is 1 at n = 0 and 0 elsewhere, and u[n] is 1 for n ≥ 0. Every sequence is a sum of shifted, scaled impulses,

$$x[n] = \sum_{k=-\infty}^{\infty} x[k]\,\delta[n - k]$$

which is the starting point for convolution.

## Complex exponentials

$e^{st}$ with $s = \sigma + j\omega$ is $e^{\sigma t}(\cos\omega t + j\sin\omega t)$: a sinusoid at ω inside an envelope $e^{\sigma t}$ that decays for σ < 0. Its real part is the damped sinusoid of every second-order circuit.

The discrete version is $z^n$ with $z = re^{j\omega_0}$: $r^n(\cos\omega_0 n + j\sin\omega_0 n)$. The envelope $r^n$ decays when r < 1, so in discrete time the unit circle $\lvert z\rvert = 1$ plays the part the jω axis plays in continuous time.
:::

::: example
## Evaluate $\int (t^2 + 2)\delta(t - 3)\,dt$ and $\int e^{-t}\delta(2t - 4)\,dt$, both over all t.

::: solution
1. **Sift the first.** The impulse picks out the value at t = 3:
   $$3^2 + 2 = 11$$
2. **Rescale the second impulse.**
   $$\begin{aligned} \delta(2t - 4) &= \delta(2(t - 2)) \\ &= \tfrac12\delta(t - 2) \end{aligned}$$
3. **Sift the second.**
   $$\tfrac12 e^{-2} = 0.0677$$

**Answer:** the first integral is 11, and the second is $\tfrac12 e^{-2} = 0.0677$.
:::
:::

::: example
## Describe $x[n] = (0.9e^{j\pi/6})^n$.

::: solution
1. **Rotation.** It turns by π/6 each sample, so one full turn every 12 samples.
2. **Decay per turn.** Its size shrinks by 0.9 each sample, so after one turn it's down to
   $$0.9^{12} = 0.28$$
3. **Halving time.** It halves every
   $$\ln 0.5/\ln 0.9 = 6.6\ \text{samples}$$

**Answer:** it's a decaying spiral that turns once every 12 samples, shrinks to 0.28 of its size each turn, and halves every 6.6 samples.
:::
:::

::: example
## Write the pulse that is 2 from t = 1 to t = 3 (and 0 elsewhere) with steps, and find its derivative.

::: solution
1. **Write it with steps.** Switch on at 1, switch off at 3:
   $$x(t) = 2u(t - 1) - 2u(t - 3)$$
2. **Differentiate.** Each step becomes an impulse of area 2, up at the start and down at the end:
   $$x'(t) = 2\delta(t - 1) - 2\delta(t - 3)$$
3. **Check.** Integrating the derivative from −∞ rebuilds the pulse, as it should.

**Answer:** $x(t) = 2u(t - 1) - 2u(t - 3)$, and its derivative is $2\delta(t - 1) - 2\delta(t - 3)$, an impulse of area 2 at each edge.
:::
:::

::: check
given: t0 = 1 | 2 | -3; c = 1 | 5
answer: t0^2 + c
tolerance: 0.5%

## What is $\int_{-\infty}^{\infty} (t^2 + \given{c})\,\delta(t - \given{t0})\,dt$?

::: right
Right. The impulse picks out the value at t = {t0}: {answer}.
:::

::: misses
- [c] The impulse is at t = {t0}, not at 0.
- [any] Not yet. Evaluate the function where the impulse sits.
:::
:::

::: check
given: a = 2 | 4 | -3; b = 2 | 6; K = 3 | 10
answer: K/abs(a)
tolerance: 0.5%

## What is $\int_{-\infty}^{\infty} \given{K}\,\delta(\given{a}t - \given{b})\,dt$?

::: right
Right. $\delta(at - b)$ has area 1/|a|: {answer}.
:::

::: misses
- [K] Scaling the impulse's time variable changes its area.
- [any] Not yet. $\delta(at - b) = \delta(t - b/a)/\lvert a\rvert$.
:::
:::

::: check
given: a = 0.5 | 0.8 | -0.7; n0 = 2 | 3 | 5
answer: a^n0
tolerance: 0.5%

## $x[n] = (\given{a})^n u[n]$. What is $\sum_n x[n]\,\delta[n - \given{n0}]$?

::: right
Right. It picks out $x[\given{n0}]$ = {answer}.
:::

::: misses
- [a] The impulse sits at n = {n0}.
- [any] Not yet. Only the term at n = {n0} survives.
:::
:::

::: check
given: r = 0.8 | 0.9 | 0.95; N = 5 | 10 | 20
answer: r^N
tolerance: 0.5%

## $z = \given{r}e^{j\pi/4}$. What is $\lvert z^n\rvert$ at n = {N}?

::: right
Right. $r^N$ = {answer}; the angle doesn't change the size.
:::

::: misses
- [r*N] The size multiplies by r each sample.
- [any] Not yet. $r^N$.
:::
:::

::: check
kind: parts
given: sigma = -2 | -50 | -0.1; w = 10 | 377 | 6.28

## A signal is $\operatorname{Re}\{e^{st}\}$ with $s = \given{sigma} + j\given{w}$ (per second).

::: part
answer: -1/sigma
unit: s
tolerance: 0.5%

### What is the envelope's time constant?

::: misses
- [1/sigma] The envelope is $e^{\sigma t}$, which decays for negative σ, with time constant $-1/\sigma$.
- [any] Not yet. $-1/\sigma$.
:::
:::

::: part
answer: w/(2*pi)
unit: Hz
tolerance: 0.5%

### At what frequency does it oscillate?

::: misses
- [w] That's in radians per second.
- [any] Not yet. $\omega/2\pi$.
:::
:::
:::

::: check
given: N = 4 | 9 | 25
answer: N
tolerance: 0

## How many nonzero samples does $u[n] - u[n - \given{N}]$ have?

::: right
Right. n = 0 to {N} − 1: {N} samples.
:::

::: misses
- [N + 1] u[n − N] is 1 from n = {N} on, so sample {N} cancels.
- [any] Not yet. List where each step is 1.
:::
:::

::: check
kind: choice

## What is the derivative of the unit step u(t)?

- [ ] 0 everywhere
- [ ] u(t) itself
- [x] The impulse δ(t)
- [ ] It has no derivative of any kind

::: misses
- [1] It's 0 everywhere except at t = 0, where the step jumps by 1. That jump is an impulse of area 1.
- [2] That's $e^t$.
- [4] As an ordinary function it doesn't, but the impulse is exactly what describes its jump.
:::
:::

::: check
kind: parts
given: a = 2 | 3 | 4; b = 2 | 6 | 9

## Evaluate $\int (t^2 + 1)\,\delta(at - b)\,dt$ over all t, with a = {a} and b = {b}.

::: part
answer: b/a
tolerance: 0.5%

### Where does the impulse sit?

::: misses
- [b] $at - b = 0$ at $t = b/a$.
- [any] Solve $at = b$.
:::
:::

::: part
answer: ((b/a)^2 + 1)/a
tolerance: 0.5%

### What is the integral?

::: misses
- [(b/a)^2 + 1] $\delta(at - b) = \delta(t - b/a)/a$: divide by a.
- [any] The function's value there, divided by a.
:::
:::
:::

::: check
kind: parts
given: r = 0.8 | 0.9 | 0.95; k = 4 | 6 | 10

## $x[n] = (re^{j\pi/k})^n$ with r = {r} and k = {k}.

::: part
answer: 2*k
tolerance: 0

### How many samples does one full turn take?

::: misses
- [k] π/k a sample: 2π takes 2k samples.
- [any] $2\pi/(\pi/k)$.
:::
:::

::: part
answer: ln(0.5)/ln(r)
tolerance: 0.5%

### After how many samples has its size halved?

::: misses
- [any] Solve $r^n = 1/2$.
:::
:::
:::

::: explain
## Why does an impulse "sift out" the value of a function, and why does δ(2t) have area 1/2?

::: model
The impulse is the limit of a pulse of area 1 squeezed to zero width around one point. Multiplying a smooth function by that pulse and integrating gives the function's value at that point times the pulse's area, because over the vanishing width the function is effectively constant. So only the value at the impulse survives. δ(2t) is the same pulse with its time axis squeezed by 2: as narrow as before in its own variable but half as wide in t, with the same height, so its area in t is 1/2.
:::
:::

::: practice

::: check
given: t0 = 2 | -1; c = 3 | 7
answer: t0^3 + c
tolerance: 0.5%

## What is $\int (t^3 + \given{c})\delta(t - \given{t0})\,dt$ over all t?

::: misses
- [any] Sift: evaluate at t = {t0}.
:::
:::

::: check
given: r = 0.7 | 0.85 | 0.99
answer: log(0.5)/log(r)
tolerance: 0.5%

## How many samples does $r^n$ take to halve, with r = {r}?

::: misses
- [any] Solve $r^n = 1/2$.
:::
:::

::: check
given: a = 3 | 5; K = 2 | 6
answer: K/a
tolerance: 0.5%

## What is $\int \given{K}\delta(\given{a}t)\,dt$?

::: misses
- [any] Area 1/a.
:::
:::
:::
