x[0]1x[1]1x[2]1x[3]1Σ1import numpy as np2x, n = np.ones(4), np.arange(4)3w = np.pi / 44X = np.sum(x * np.exp(-1j*w*n))X = 1.00 − 2.41j
-2024-202real partimaginary partARROWS HEAD TO TAILX(e^jπ/4) = 1.00 − 2.41ja closed square: X = 0−2π−π−π/20π/2π2π01234ω (radians per sample)|X|SPECTRUM |X(e^jω)|one period: −π to π2πrepeats every 2π
Coloured parts: what the current step is about; everything else rests in whiteBlocks: the samples x[n], the test-frequency knob ω, one arrow dial per sample, the adder Σ and a Python code cardPlots: the arrows head to tail in the complex plane, and the spectrum |X(e^jω)|The arrows turn as ω changes; the pill shows X(e^jω) right nowX(e^jω) = Σ x[n]·e^(−jωn) for x[n] = 1 at n = 0..3: |X| = 4.00 at ω = 0, 2.61 at ω = π/4 (1000 Hz at 8000 samples/s), 0 at ω = π/2. Some books write the DTFT as X(ω) or X(Ω); this lesson follows Oppenheim & Schafer and writes X(e^jω), a reminder that it depends on ω only through e^jω and so repeats every 2π.

The question

  1. A converter samples a short pulse 8000 times a second. We keep four samples: x[0] to x[3] are all 1, and every other x[n] is 0. The pulse lasts 4/8000 s = 0.5 ms.

Arrows for one frequency

Other test frequencies

The whole spectrum

The working

# step 1/10 · samples

x[n] = 1   for n = 0, 1, 2, 3
x[n] = 0   for every other n

fs = 8000 samples per second
4 samples × 1/8000 s = 0.5 ms

question: which frequencies
make up this pulse?

The four samples of 1 are a chosen example; 8000 samples a second is the telephone rate used in "What a signal is". Every arrow, sum and curve in the figure is computed from the DTFT definition in this model. On the dials the real part points right and the imaginary part points to the back of the table, so −j points toward you; in the flat plot −j points down.