ADCx[0]–x[1]–x[2]–x[3]–x[4]–1import numpy as np2fs = 80003n = np.arange(40)4x = 10*np.sin(2*np.pi*440*n/fs)x = 0.00 mVx
012345-10-50510t (ms)x (mV)CONTINUOUS TIME x(t)x(0.5 ms) = 9.82 mVTA = 10 mV · T = 2.27 ms010203039-10-50510n (sample number)x[n] (mV)DISCRETE TIME x[n]
Coloured parts: what the current step is about; everything else rests in whiteBlocks: tuning fork, microphone, converter (ADC), memory cells and a Python code cardPlots: the continuous signal x(t) and its samples x[n] as stemsCrests in the air and the sample token move in slow motion; the pill shows x(t) right nowA 440 Hz tone becomes a voltage x(t) = 10·sin(2π·440·t) mV, is sampled 8000 times a second into x[n], and is rounded to whole steps of 0.1 mV. The converter is an example: 8 bits over −12.8 to +12.7 mV in steps of 0.1 mV. (Telephone audio under G.711 also stores 8 bits per sample, but with uneven, companded steps.) Sampling and rounding (quantization) each get their own lesson in the next module.

Sound becomes a signal

  1. A tuning fork rings. Its prongs swing 440 times a second and push the air, so the air pressure near it rises and falls. A quantity that changes and carries information is a signal.

A function of time

From smooth to numbers

Signals in code

The working

# step 1/10 · quantity

fork        rings at f0 = 440 Hz (the note A4)
air         pressure goes up, down, up ...

signal = a quantity that changes
         (over time, or over space)
         and carries information

here: the pitch 440 Hz says "this is an A"
motion in the figure: slowed down a lot

The amplitude 10 mV is a chosen example of a small microphone voltage; 440 Hz is the standard pitch A4 (ISO 16); 8000 samples a second is the telephone rate of ITU-T G.711. Every number in the figure is computed from this model. The motion is slowed down a great deal: the real fork swings 440 times a second, and the sound crests in the air are drawn much closer together than in real air.