Skip to content
Chapter 12 · Lesson 2 of 4

First, the picture

Five samples, each an arrow turned back by Ω\Omega and added nose to tail. Watch the chain curl and close as Ω\Omega grows.

Five arrows, turned and added

x[n] = 1 for n = −2 to 2. Each sample is an arrow x[n]e^{−jΩn}; their sum is X(e^{jΩ}).

Ω = 0: no turning. The five arrows line up, and X adds to 5, the sum of the samples.

Ω
0 rad/sample
X(e^{jΩ})
5.00
0.00 / 16.00 s
Describe this picture

One plane, real against imaginary, with five unit arrows nose to tail in the order n=−2,−1,0,1,2n=-2,-1,0,1,2, for the pulse x[n]=1x[n]=1 for n=−2n=-2 to 2. Each arrow x[n]e−jΩnx[n]e^{-j\Omega n} is labelled with its nn; arrows that lie on the same stretch share one label, such as “−2, 0, 2” at Ω=π\Omega=\pi. The arrow for n=0n=0 is in the accent colour and the others in the text colour, and a filled square marks the chain’s tip, the sum X(ejΩ)X(e^{j\Omega}). Below, a strip traces the sum against Ω\Omega from 0 to 2π2\pi rad/sample. The readouts are Ω\Omega and X(ejΩ)X(e^{j\Omega}).

The clip holds at four values of Ω\Omega, and the caption says what the chain does. At 0 the five arrows line up and the readout is 5.00. At 0.40π0.40\pi they close a pentagon and the readout is 0.00. At 1.00π1.00\pi they alternate and the readout is 1.00. At 2.00π2.00\pi the readout is 5.00 again. Once the clip has finished, dragging along the strip, or the arrow keys, chooses Ω\Omega from 0 to 2π2\pi; at 0.58π0.58\pi the arrows add to −1.25.

Samples, turned and added

From series to transform (8.1) wound a pulse at any rate and added it up. This page does the same with samples. Each sample is an arrow, each arrow is turned back by Ω\Omega per sample (the unit of Frequency in discrete time, 12.1), and I add the arrows nose to tail.

The result is a function of Ω\Omega, the discrete-time Fourier transform (DTFT):

X(ejΩ)=∑nx[n] e−jΩn.X(e^{j\Omega})=\sum_{n}x[n]\,e^{-j\Omega n}.

The sample x[n]x[n] is the arrow’s length (and its sign), e−jΩne^{-j\Omega n} turns it back by Ωn\Omega n radians, and the sum runs over every integer nn. It is a sum, not 8.1’s integral, so XX carries the signal’s own units and no ”× s”. You have met this sum once: Properties of LTI systems (5.4) wrote H(ejΩ)=∑kh[k]e−jΩkH(e^{j\Omega})=\sum_kh[k]e^{-j\Omega k} for a system’s impulse response.

Five arrows, turned and added

The first signal is a pulse of five samples, x[n]=1x[n]=1 for n=−2n=-2 to 22 and 0 elsewhere. It is centred on n=0n=0, as 8.1’s pulse was, so that XX stays real. The picture at the top of the page turns these five arrows.

Start with the chain. At Ω=0\Omega=0 nothing turns: the five arrows line up, and XX adds to 5, the sum of the samples. At Ω=0.4π\Omega=0.4\pi each arrow turns a fifth of a circle past the last, and five of them close a pentagon. The chain ends where it began, so the sum is 0. Think of five people pulling on a ring with equal force in evenly spread directions: the ring does not move.

At Ω=π\Omega=\pi the arrows alternate. Three point right and two point left, so X=1X=1. At Ω=2π\Omega=2\pi a whole turn per sample is no turn, so XX is 5 again: the curve repeats every 2π2\pi.

When the clip has finished, drag along the strip, or use the arrow keys, to choose Ω\Omega from 0 to 2π2\pi. Try 0.58π, where the arrows add to −1.25. The sum is real throughout, because the pulse is symmetric about n=0n=0: the arrow for −n-n is the mirror image of the arrow for nn.

Why the curve repeats

At Ω+2π\Omega+2\pi every arrow is turned by one whole extra turn per sample, e−j2πn=1e^{-j2\pi n}=1 for a whole number nn. That changes nothing, so

X ⁣(ej(Ω+2π))=X(ejΩ).X\!\left(e^{j(\Omega+2\pi)}\right)=X(e^{j\Omega}).

The spectrum repeats every 2π2\pi, and one period, (−π,π](-\pi,\pi] or 00 to 2π2\pi, holds all of it. This is the circle of 12.1 again: a frequency is a point on a circle, and going once round returns to the start.

The closed form: the Dirichlet kernel

For five samples the sum is a finite geometric series. Pull out the first term, ∑n=−22e−jΩn=ej2Ω∑k=04e−jΩk\sum_{n=-2}^{2}e^{-j\Omega n}=e^{j2\Omega}\sum_{k=0}^{4}e^{-j\Omega k}, and use the finite sum of Difference equations (6.1), ∑k=04ak=(1−a5)/(1−a)\sum_{k=0}^{4}a^k=(1-a^5)/(1-a), with a=e−jΩa=e^{-j\Omega}. Then the half-angle step of 8.1 turns each difference into a sine:

X(ejΩ)=ej2Ω 1−e−j5Ω1−e−jΩ=ej5Ω/2−e−j5Ω/2ejΩ/2−e−jΩ/2=sin⁡(5Ω/2)sin⁡(Ω/2).\begin{aligned} X(e^{j\Omega})&=e^{j2\Omega}\,\frac{1-e^{-j5\Omega}}{1-e^{-j\Omega}} =\frac{e^{j5\Omega/2}-e^{-j5\Omega/2}}{e^{j\Omega/2}-e^{-j\Omega/2}}\\ &=\frac{\sin(5\Omega/2)}{\sin(\Omega/2)}. \end{aligned}

For NN samples, with NN odd and centred on 0, the same steps give sin⁡(NΩ/2)sin⁡(Ω/2)\dfrac{\sin(N\Omega/2)}{\sin(\Omega/2)}. This is the Dirichlet kernel. It is 8.1’s sin⁡(ω/2)/(ω/2)\sin(\omega/2)/(\omega/2) made periodic. Its height at Ω=0\Omega=0 is NN, and it has zeros at the multiples of 2π/N2\pi/N except the multiples of 2π2\pi, which are the tops of the repeats. For N=5N=5 the first zeros are at 0.4π0.4\pi and 0.8π0.8\pi, and between them it dips to −1.25-1.25 near 0.58π0.58\pi.

A pulse of the same five samples, but starting at n=0n=0 (n=0n=0 to 44), is this one delayed by two samples. It has the same size, and its angle is −2Ω-2\Omega more. Properties of the DTFT (12.3) proves the delay rule. At Ω=0.2π\Omega=0.2\pi, for example, the size is 3.236 and the angle is −72°-72° (−0.4π-0.4\pi rad).

The inverse

The spectrum holds the whole signal, and it comes back with an integral over one period:

x[n]=12π∫−ππX(ejΩ) ejΩn dΩ.x[n]=\frac1{2\pi}\int_{-\pi}^{\pi}X(e^{j\Omega})\,e^{j\Omega n}\,d\Omega .

Why does this work? Put the sum for XX inside the integral. The term for sample mm is x[m] 12π∫−ππejΩ(n−m)dΩx[m]\,\frac1{2\pi}\int_{-\pi}^{\pi}e^{j\Omega(n-m)}d\Omega. That integral adds an arrow that turns n−mn-m whole times round the circle, so it is 0 unless m=nm=n, where it is 2π2\pi. Only x[n]x[n] survives. It is 8.1’s inverse over one period only, because the spectrum repeats.

A check on the pulse: the integral gives x[0]=1x[0]=1, x[1]=1x[1]=1 and x[2]=1x[2]=1, and x[3]=0x[3]=0.

One arrow, two curves

For most signals X(ejΩ)X(e^{j\Omega}) is not real. It is one complex number for each Ω\Omega, so I draw it as two curves: its length ∣X∣\lvert X\rvert and its angle ∠X\angle X. A weather vane on a windy day works the same way: how hard and which way are two readings for one wind.

Take x[n]=0.8nx[n]=0.8^n for n≥0n\ge0 and 0 before, a decaying exponential. Its sum is a geometric series that settles, because 0.80.8 is less than 1:

X(ejΩ)=∑n=0∞(0.8 e−jΩ)n=11−0.8 e−jΩ.X(e^{j\Omega})=\sum_{n=0}^{\infty}\left(0.8\,e^{-j\Omega}\right)^n=\frac{1}{1-0.8\,e^{-j\Omega}}.

For a decaying exponential anu[n]a^nu[n] with ∣a∣\lvert a\rvert less than 1 the result is 1/(1−ae−jΩ)1/(1-ae^{-j\Omega}).

The next picture follows the arrow XX for this signal as Ω\Omega runs from 0 to π\pi. Watch its length fall as its tip runs round a circle.

One arrow, two curves

x[n] = 0.8ⁿu[n]. Its X(e^{jΩ}) is one complex number for each Ω: a length and an angle.

Ω = 0: the arrow lies along the real axis with length 5, the sum 1 + 0.8 + 0.64 + …

Ω
0 rad/sample
|X|
5.00
∠X
0.0°
0.00 / 12.00 s
Describe this picture

A plane, real against imaginary, with the arrow XX from the origin, a filled dot at its tip and a dashed line for the path of the tip, for x[n]=0.8nu[n]x[n]=0.8^nu[n]. Beside it, two strips share the axis Ω\Omega from 0 to π\pi rad/sample: the size ∣X∣\lvert X\rvert, a solid curve with a filled dot at the current point, and the angle ∠X\angle X in degrees, a dashed curve with a filled diamond. The readouts are Ω\Omega, ∣X∣\lvert X\rvert and ∠X\angle X.

The clip starts at Ω=0\Omega=0 with the arrow along the real axis, length 5, the sum 1 + 0.8 + 0.64 + …, and the readouts 5.00 and 0.0°. As Ω\Omega grows the tip runs round a circle, and its length and angle draw the two curves. At 0.5π0.5\pi the length is 0.78 and the angle −38.7°. At π\pi the readouts are 0.56 and 0.0°: the size fell nine times. Once the clip has finished, dragging across the curves, or the arrow keys, chooses Ω\Omega from 0 to π\pi; at 0.25π0.25\pi the length is 1.40 and the angle −52.5°.

That is the thing to notice: ∣X∣\lvert X\rvert falls from 5 to 0.556, a factor of 9, so the signal is mostly slow wiggles. The angle starts at 0, dips, and is 0 again at π\pi.

Afterwards, drag across the curves, or use the arrow keys, to choose Ω\Omega from 0 to π\pi. At 0.25π the length is 1.40 and the angle −52.5°. The tip lies on a circle with centre 2.778 and radius 2.222 on the real axis. The two ends of its diameter are the values at Ω=0\Omega=0 (5) and Ω=π\Omega=\pi (0.556). The angle is steepest, −53.13°-53.13°, at Ω=arccos⁡0.8=0.205π\Omega=\arccos0.8=0.205\pi, where ∣X∣=1.667\lvert X\rvert=1.667.

A phase that jumps, and the line under it

An angle read in (−180°,180°](-180°,180°] jumps by 360° whenever the arrow passes the negative real axis, though the arrow itself turns smoothly. A car’s odometer that rolls over at 1000 km does the same: add 1000 at each roll-over and you have the true distance. Undoing the jumps is called unwrapping, and the unwrapped angle is the unwrapped phase. The principal value in (−180°,180°](-180°,180°] is the principal phase.

The cleanest signal for this is a pure delay, x[n]=δ[n−4]x[n]=\delta[n-4]. Its only sample is the 1 at n=4n=4, so X(ejΩ)=e−j4ΩX(e^{j\Omega})=e^{-j4\Omega}: size 1 for every Ω\Omega and angle −4Ω-4\Omega, a straight line.

Watch the angle strip: the angle written in (−180°,180°](-180°,180°] jumps twice, and then its pieces slide down onto one straight line.

A phase that jumps, and the line under it

x[n] = δ[n − 4]: size 1 at every Ω, angle −4Ω.

Ω = 0: the arrow points right. Angle 0.

Ω
0 rad/sample
principal
0.0°
unwrapped
0.0°
0.00 / 14.00 s
Describe this picture

A plane with the unit circle and the arrow X=e−j4ΩX=e^{-j4\Omega}, for x[n]=δ[n−4]x[n]=\delta[n-4]. Two strips share the axis Ω\Omega from 0 to π\pi rad/sample. The size strip is a flat solid line at 1. The angle strip, in degrees, has two traces told apart by width and dash: the principal angle, a thin solid line with open circles at the ends of each jump, and the unwrapped angle, a thick dashed line. The readouts are Ω\Omega, the principal angle and the unwrapped angle.

The clip starts with the arrow pointing right, angle 0. The arrow turns back 4Ω4\Omega, and the principal angle reappears at +180° each time it passes −180°. It holds at Ω=π\Omega=\pi on two jumps of 360°, at 0.25π0.25\pi and 0.75π0.75\pi, with the readouts 0.0° and −720.0°. Then the later pieces slide down, by 360° for the second piece and 720° for the third, and the last caption reads “Unwrapped: add or subtract 360° wherever the angle jumps by 360°. The phase is the straight line −4Ω, which reaches −720° at π.” Once the clip has finished, dragging across the curves chooses Ω\Omega.

The arrow reaches −180°-180° at Ω=0.25π\Omega=0.25\pi (−4Ω=−π-4\Omega=-\pi) and −540°-540° at 0.75π0.75\pi (−3π-3\pi), and the principal angle reads −180°-180° and then jumps back to +180°+180° each time. The arrow never jumped; only the way its angle is written did. At Ω=π\Omega=\pi the unwrapped phase is −720°-720°, and the principal angle is 0°0°. After the clip, drag across the curves to choose Ω\Omega.

NumPy’s np.unwrap does this, in radians. It adds or subtracts 2π2\pi wherever two neighbouring angles differ by more than π\pi, so the angle must be computed at Ω\Omega values close enough that the true phase moves by less than π\pi between them.

The causal pulse (n=0n=0 to 44) has the angle −2Ω-2\Omega plus a jump of 180° at each zero of the Dirichlet kernel. Those jumps are different. The kernel changes sign at each zero, so the arrow really does flip to the other side, and unwrapping by 360° leaves them.

A tone is two arrows, repeated

A tone cos⁡(Ω1n)\cos(\Omega_1n) never dies out, so its sum does not settle at any Ω\Omega in particular. As in Transforms of common signals (8.3), I write its spectrum as arrows labelled by their area. The tone is 12(ejΩ1n+e−jΩ1n)\tfrac12\left(e^{j\Omega_1n}+e^{-j\Omega_1n}\right). The inverse says the arrow 2π δ(Ω−Ω1)2\pi\,\delta(\Omega-\Omega_1) rebuilds ejΩ1ne^{j\Omega_1n}, since 12π⋅2π=1\frac1{2\pi}\cdot2\pi=1, and the spectrum repeats every 2π2\pi. Half of each gives

cos⁡(Ω1n)  ⟷  π∑m[δ(Ω−Ω1−2πm)+δ(Ω+Ω1−2πm)].\cos(\Omega_1n)\;\longleftrightarrow\;\pi\sum_{m}\Big[\delta(\Omega-\Omega_1-2\pi m)+\delta(\Omega+\Omega_1-2\pi m)\Big].

Here mm counts the repeats, and each arrow has area π\pi.

ππππππ−3π−2π−π0π2π3πΩ (rad/sample)
Fig. cos(0.25πn), a 1 kHz tone sampled at 8 kHz: two arrows of area π at ±0.25π, repeated every 2π. The inverse gives back (1/2π)(π e^{j0.25πn} + π e^{−j0.25πn}) = cos(0.25πn).

The shaded band is (−π,π](-\pi,\pi], one period. For Ω1=0.25π\Omega_1=0.25\pi, which is a 1 kHz tone at an 8 kHz sampling rate, the arrows in the band sit at ±0.25π\pm0.25\pi. The inverse over that band gives 12π(πej0.25πn+πe−j0.25πn)=cos⁡(0.25πn)\frac1{2\pi}\left(\pi e^{j0.25\pi n}+\pi e^{-j0.25\pi n}\right)=\cos(0.25\pi n).

When the sum exists

The sum has to settle. If ∑n∣x[n]∣\sum_n\lvert x[n]\rvert is finite, the signal is absolutely summable: the chain of arrows has a finite total length, so its tip settles at every Ω\Omega. The pulse and the decaying exponential are of this kind.

A weaker condition is still useful. The ideal low-pass impulse response h[n]=sin⁡(Ωcn)πnh[n]=\dfrac{\sin(\Omega_cn)}{\pi n}, with h[0]=Ωc/πh[0]=\Omega_c/\pi, is not absolutely summable. Take Ωc=0.25π\Omega_c=0.25\pi. Then h[0]h[0] to h[8]h[8] are 0.250.25, 0.22510.2251, 0.15920.1592, 0.07500.0750, 00, −0.0450-0.0450, −0.0531-0.0531, −0.0322-0.0322, 00. Add ∣h[n]∣\lvert h[n]\rvert over ∣n∣≤M\lvert n\rvert\le M for M=10, 102, 103, 104, 105M=10,\,10^2,\,10^3,\,10^4,\,10^5 and you get 1.5431.543, 2.3972.397, 3.2823.282, 4.1674.167, 5.0515.051. Each factor of 10 adds about 0.88, and there is no limit.

The energy is different. The sum of h[n]2h[n]^2 over the same ranges is 0.24080.2408, 0.24900.2490, 0.24990.2499, 0.250000.25000, 0.250000.25000, and it approaches Ωc/π=0.25\Omega_c/\pi=0.25. A signal whose energy ∑∣x[n]∣2\sum\lvert x[n]\rvert^2 (How big is a signal, 1.3) is finite is square summable. Its DTFT exists in the mean-square sense: the energy of the error of the partial sums goes to 0, while near the band edge they overshoot as in Convergence and the Gibbs phenomenon (7.3).

From a sampled signal

For samples of a continuous signal, x[n]=xc(nTs)x[n]=x_c(nT_s), the DTFT is made of the copies of The sampling theorem (10.2):

X(ejΩ)=1Ts∑kXc ⁣(j Ω−2πkTs).X(e^{j\Omega})=\frac1{T_s}\sum_{k}X_c\!\left(j\,\frac{\Omega-2\pi k}{T_s}\right).

These are 10.2’s copies, with the sampling frequency fsf_s becoming 2π2\pi on the Ω\Omega axis. The repeat every 2π2\pi of this page is the same repeat every fsf_s.

The maths behind it · inner products

Each value X(ejΩ)X(e^{j\Omega}) is the inner product of xx with the arrow sequence ejΩne^{j\Omega n} (the conjugate does the turning back). The DTFT measures how much of each arrow xx contains. The DFT as a matrix (13.5) makes that a change of basis.

The maths behind it · characteristic functions

For a whole-number random variable XX with probabilities p[k]p[k], the characteristic function E{ejΩX}=∑kp[k]ejΩk\mathbb{E}\{e^{j\Omega X}\}=\sum_kp[k]e^{j\Omega k} is a DTFT of the probabilities, with the opposite sign. It repeats every 2π2\pi for the same reason: kk is a whole number.

Worked example

  1. Pulse, N=5N=5 centred. X=sin⁡(5Ω/2)/sin⁡(Ω/2)X=\sin(5\Omega/2)/\sin(\Omega/2). At Ω=0\Omega=0, 0.2π0.2\pi, 0.4π0.4\pi, 0.6π0.6\pi, 0.8π0.8\pi, π\pi it is 55, 3.2363.236, 00, −1.236-1.236, 00, 11. Its lowest value between the zeros is −1.250-1.250 at 0.580π0.580\pi. Direct sums at 0.2π0.2\pi and π\pi give the same values, 3.23613.2361 and 11.
  2. Inverse. 12π∫−ππX ejΩndΩ\frac1{2\pi}\int_{-\pi}^{\pi}X\,e^{j\Omega n}d\Omega for this pulse gives 1, 1, 11,\ 1,\ 1 at n=0,1,2n=0,1,2 and 00 at n=3n=3.
  3. Exponential, a=0.8a=0.8. ∣X∣\lvert X\rvert and ∠X\angle X at Ω=0\Omega=0, 0.25π0.25\pi, 0.5π0.5\pi, 0.75π0.75\pi, π\pi are 55 and 0°0°; 1.4021.402 and −52.48°-52.48°; 0.7810.781 and −38.66°-38.66°; 0.6010.601 and −19.86°-19.86°; 0.5560.556 and 0°0°. The tip’s circle has centre 2.778 and radius 2.222. The signal’s energy is ∑0.64n=1/(1−0.64)=2.778\sum0.64^n=1/(1-0.64)=2.778, which equals 12π∫−ππ∣X∣2dΩ\frac1{2\pi}\int_{-\pi}^{\pi}\lvert X\rvert^2d\Omega.
  4. Delay. For δ[n−4]\delta[n-4] the principal angle jumps at 0.25π0.25\pi and 0.75π0.75\pi. The unwrapped angle −4Ω-4\Omega is −180°-180° at 0.25π0.25\pi, −540°-540° at 0.75π0.75\pi and −720°-720° at π\pi.
  5. Low-pass. For Ωc=0.25π\Omega_c=0.25\pi the sum of ∣h∣\lvert h\rvert keeps growing and the sum of h2h^2 approaches 0.250.25.
  6. Tone. cos⁡(0.25πn)↔\cos(0.25\pi n)\leftrightarrow arrows of area π\pi at ±0.25π+2πm\pm0.25\pi+2\pi m.

Where you’ll meet this

A spectrum analyser that shows the spectrum of recorded samples is drawing ∣X(ejΩ)∣\lvert X(e^{j\Omega})\rvert across one period. The Dirichlet kernel is the shape of a short window’s response: the narrower the pulse in time, the wider the main lobe, as in 8.1, and Windowing and spectral leakage (15.1) returns to it.

Each operation on a signal has a matching change in XX. A delay turns the angle, which is the rule 12.3 proves in Properties of the DTFT. The same sum for a system’s impulse response is its frequency response, the subject of Frequency response of discrete-time systems (12.4). Sampling the curve at equally spaced Ω\Omega gives the DFT, in Sampling the spectrum (13.1).

Reference card

QuantityFormulaNotes
DTFTX(ejΩ)=∑nx[n]e−jΩnX(e^{j\Omega})=\displaystyle\sum_nx[n]e^{-j\Omega n}signal’s units; repeats every 2π2\pi
Inversex[n]=12π∫−ππX(ejΩ)ejΩndΩx[n]=\dfrac1{2\pi}\displaystyle\int_{-\pi}^{\pi}X(e^{j\Omega})e^{j\Omega n}d\Omegaone period is enough
Exists∑∣x[n]∣\sum\lvert x[n]\rvert finite: settles everywhere; ∑∣x[n]∣2\sum\lvert x[n]\rvert^2 finite: in mean squareideal low-pass is the second kind
Centred pulse, NN odd11 for ∣n∣≤N−12\lvert n\rvert\le\frac{N-1}2 ↔sin⁡(NΩ/2)sin⁡(Ω/2)\leftrightarrow\dfrac{\sin(N\Omega/2)}{\sin(\Omega/2)}Dirichlet kernel; height NN, zeros at 2πm/N2\pi m/N
Exponentialanu[n]a^nu[n], ∣a∣\lvert a\rvert less than 1 ↔11−ae−jΩ\leftrightarrow\dfrac1{1-ae^{-j\Omega}}low-pass shape for aa between 0 and 1
Delayδ[n−n0]↔e−jΩn0\delta[n-n_0]\leftrightarrow e^{-j\Omega n_0}size 1, phase −Ωn0-\Omega n_0
Tonecos⁡(Ω1n)↔π∑m[δ(Ω−Ω1−2πm)+δ(Ω+Ω1−2πm)]\cos(\Omega_1n)\leftrightarrow\pi\displaystyle\sum_m\big[\delta(\Omega-\Omega_1-2\pi m)+\delta(\Omega+\Omega_1-2\pi m)\big]arrows of area π\pi
Magnitude, phase∣X∣\lvert X\rvert; ∠X∈(−π,π]\angle X\in(-\pi,\pi]unwrap: remove 2π2\pi jumps
From xcx_cX(ejΩ)=1Ts∑kXc ⁣(jΩ−2πkTs)X(e^{j\Omega})=\dfrac1{T_s}\displaystyle\sum_kX_c\!\left(j\dfrac{\Omega-2\pi k}{T_s}\right)10.2’s copies
Ideal low-passh[n]=sin⁡(Ωcn)πnh[n]=\dfrac{\sin(\Omega_cn)}{\pi n}, h[0]=Ωc/πh[0]=\Omega_c/\pisquare summable only

End of lesson 12.2

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look