---
title: The Fourier transform for non-periodic signals
heading: When the lines merge into a continuous spectrum
eyebrow: A10 · Lesson 8 · The Fourier transform
xp: 40
---

::: hook
A single pulse, a click, a burst of data: these don't repeat, so they have no fundamental and no harmonics. Yet they plainly contain frequencies. A camera flash disturbs a radio across a wide band; a short click sounds bright, a long thump sounds dull. The way to find their frequencies is to pretend they do repeat, with a very long period, and watch what happens to the line spectrum as the period grows without limit.

::: play
- Each pulse is 0.5 ms wide. The period $T$ doubles with each step of the slider: 1, 2, 4, 8, 16 ms.
- As $T$ grows, what happens to the spacing of the lines? To their heights? To the shape they trace out?
- The second graph is the Fourier transform of one pulse, with the width you choose. Where are its zeros?
:::
:::

```sim plot
view: spectrum
x: t = 0..16m s
y: v = -0.5..1.5 V
samples: 2048
freq: f = 0..8k Hz
slider: p = 0..4 step 1 = 0
plot: step(cos(2*pi*t/(2^p/1000)) - cos(pi*0.5/2^p)) | label: pulses
readout: period T = 2^p ms
readout: line spacing = 1000/2^p Hz
```

```sim plot
view: graph
x: f = -8..8 kHz
y: X = -0.2..1.1 V·ms
slider: tau = 0.2..2 step 0.1 = 0.5 ms
plot: tau*sinc(f*tau) | label: X(f)
marker: x = 1/tau | label: 1/τ
marker: x = -1/tau
readout: area of the pulse = tau V·ms
```

::: predict
## As the period grows and the lines crowd together, what happens to the shape traced by their tops?

- [ ] It gets narrower
- [ ] It gets wider
- [x] It stays the same, set by the pulse's width
- [ ] It disappears

::: reveal
It stays the same: the sinc-shaped envelope with its first zero at $1/\tau$ = 2 kHz. Only the lines get closer together, spaced $1/T$, and shorter, in proportion to $\tau/T$. In the limit of one isolated pulse, the lines merge into a continuous curve with that same shape. That curve, rescaled by $T$ so it doesn't shrink to nothing, is the Fourier transform.
:::
:::

::: nameit
## The Fourier transform

**From series to transform.** For a periodic signal, $c_n = \frac1T\int x(t)\,e^{-j2\pi nf_0t}\,dt$. Multiply by $T$ to stop it shrinking, and let $T \to \infty$: the frequencies $nf_0$ become a continuous variable $f$, and

$$X(f) = \int_{-\infty}^{\infty} x(t)\,e^{-j2\pi ft}\,dt \qquad x(t) = \int_{-\infty}^{\infty} X(f)\,e^{j2\pi ft}\,df$$

$X(f)$ is a **spectral density**: amplitude per hertz, so a voltage signal's transform is in V/Hz (or V·s). The second formula, the inverse transform, rebuilds the signal from all its frequencies.

**Two quick facts.** At $f = 0$, $X(0) = \int x\,dt$: the transform at zero frequency is the area under the signal. And energy is the same in both domains (Parseval): $\int |x(t)|^2dt = \int |X(f)|^2df$.

**Transform pairs worth knowing:**

| Signal | Transform |
|---|---|
| pulse, height $A$, width $\tau$, centered at 0 | $A\tau\,\text{sinc}(f\tau)$, first zero at $1/\tau$ |
| $e^{-at}$ for $t \ge 0$ | $\dfrac{1}{a + j2\pi f}$ |
| Gaussian $e^{-\pi t^2}$ | $e^{-\pi f^2}$, the same shape |
| impulse $\delta(t)$ | 1 at every frequency |
| constant 1 | impulse $\delta(f)$ at zero |
| $\cos(2\pi f_0t)$ | half-strength impulses at $\pm f_0$ |

Here $\text{sinc}(x) = \sin(\pi x)/(\pi x)$. The **impulse** $\delta(t)$ is an idealized pulse, infinitely short with area 1. Its transform is flat: a perfect click contains every frequency equally. The last two rows show the series and the transform agree: a periodic signal's transform is its line spectrum, drawn as impulses.

**The exponential** $e^{-at}$ has $|X(f)| = 1/\sqrt{a^2 + (2\pi f)^2}$, flat at low frequencies and falling as $1/f$ above $f = a/2\pi$: the same shape as an RC filter's response. That's no coincidence, and lesson 20 explains it.
:::

::: example
## A 2 V pulse lasts 0.5 ms. What is its transform at 0 Hz and at 1 kHz?

::: solution
1. **The pulse's transform.**
   $$X(f) = A\tau\,\text{sinc}(f\tau)$$
   with $A\tau = 10^{-3}$ V·s.
2. **At 0 Hz.** It's $10^{-3}$ V/Hz, the area.
3. **At 1 kHz.** Here $f\tau = 0.5$ and $\text{sinc}(0.5) = \frac{2}{\pi}$, so
   $$\begin{aligned} X &= 10^{-3} \times \frac{2}{\pi} \\ &= 6.37 \times 10^{-4}\ \text{V/Hz} \end{aligned}$$
4. **The first zero.** It's at 2 kHz.

**Answer:** $10^{-3}$ V/Hz at 0 Hz and $6.37 \times 10^{-4}$ V/Hz at 1 kHz.
:::
:::

::: example
## Check Parseval's theorem for $x(t) = e^{-at}$, $t \ge 0$, with $a = 1000$ s⁻¹.

::: solution
1. **The energy in time.**
   $$\begin{aligned} \int_0^\infty e^{-2at}dt &= \frac{1}{2a} \\ &= 5 \times 10^{-4}\ \text{V}^2\cdot\text{s} \end{aligned}$$
2. **The energy spectrum.**
   $$|X|^2 = \frac{1}{a^2 + (2\pi f)^2}$$
3. **The energy in frequency.**
   $$\begin{aligned} \int_{-\infty}^\infty \frac{df}{a^2 + 4\pi^2f^2} &= \frac{1}{2\pi a}\cdot\pi \\ &= \frac{1}{2a} \end{aligned}$$
4. **Compare.** The two agree.

**Answer:** both ways give $\frac{1}{2a} = 5 \times 10^{-4}$ V²·s, so Parseval's theorem holds.
:::
:::

::: example
## Find the Fourier transform of the Gaussian pulse $e^{-t^2/(2\sigma^2)}$ with $\sigma$ = 1 ms.

::: solution
1. **The transform.** A Gaussian transforms to a Gaussian:
   $$X(f) = \sigma\sqrt{2\pi}\,e^{-(2\pi f\sigma)^2/2}$$
2. **At 0 Hz.** The value there is the pulse's area:
   $$\begin{aligned} X(0) &= 10^{-3}\sqrt{2\pi} \\ &= 2.51\ \text{ms} \end{aligned}$$
3. **Its width.** It falls to $e^{-1/2} = 0.607$ of that at
   $$\begin{aligned} f &= \frac{1}{2\pi\sigma} \\ &= 159\ \text{Hz} \end{aligned}$$
4. **The trade.** The narrower the pulse in time, the wider its spectrum: the product of the two widths is fixed, and the Gaussian is the shape that makes it as small as possible.

**Answer:** $X(f) = \sigma\sqrt{2\pi}\,e^{-(2\pi f\sigma)^2/2}$, which is 2.51 ms at 0 Hz and falls to 0.607 of that at 159 Hz.
:::
:::

::: check
given: A = 1..9 int; tau = 2 | 5 | 10
answer: A*tau
unit: µV·s
tolerance: 0.5%

## A single pulse is {A} V high and {tau} µs wide. What is its Fourier transform at $f = 0$, in µV·s?

::: right
Right. $X(0)$ is the pulse's area: {A} V × {tau} µs = {answer} µV·s.
:::

::: misses
- [A] Multiply by the width: $X(0)$ is the area.
- [A/tau] It's height times width.
- [any] Not yet. $X(0) = \int x\,dt$.
:::
:::

::: check
given: tau = 2 | 4 | 5 | 10
answer: 1/tau
unit: MHz
tolerance: 0.5%

## A single rectangular pulse is {tau} µs wide. At what frequency is the first zero of its transform?

::: right
Right. $\text{sinc}(f\tau)$ first reaches zero at $f\tau = 1$, so $f = 1/\tau$ = {answer}.
:::

::: misses
- [tau] It's one over the width.
- [1/(2*tau)] The first zero is at $1/\tau$.
- [any] Not yet. Solve $f\tau = 1$.
:::
:::

::: check
given: a = 100 | 500 | 1000; f = 200 | 500 | 1000
answer: 1/sqrt(a^2 + (2*pi*f)^2)
unit: s
tolerance: 0.5%

## What is $|X(f)|$ at $f$ = {f} Hz for $x(t) = e^{-\given{a}t}$ (for $t \ge 0$)?

::: right
Right. $|1/(a + j2\pi f)|$ = {answer}.
:::

::: misses
- [1/(a + 2*pi*f)] Take the size of the complex number: $\sqrt{a^2 + (2\pi f)^2}$.
- [1/sqrt(a^2 + f^2)] Use $2\pi f$.
- [1/a] That's the value at zero frequency.
- [any] Not yet. $|X(f)| = 1/\sqrt{a^2 + (2\pi f)^2}$.
:::
:::

::: check
given: A = 1..9 int; tau = 1 | 2 | 4
answer: 2*A*tau/pi
unit: µV·s
tolerance: 0.5%

## A pulse {A} V high and {tau} µs wide. How big is its transform at $f = 1/(2\tau)$, in µV·s?

::: right
Right. $A\tau\,\text{sinc}(\tfrac12) = A\tau\frac{\sin(\pi/2)}{\pi/2} = \frac{2A\tau}{\pi}$ = {answer}.
:::

::: misses
- [A*tau] That's the peak, at $f = 0$. Halfway to the first zero it's lower.
- [A*tau/2] The sinc isn't a straight line: $\text{sinc}(\tfrac12) = 2/\pi \approx 0.64$.
- [any] Not yet. Evaluate $A\tau\,\text{sinc}(f\tau)$ at $f\tau = \tfrac12$.
:::
:::

::: check
kind: choice

## A very short, sharp voltage spike hits a circuit. Which frequencies does it contain?

- [ ] Only low frequencies
- [ ] Only frequencies near $1/(\text{spike width})$
- [x] Nearly equal amounts of every frequency up to about $1/(\text{spike width})$
- [ ] None: it isn't periodic

::: right
Right. A pulse much shorter than anything else in the circuit acts like an impulse, with a flat spectrum out to about one over its width.
:::

::: misses
- [1] The shorter the pulse, the higher the frequencies it reaches.
- [2] Its transform is flat from zero up to around $1/\tau$, then falls.
- [4] Non-periodic signals have continuous spectra.
:::
:::

::: check
kind: parts
given: A = 1 | 3; T = 0.5 | 2

## A pulse of {A} V lasts {T} ms.

::: part
answer: A*T
unit: mV·s
tolerance: 0.5%

### What is its transform at 0 Hz?

::: misses
- [A] It's the pulse's area.
- [any] $X(0) = \int x\,dt$.
:::
:::

::: part
answer: 1/T
unit: kHz
tolerance: 0.5%

### Where is the spectrum's first null?

::: misses
- [1/(2*T)] The nulls fall at whole multiples of $\frac1T$.
- [any] $\text{sinc}(fT)$ is zero at $f = \frac1T$.
:::
:::
:::

::: check
kind: derivation
vars: s = 0.1..5, f = 0..1

## A Gaussian $e^{-t^2/(2s^2)}$.

::: step
answer: s*sqrt(2*pi)*exp(-(2*pi*f*s)^2/2)

### What is its transform at frequency $f$?
:::

::: step
answer: 1/(2*pi*s)

### At what $f$ has it fallen to $e^{-1/2}$ of its peak?
:::

::: right
Right. Width $\sigma$ in time, width $\frac{1}{2\pi\sigma}$ in frequency.
:::
:::

::: explain
## Why does a single pulse have a continuous spectrum, when a train of the same pulses has separate lines?

::: model
A repeating signal can only contain frequencies that fit a whole number of cycles into its period, so its spectrum is lines spaced $1/T$ apart. A single pulse is like a train whose period has grown without limit. As T grows, the lines get closer together until there's no gap between them, and the spectrum becomes a continuous curve. The shape of that curve, set by the pulse itself, is the same envelope the lines followed all along.
:::
:::

::: practice

::: check
given: A = 1..9 int; tau = 2..9 int
answer: A*tau
unit: mV·s
tolerance: 0.5%

## What is $X(0)$ for a pulse {A} V high and {tau} ms wide, in mV·s?

::: misses
- [any] $X(0)$ is the area under the pulse.
:::
:::

::: check
given: a = 10 | 100 | 1000
answer: 1/a
unit: s
tolerance: 0.5%

## What is $X(0)$ for $e^{-\given{a}t}$, $t \ge 0$?

::: misses
- [a] It's $1/a$: the area under the exponential.
- [any] $\int_0^\infty e^{-at}dt = 1/a$.
:::
:::

::: check
given: f0 = 1..9 int; A = 2 | 4 | 6
answer: A/2
tolerance: 0.5%

## $A\cos(2\pi f_0t)$ with A = {A} and $f_0$ = {f0} kHz has a transform made of two impulses. How strong is each one?

::: misses
- [A] Each gets half: $\cos\theta = \tfrac12(e^{j\theta} + e^{-j\theta})$.
- [any] Half the amplitude at $+f_0$ and half at $-f_0$.
:::
:::
:::
