x(t)CS10 kHzADCx[0]–x[1]–x[2]–x[3]–x[4]–1import numpy as np2fs = 100003n = np.arange(21)4x = np.sin(2*np.pi*1000*n/fs)held 0.000 Vx
00.511.52-1-0.500.51t (ms)x (V)SNAPSHOTS OF x(t)fs/f0 = 10 per cyclex(0.05 ms) = 0.309 Vfs/f0 = 40 per cycle500 Hz fits too05101520-1-0.500.51n (tick number)x[n] (V)THE LIST x[n]
Coloured parts: what the current step is about; everything else rests in whiteBlocks: signal source, clock, switch and capacitor (sample and hold), converter (ADC), memory cells, a Python code cardPlots: x(t) with its snapshots and held value, and the list x[n] as stemsThe switch, the clock flash and the number token move in slow motion; the pill shows the held voltageA 1000 Hz wave x(t) = sin(2π·1000·t) V is sampled every Ts = 0.1 ms (fs = 10,000 per second): x[n] = x(n·Ts). Then the clock runs at 40,000 and at 1500 per second. A real sample and hold also has a buffer amplifier, and the held voltage slowly leaks away; how the converter turns the held voltage into bits is the lesson Inside an ADC.

Why snapshots

  1. A signal source puts a smooth 1000 Hz wave on a wire: x(t) = sin(2π·1000·t) volts. It has a value at every instant, so even one millisecond holds infinitely many values. No computer can store them all.

Taking a snapshot

How often?

Snapshots in code

The working

# step 1/10 · smooth

x(t) = A·sin(2π·f0·t)
     A  = 1 V
     f0 = 1000 Hz  (1000 cycles a second)
     one cycle = 1/1000 s = 1 ms

between t = 0 and t = 1 ms there are
infinitely many instants, each with a value

plot: x(t) in volts against t in ms
motion in the figure: slowed down a lot

The 1000 Hz tone at 1 V and the 10,000 per second clock are chosen examples; 8000 per second is the telephone rate (ITU-T G.711) and 44,100 per second the audio CD rate. Every number and curve in the figure is computed from this model. The motion is slowed down a great deal: the real clock ticks every 0.1 ms, and the real switch closes for a far shorter time than drawn.