1import numpy as np2fs, B = 8.0, 3.0 # kHz3n = np.arange(-2000, 2001)4x = B*np.sinc(B*n/fs)**25for f in (1, 7, 9): # kHz6 e = np.exp(-2j*np.pi*f*n/fs)7 print(f, round(abs(x@e)/fs, 3))x(t)x(t)x(t)x[n]x[n]x[n]x[n]x[n]x[n]
-1.5-0.7500.751.50123t (ms)x(t)TIME-12-8-40481200.51f (kHz)Ts·Xs(f)SPECTRUM
Coloured parts: what the current step is about; everything else rests in whiteBlocks: the signal source, the sampling clock, the sampler, a low-pass filter, the output and a Python cardPlots: the pulse in time with its samples, and its spectrum with the copies sampling makesCopies slide to every multiple of fs; slowing the clock moves them together until they overlapSampling x(t) every Ts multiplies it by a pulse train, so its spectrum X(f) is copied to every multiple of fs = 1/Ts. Copies stay apart when fs > 2B; then a low-pass filter rebuilds x(t). Too slow, and the copies overlap: aliasing. The low-pass filter here is ideal (a brick wall). Real filters roll off gradually, which is why real systems sample a good deal faster than 2B.

A pulse and a clock

  1. Our signal is a short smooth pulse, x(t) = 3·sinc²(3t), with t in milliseconds. Its spectrum X(f) is a triangle: it holds every frequency from 0 up to B = 3 kHz and nothing above. Such a signal is called band-limited.

Copies in the spectrum

Sampling too slowly

Check and rule

The working

# step 1/11 · signal

x(t) = B·sinc²(B·t),  B = 3 kHz, t in ms
sinc(u) = sin(πu) / (πu)

X(f) = 1 − |f| / B   for |f| < 3 kHz
     = 0             above

x(0) = 3  (peak);  X(0) = 1
band-limited: nothing above B = 3 kHz

(pair: sinc²  <->  triangle)

The pulse x(t) = 3·sinc²(3t) is chosen because its spectrum is an exact triangle up to 3 kHz; the rates 8 and 4 kHz keep the numbers small (Oppenheim & Willsky, ch. 7). Every curve and value in the figure is computed from this model. The spectrum plot shows Ts·Xs(f), the sum of the copies, so every copy keeps height 1; the true Xs(f) is fs times taller. The comb lines stand for impulses and are drawn at height 1.