C9 · Lesson 18 · The discrete-time Fourier transform
The spectrum of a sequence
A sequence of samples has a spectrum just as a continuous signal does, and it's what every digital filter, audio codec and radio is designed around. The discrete-time Fourier transform, or DTFT, computes it. It looks like the Fourier transform with the integral replaced by a sum, but with one important difference that follows straight from lesson 1: discrete-time frequencies 2π apart are the same, so the spectrum of every sequence repeats every 2π. All of a sequence's frequency content lives between −π and π.
- The curve is for a block of N ones, from ω = −π to π. It's tallest at ω = 0, where it equals N, the sum of the samples.
- The nulls fall at multiples of 2π/N. Make the block longer: the main lobe narrows. A longer signal has a narrower spectrum, the time-bandwidth tradeoff again.
- The side lobes never go away: a sudden start and stop always spreads energy across frequency.
Predict
What is the DTFT of , a single 1 at n = 3?
: a flat magnitude of 1 and a phase falling linearly with ω. An impulse contains every frequency equally, and the delay of 3 samples shows up only in the phase, as lesson 15's linear phase.
Name it
The transform pair
X is periodic in ω with period 2π, so one period, −π to π, says everything. Low frequencies are near ω = 0 (and 2π, 4π, …); the highest is ω = π. Two values are easy: and .
Pairs
| x[n] | |
|---|---|
| , | |
| 1 for n = 0 to N − 1 | |
| 1 for , 0 out to π |
The block's magnitude is N at ω = 0 with nulls at multiples of 2π/N, so its main lobe is 4π/N wide.
Properties
- Shift: .
- Modulation: ; multiplying by moves half the spectrum to and half to .
- Convolution: ; the output spectrum of a filter is the input's times .
- Parseval: .
Worked example
Find the DTFT of x = [1, 2, 1] (n = 0 to 2) and its size at ω = 0, π/2 and π.
Show the solution
- Sum the samples.
- Size. That's 4 at 0, 2 at π/2, and 0 at π.
- What it does. It's a smoothing filter that removes the alternating component completely.
Answer , with size 4 at ω = 0, 2 at π/2, and 0 at π.
Worked example
How big is the DTFT of at ω = π/2?
Show the solution
- Evaluate at π/2.
- Compare the ends. At ω = 0 it's 1/0.4 = 2.5 and at π it's 1/1.6 = 0.625: a low-pass shape.
Answer its size at π/2 is 0.857, between 2.5 at DC and 0.625 at π.
Worked example
Find the DTFT of a pulse of 8 ones at ω = 0, π/8 and π/4.
Show the solution
- Size of the DTFT.
- At 0. It's 8, the number of samples.
- At π/8.
- At π/4. Here sin(π) = 0: the first null, at .
- The trade-off. A longer pulse has a narrower main lobe, which is the time-frequency trade-off.
Answer its size is 8 at ω = 0, 5.13 at π/8, and 0 at π/4, the first null.
Check
x = [1, 2, 1, 2], starting at n = 0.
(a)
What is ?
(b)
What is ?
Check
x[n] = 1 for n = 0 to 8 − 1, and 0 elsewhere.
(a)
What is ?
(b)
At what ω is the first null?
Write units the way you normally would: 1.5 rad and 1500 mrad are the same answer.
Check
What is for ?
Check
A sequence is delayed by 5 samples. How much does its DTFT's phase change at ω = 0.3 rad, in degrees?
Check
What is for ?
Check
x[n] has a spectrum concentrated near ω = 0. Where are the two copies of that spectrum in ? (Give the positive one.)
Write units the way you normally would: 1.5 rad and 1500 mrad are the same answer.
Check
Why is every DTFT periodic in ω with period 2π?
Check
with a = 0.8.
(a)
What is at ω = 0?
(b)
And at ω = π?
Check
x = [1, 3, 1] for n = 0 to 2.
(a)
What is at ω = 0.5?
(b)
What is X at ω = 0?
Explain why
A longer block of ones has a narrower DTFT main lobe. Why must a short signal have a wide spectrum?
To build a signal that is nonzero only for a short time, the sinusoids that make it up have to cancel everywhere outside that time and reinforce inside it. Sinusoids that differ in frequency by Δω drift out of step over about 2π/Δω samples, so to cancel within a short span the spectrum needs frequencies far apart, a wide spread. A long block can be built from frequencies close together, which stay in step over its whole length. The block's main lobe width, 4π/N, makes that tradeoff exact: halving the length doubles the width.
Practice
Keep practicing
11 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.